Skip to main content
POST
Batch Scrape

Overview

Submit up to 5,000 URLs and get a job id back immediately. Each URL becomes its own pipeline job with its own trace id and its own time budget. That per-URL budget is the reason to use this rather than fanning out from your own client: client side parallelism queues every request against one deadline, so the requests that wait longest are the ones that get dropped. Here a slow URL cannot consume another URL’s time, and the job as a whole has no response deadline.

Parameters

string[]
required
URLs to scrape, 1 to 5,000. Duplicates are removed before anything is charged or fetched.
boolean
default:false
Render each URL in a browser. Leave this off unless the pages genuinely need it. The browser tier runs roughly ten concurrent jobs across the whole fleet where the cheap path runs hundreds, so a rendered batch is both far slower and far smaller.
string
default:"markdown"
raw, json or markdown.
boolean
default:true
Strip page furniture when format is markdown.
string
Two-letter country code for the proxy exit, for example us.
integer
How many URLs to have in flight at once, 1 to 50. Defaults by destination, because the two fetch paths have very different ceilings: 4 for browser-bound batches, 20 otherwise. Raising it past the browser pool does not go faster, it just means jobs wait and then exceed their budget.
string
default:"jsonl"
Artifact format for the combined download: json, jsonl or csv.
string
Replay protection. If a request carrying this key has already created a job, the original job id is returned with replayed: true and nothing new is created or charged. Keys are scoped to your API key and kept for 24 hours. Use it whenever you retry a submission you did not get an answer to — otherwise a retry creates a second job and charges a second time.

Credits

One credit per unique URL, deducted when the batch is accepted. The request is rejected with 402 if your balance will not cover it.

Example Request

Response

A replay of an earlier Idempotency-Key returns the same shape plus "replayed": true.

Then

  • GET /batch/scrape/{id} for progress
  • GET /batch/scrape/{id}/items for the per-URL outcome, including errorCode on failures
  • GET /batch/scrape/{id}/download for the combined artifact
  • POST /batch/scrape/{id}/cancel to stop it

Note on concurrency and the target site

concurrency is global to the job, not per host. A list of 1,000 URLs spread over three domains at the default 20 means roughly seven requests in flight against each site continuously, which is how you get rate limited or escalated against. If your URLs are concentrated on a few hosts, submit one batch per host and size concurrency for that host.