POST /v1/batch
Scrape many URLs in one request. A synchronous batch takes up to 100 URLs, or your plan's batch_urls cap if that is lower (Free: 25). An async batch takes up to your plan's batch_urls cap: Free 25, Hobby 200, Pro 2,000, Scale 10,000.
In a synchronous batch, results are returned in the same order as the input array. Failed URLs are included in the response with ok: false and an error field. One failed URL never fails the whole batch.
The options.concurrency you request is clamped to your plan's batch concurrency, served by GET /v1/pricing as request_caps.batch_concurrency (and to a
hard ceiling of 20 regardless of plan):
| Plan | /v1/batch worker cap |
|---|---|
| Free | 2 |
| Hobby | 5 |
| Pro | 10 |
| Scale | 20 |
These are batch workers, not the account-wide concurrency figure quoted on Pricing. Batch is the only endpoint whose concurrency your plan sets; deep tech scans, parse and screenshots have fixed service caps.
Request
POST /v1/batch
Content-Type: application/json
x-api-key: YOUR_KEYBody
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
urls | string[] | Yes | URLs to scrape. A non-empty array of valid http:// or https:// URLs. Duplicates are dropped. Capped as described above. | |
async | boolean | No | false | Run the batch as a job. Also applies automatically to more than 100 URLs. The call returns 202 { jobId, status: "queued", total, message }. |
webhook | string | No | Async only. Public http(s) URL that receives a signed batch.completed or batch.failed event. See Webhooks. | |
ignoreRobotsTxt | boolean | No | false | robots.txt is respected by default; set true to opt out. |
options.extractListing | boolean | No | true | Run the listing extraction pipeline on each page. |
options.includeHtml | boolean | No | false | Include raw HTML in each result. Increases response size. |
options.concurrency | number | No | 5 | Parallel fetch limit. Clamped to your tier cap (see table above). |
options.timeout | number | No | Time in milliseconds the fetch levels may spend on each URL, from 1000 up to your plan's ceiling (30000 on Free, 120000 on paid plans), as timeout on scrape. A synchronous batch that could run longer than 240 seconds (URL waves at your concurrency × timeout, plus half a second per URL for the start spacing) returns 400 with code: "timeout_too_long_for_sync"; send async: true instead. In a synchronous batch each URL gives up 20 seconds after its timeout, and the whole batch stops at 260 seconds; a URL cut off this way comes back with ok: false and a timeout error, and is not charged. Must be a whole number; outside the range or above your plan's ceiling is a 400 with code: "invalid_timeout". |
Batch does not forward cookies or custom headers. To scrape pages that need them, call POST /v1/scrape per URL with cookies / headers.
Example request
curl -X POST https://api.superscraper.dev/v1/batch \
-H "x-api-key: ss_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://www.northside-roasters.example/cafes/downtown",
"https://www.example-directory.example/coffee-roasters/portland/hilltop-coffee",
"https://www.example-directory.example/coffee-roasters/portland"
],
"options": {
"extractListing": true,
"concurrency": 3
}
}'Response
HTTP 200 on success. The response header X-Batch-Summary summarises the run in a compact format: ok=N;failed=M;latencyMs=X.
Body
| Field | Type | Description |
|---|---|---|
results | array | One entry per URL in input order (see result item below) |
summary.total | number | Total URLs processed |
summary.ok | number | Number of successful scrapes |
summary.failed | number | Number of failed scrapes |
summary.latencyMs | number | Wall-clock time for the entire batch in milliseconds |
Result item
| Field | Type | Description |
|---|---|---|
url | string | The URL that was scraped |
ok | boolean | true if the page was fetched successfully |
markdown | string | null | Page content as markdown |
html | string | undefined | Raw HTML (only present when options.includeHtml: true) |
listing | object | null | Structured listing data (same shape as /v1/scrape) |
statusCode | number | null | HTTP status code from the fetch |
error | string | undefined | Error message when ok is false |
metadata.fetchMethod | string | How the page was fetched: "plain", "playwright", or "stealth" |
metadata.latencyMs | number | Fetch time for this individual URL |
Example response
{
"results": [
{
"url": "https://www.northside-roasters.example/cafes/downtown",
"ok": true,
"markdown": "# Northside Coffee Roasters\n\n**4.8** ★ ...",
"listing": {
"name": "Northside Coffee Roasters",
"phone": "(503) 555-0142",
"address": "2210 N Williams Ave",
"city": "Portland",
"state": "OR",
"zip": "97227",
"rating": 4.8,
"review_count": 214,
"_completeness": 0.92,
"_extraction_method": "json-ld"
},
"statusCode": 200,
"metadata": {
"fetchMethod": "plain",
"latencyMs": 412
}
},
{
"url": "https://www.example-directory.example/coffee-roasters/portland/hilltop-coffee",
"ok": true,
"markdown": "# Hilltop Coffee\n\n**4.6** ★ ...",
"listing": { "name": "Hilltop Coffee", "rating": 4.6, "_completeness": 0.88, "_extraction_method": "json-ld" },
"statusCode": 200,
"metadata": { "fetchMethod": "plain", "latencyMs": 389 }
},
{
"url": "https://www.example-directory.example/coffee-roasters/portland",
"ok": false,
"markdown": null,
"listing": null,
"statusCode": 403,
"error": "Fetch failed: HTTP 403",
"metadata": { "fetchMethod": "plain", "latencyMs": 211 }
}
],
"summary": {
"total": 3,
"ok": 2,
"failed": 1,
"latencyMs": 847
}
}Errors
| Status | Error | Cause |
|---|---|---|
| 400 | `urls` must be a non-empty array | urls field missing, not an array, or empty |
| 400 | too_many_urls | More URLs than the sync cap (100, or your plan cap if lower) or the async plan cap. The body carries limit and plan. |
| 400 | blocked_webhook | webhook resolves to a private, loopback or metadata address |
| 400 | Invalid URL(s) + invalidUrls array | One or more entries are not valid URLs |
| 400 | Invalid JSON body | Malformed request body |
| 401 | API key required | Missing x-api-key header |
| 429 | Rate limit exceeded | Too many requests in the sliding window |
Notes
- Sync credits: one credit per URL that was scraped successfully. Failed URLs are free.
- Async credits: one credit per URL is held when the job is queued (the response's
max_credits). When the job ends, only URLs that were scraped successfully are charged and the rest is returned to your balance. If the job cannot be queued, the request fails with503 batch_queue_unavailableand nothing is charged. When the job runs, it holds one credit for each URL just before fetching it, and each URL is charged at most once per job. If your balance or the billing system cannot cover the next URL, the job stops: URLs it did not fetch come back withstatus: "not_run"and cost nothing, and the summary'sstoppedsays why (insufficient_creditsorbilling_unavailable). If a job is retried after an interruption, URLs it already charged are not fetched or charged again; they come back withstatus: "already_charged"and no content, because results are not kept between attempts. - Concurrency is capped by your plan tier.
- Poll an async batch at
GET /v1/jobs/:iduntilstatusis"completed"or"failed".