{ data }, and a job comes back as an id you poll — or a webhook that calls you when it’s done.
Scrape: synchronous by default
A scrape waits for the result and returns it inline. You get{ data } with the formats you asked for.
async: true — it returns a job id instead, with a 201:
string
waiting, active, completed, or failed.object
The scraped page, present when
status is completed.string
Set when
status is failed.Set
async: true up front when you know a page is heavy — a JavaScript-rendered app, a long settle time — so your request never blocks waiting for it.Crawl and batch: always async
A crawl (discover and scrape a whole site) and a batch (scrape an explicit list of URLs) always run as background jobs. Starting one returns an id immediately with a201:
- Poll
- Webhook
Request the job’s status endpoint for live progress and per-page results:Batches use
GET /v1/web/batch/{id}. Both return the same status shape:status moves through running to completed (or failed / cancelled). Each entry in pages carries its own status and, once done, its scraped data.Verifying a webhook
Your webhook endpoint is a public URL, so anyone who finds it can POST to it. Set awebhook.secret and we sign every callback, letting you prove a request came from us and reject anything that didn’t.
Each signed delivery carries these headers:
To verify, recompute the HMAC over the raw request body — not a re-serialized version of the parsed JSON, which may produce different bytes and never match:
Checking whether a delivery landed
A webhook that never arrives is the hardest kind of bug to chase from your side, so we keep the delivery history and expose it. Every callback we attempted for a job is listed, with its status, how many attempts we made, and what your endpoint returned last.GET /v1/web/batch/{id}/deliveries.
object[]
failed row with a responseStatus of 5xx usually means your endpoint was down when we called; one with a 4xx means we reached you and you rejected it — check the signature verification above before assuming the payload is wrong.
Which calls return what
A single URL is always answered inline unless you opt out. Crawl and batch are jobs because they
span many URLs and can run for minutes; one page cannot, so it does not get a second response shape
you have to write code for.
Next: Errors
The structured error model and every status you’ll see.