Core
Batch

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
Free2
Hobby5
Pro10
Scale20

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_KEY

Body

FieldTypeRequiredDefaultDescription
urlsstring[]YesURLs to scrape. A non-empty array of valid http:// or https:// URLs. Duplicates are dropped. Capped as described above.
asyncbooleanNofalseRun the batch as a job. Also applies automatically to more than 100 URLs. The call returns 202 { jobId, status: "queued", total, message }.
webhookstringNoAsync only. Public http(s) URL that receives a signed batch.completed or batch.failed event. See Webhooks.
ignoreRobotsTxtbooleanNofalserobots.txt is respected by default; set true to opt out.
options.extractListingbooleanNotrueRun the listing extraction pipeline on each page.
options.includeHtmlbooleanNofalseInclude raw HTML in each result. Increases response size.
options.concurrencynumberNo5Parallel fetch limit. Clamped to your tier cap (see table above).
options.timeoutnumberNoTime 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

FieldTypeDescription
resultsarrayOne entry per URL in input order (see result item below)
summary.totalnumberTotal URLs processed
summary.oknumberNumber of successful scrapes
summary.failednumberNumber of failed scrapes
summary.latencyMsnumberWall-clock time for the entire batch in milliseconds

Result item

FieldTypeDescription
urlstringThe URL that was scraped
okbooleantrue if the page was fetched successfully
markdownstring | nullPage content as markdown
htmlstring | undefinedRaw HTML (only present when options.includeHtml: true)
listingobject | nullStructured listing data (same shape as /v1/scrape)
statusCodenumber | nullHTTP status code from the fetch
errorstring | undefinedError message when ok is false
metadata.fetchMethodstringHow the page was fetched: "plain", "playwright", or "stealth"
metadata.latencyMsnumberFetch 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

StatusErrorCause
400`urls` must be a non-empty arrayurls field missing, not an array, or empty
400too_many_urlsMore URLs than the sync cap (100, or your plan cap if lower) or the async plan cap. The body carries limit and plan.
400blocked_webhookwebhook resolves to a private, loopback or metadata address
400Invalid URL(s) + invalidUrls arrayOne or more entries are not valid URLs
400Invalid JSON bodyMalformed request body
401API key requiredMissing x-api-key header
429Rate limit exceededToo 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 with 503 batch_queue_unavailable and 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 with status: "not_run" and cost nothing, and the summary's stopped says why (insufficient_credits or billing_unavailable). If a job is retried after an interruption, URLs it already charged are not fetched or charged again; they come back with status: "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/:id until status is "completed" or "failed".