When to use async
Inline requests (POST /v1/fetch, POST /v1/crawl, etc.) have a maximum execution time of 15 seconds. For operations that take longer — large crawls, multi-step interactions, YouTube crawl jobs — use the Jobs API.
Any surface can be run as an async job by submitting to POST /v1/jobs.
Submitting a job
202 Accepted):
kind values: fetch, crawl, interact, search, map.
Polling for status
Job lifecycle
result_available: true means you can fetch the result. Poll until this is true or the status is failed/cancelled.
Retrieving the result
Onceresult_available is true, fetch the result:
fetch jobs:
Idempotency
Send anIdempotency-Key header to safely retry job submission without creating duplicate jobs:
Idempotency-Key with the same body again, the original job is returned. A different body returns 409 Conflict.
Polling strategy
A reasonable polling interval is 2–5 seconds for short jobs, 15–30 seconds for crawls. Do not poll more than once per second.Result TTL
Job results are retained for 24 hours after completion. After that,/v1/jobs/{id}/result returns 404.