curl --request POST \
--url https://api.seltz.ai/v1/fetch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"urls": [
"https://example.com/"
]
}
'import requests
url = "https://api.seltz.ai/v1/fetch"
payload = { "urls": ["https://example.com/"] }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({urls: ['https://example.com/']})
};
fetch('https://api.seltz.ai/v1/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.seltz.ai/v1/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'urls' => [
'https://example.com/'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.seltz.ai/v1/fetch"
payload := strings.NewReader("{\n \"urls\": [\n \"https://example.com/\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.seltz.ai/v1/fetch")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"https://example.com/\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"https://example.com/\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "",
"results": []
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}Fetch
curl --request POST \
--url https://api.seltz.ai/v1/fetch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"urls": [
"https://example.com/"
]
}
'import requests
url = "https://api.seltz.ai/v1/fetch"
payload = { "urls": ["https://example.com/"] }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({urls: ['https://example.com/']})
};
fetch('https://api.seltz.ai/v1/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.seltz.ai/v1/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'urls' => [
'https://example.com/'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.seltz.ai/v1/fetch"
payload := strings.NewReader("{\n \"urls\": [\n \"https://example.com/\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.seltz.ai/v1/fetch")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"https://example.com/\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"https://example.com/\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "",
"results": []
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}Headers
Seltz API key: https://console.seltz.ai/api-keys
Body
API key to access the service. Either this or the x-api-key header must
be supplied on the HTTP surface; the header takes precedence and is the
documented path. On gRPC this field is the only carrier.
Each URL that comes back with the OK status is billed. A URL that comes back with an error is not. The call is refused up front unless the balance covers the whole batch.
Representations to return, as documented format names.
Omitted, or sent empty, means \["markdown"\] -- a repeated field carries
no presence, so the two are the same request and neither means "no
formats".
Documented names:
"markdown" -- the main content as Markdown, boilerplate removed.
An unrecognized name is rejected.
The service tier, which selects the price. Send "pro". Unset resolves to
"pro".
An unrecognized value is rejected rather than defaulted, because the value selects a price. The name is matched exactly.
Wall-clock budget for one URL, in milliseconds.
Applies to each URL, not to the batch. A URL that exceeds the budget gets
error.code = "timeout"; the others in the same request are unaffected.
Unset means 75000, which is also the maximum; a larger value is served as 75000, and a value below 1000 is served as 1000.
x >= 0The URLs to fetch. At least one, at most 20.
An empty list, more than 20 entries, a duplicate entry, a blank or padded
entry, or an entry over 2048 bytes is rejected before any billing --
duplicates because FetchResult.requested_url is the correlation key and
a repeated key is ambiguous.
Everything else is reported inside a 200 as that URL's error result: a
value that is not an absolute http or https URL, a host that does not
resolve or that this service will not fetch, an origin that refuses, and a
document whose media type this service does not serve.
Response
One result per requested URL. A failure to fetch a page is still a 200, with that result's status = "error".
One result per requested URL.
Identifies this request. Quote it when reporting a problem with the
response. Also returned as the x-request-id response header, with the
same value.
One entry per entry in FetchRequest.urls, successful or not, in the order
the URLs were requested.
Correlate on FetchResult.requested_url rather than on position.
Show child attributes
Show child attributes