curl --request POST \
--url https://api.prefetch.io/batch/{endpoint} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"urls": [
"stripe.com",
"https://linear.app",
"notion.so"
],
"options": {
"design_tokens": true
},
"concurrency": 123,
"ignore_invalid_urls": true,
"webhook": "<string>"
}
'import requests
url = "https://api.prefetch.io/batch/{endpoint}"
payload = {
"urls": ["stripe.com", "https://linear.app", "notion.so"],
"options": { "design_tokens": True },
"concurrency": 123,
"ignore_invalid_urls": True,
"webhook": "<string>"
}
headers = {
"X-API-Key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
urls: ['stripe.com', 'https://linear.app', 'notion.so'],
options: {design_tokens: true},
concurrency: 123,
ignore_invalid_urls: true,
webhook: '<string>'
})
};
fetch('https://api.prefetch.io/batch/{endpoint}', 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.prefetch.io/batch/{endpoint}",
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' => [
'stripe.com',
'https://linear.app',
'notion.so'
],
'options' => [
'design_tokens' => true
],
'concurrency' => 123,
'ignore_invalid_urls' => true,
'webhook' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.prefetch.io/batch/{endpoint}"
payload := strings.NewReader("{\n \"urls\": [\n \"stripe.com\",\n \"https://linear.app\",\n \"notion.so\"\n ],\n \"options\": {\n \"design_tokens\": true\n },\n \"concurrency\": 123,\n \"ignore_invalid_urls\": true,\n \"webhook\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.prefetch.io/batch/{endpoint}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"stripe.com\",\n \"https://linear.app\",\n \"notion.so\"\n ],\n \"options\": {\n \"design_tokens\": true\n },\n \"concurrency\": 123,\n \"ignore_invalid_urls\": true,\n \"webhook\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/batch/{endpoint}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"stripe.com\",\n \"https://linear.app\",\n \"notion.so\"\n ],\n \"options\": {\n \"design_tokens\": true\n },\n \"concurrency\": 123,\n \"ignore_invalid_urls\": true,\n \"webhook\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "crw_7c2e9a4b1d0f4e6a8b3c5d7e9f1a2b3c",
"status": "pending",
"endpoint": "enrich",
"url_count": 3,
"invalid_urls": [],
"created_at": "2026-10-13T09:14:03.221Z",
"expires_at": "2026-10-14T09:14:03.221Z"
},
"meta": {
"requestId": "6f1d2c3b-4a5e-4f60-8b7a-9c0d1e2f3a4b",
"durationMs": 1840
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}POST /batch/{endpoint}
Run brand, enrich, company, classify, screenshot or styleguide on up to 500 URLs as one job, with a webhook when it’s done. Free to submit; each URL costs what one call costs.
curl --request POST \
--url https://api.prefetch.io/batch/{endpoint} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"urls": [
"stripe.com",
"https://linear.app",
"notion.so"
],
"options": {
"design_tokens": true
},
"concurrency": 123,
"ignore_invalid_urls": true,
"webhook": "<string>"
}
'import requests
url = "https://api.prefetch.io/batch/{endpoint}"
payload = {
"urls": ["stripe.com", "https://linear.app", "notion.so"],
"options": { "design_tokens": True },
"concurrency": 123,
"ignore_invalid_urls": True,
"webhook": "<string>"
}
headers = {
"X-API-Key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
urls: ['stripe.com', 'https://linear.app', 'notion.so'],
options: {design_tokens: true},
concurrency: 123,
ignore_invalid_urls: true,
webhook: '<string>'
})
};
fetch('https://api.prefetch.io/batch/{endpoint}', 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.prefetch.io/batch/{endpoint}",
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' => [
'stripe.com',
'https://linear.app',
'notion.so'
],
'options' => [
'design_tokens' => true
],
'concurrency' => 123,
'ignore_invalid_urls' => true,
'webhook' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.prefetch.io/batch/{endpoint}"
payload := strings.NewReader("{\n \"urls\": [\n \"stripe.com\",\n \"https://linear.app\",\n \"notion.so\"\n ],\n \"options\": {\n \"design_tokens\": true\n },\n \"concurrency\": 123,\n \"ignore_invalid_urls\": true,\n \"webhook\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.prefetch.io/batch/{endpoint}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"stripe.com\",\n \"https://linear.app\",\n \"notion.so\"\n ],\n \"options\": {\n \"design_tokens\": true\n },\n \"concurrency\": 123,\n \"ignore_invalid_urls\": true,\n \"webhook\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/batch/{endpoint}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"stripe.com\",\n \"https://linear.app\",\n \"notion.so\"\n ],\n \"options\": {\n \"design_tokens\": true\n },\n \"concurrency\": 123,\n \"ignore_invalid_urls\": true,\n \"webhook\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "crw_7c2e9a4b1d0f4e6a8b3c5d7e9f1a2b3c",
"status": "pending",
"endpoint": "enrich",
"url_count": 3,
"invalid_urls": [],
"created_at": "2026-10-13T09:14:03.221Z",
"expires_at": "2026-10-14T09:14:03.221Z"
},
"meta": {
"requestId": "6f1d2c3b-4a5e-4f60-8b7a-9c0d1e2f3a4b",
"durationMs": 1840
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}Overview
/batch/{endpoint} runs one endpoint over a list of URLs or bare domains — up to 500 — as a single job:
| Path | Each URL is answered as |
|---|---|
POST /batch/enrich | GET /enrich |
POST /batch/brand | GET /brand |
POST /batch/company | GET /company |
POST /batch/classify | GET /classify |
POST /batch/screenshot | GET /screenshot |
POST /batch/styleguide | GET /styleguide |
GET /batch/{endpoint}/{id}, or delivered to your webhook as each URL finishes. One request instead of hundreds, and no concurrency limit to manage on your side.
To scrape a list of pages into markdown, use POST /batch/scrape.
Example requests
curl -X POST "https://api.prefetch.io/batch/enrich" \
-H "X-API-Key: $PREFETCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": ["stripe.com", "linear.app", "notion.so"],
"webhook": "https://example.com/hooks/prefetch"
}'
curl -X POST "https://api.prefetch.io/batch/brand" \
-H "X-API-Key: $PREFETCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": ["https://vercel.com", "https://figma.com"],
"options": { "design_tokens": true },
"concurrency": 3
}'
const submit = await fetch("https://api.prefetch.io/batch/enrich", {
method: "POST",
headers: { "X-API-Key": process.env.PREFETCH_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ urls: ["stripe.com", "linear.app", "notion.so"] }),
});
const { data: job } = await submit.json();
let status;
do {
await new Promise((r) => setTimeout(r, 5000));
const res = await fetch(`https://api.prefetch.io/batch/enrich/${job.id}`, {
headers: { "X-API-Key": process.env.PREFETCH_API_KEY },
});
status = (await res.json()).data;
} while (status.status === "pending" || status.status === "running");
for (const item of status.data) {
console.log(item.url, item.ok ? item.company?.name : item.error_code);
}
Example response
{
"success": true,
"data": {
"id": "crw_7c2e9a4b1d0f4e6a8b3c5d7e9f1a2b3c",
"status": "pending",
"endpoint": "enrich",
"url_count": 3,
"invalid_urls": [],
"created_at": "2026-10-13T09:14:03.221Z",
"expires_at": "2026-10-14T09:14:03.221Z"
},
"meta": { "requestId": "1d2c3b4a-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "durationMs": 212 }
}
Options
options are the endpoint’s own parameters, as GET /{endpoint} takes them, applied to every URL — snake_case or camelCase, typed JSON or strings:
| Endpoint | Example options |
|---|---|
| brand, enrich | { "design_tokens": true, "css": true, "screenshot_colors": 5 } |
| screenshot | { "device": "iphone_15", "dark_mode": true, "format": "webp" } |
| styleguide | { "dark_mode": true } |
| company, classify | none |
400 naming it.
Also: concurrency (URLs in parallel, 1–5, default 2), ignore_invalid_urls (drop malformed or blocklisted URLs, listed in invalid_urls, instead of rejecting the batch), and webhook. Duplicates — including the same site under another spelling — run once.
Webhooks
webhook works as it does for crawls, with events named for the endpoint: batch_enrich.started, batch_enrich.page (one per URL, carrying its result), batch_enrich.completed and batch_enrich.failed. Each delivery is signed with the secret returned when the batch is created.
Webhooks are not available through RapidAPI: poll the status endpoint instead.
Credits
Submitting is free. Each URL answered costs what one call of that endpoint costs — 12 for enrich, 10 for brand or styleguide, 5 for company or classify, 1 for screenshot — charged as URLs complete: when you poll the status endpoint, or when the batch ends, whichever comes first, and never twice. URLs that fail are never charged. A batch your key cannot pay for is refused up front withCREDITS_EXHAUSTED, and the message says how many URLs fit: a 500-domain /batch/enrich can cost up to 6,000 credits.
Related
GET /batch/{endpoint}/{id}
POST /batch/scrape
Authorizations
Your Prefetch API key. Obtain one from the dashboard.
Path Parameters
What every URL is run through. /batch/scrape has its own page.
brand, enrich, company, classify, screenshot, styleguide "enrich"
Body
The URLs or bare domains to run (1–500). Duplicates run once. domains is accepted too.
[ "stripe.com", "https://linear.app", "notion.so" ]
The endpoint's own parameters, as GET /{endpoint} takes them, applied to every URL — e.g. {"design_tokens": true} for brand or enrich, {"device": "iphone_15"} for screenshot. Typed JSON or strings.
Show child attributes
Show child attributes
{ "design_tokens": true }
URLs run in parallel (1–5). Default: 2.
Drop URLs that fail validation (listed in invalid_urls) instead of rejecting the whole batch. Default: false.
Where to send progress. Each delivery is signed — X-Prefetch-Signature: t=<unix>,v1=<hex>, HMAC-SHA256 of <t>.<raw body> with the secret returned when the job is created — the same scheme as monitor webhooks.