Crawl a batch
Queue up to 100 URLs in one request; poll the job or get it at your webhook.
POST
/v1/crawls/batchOn this page
Price
Pricepage
- Live
- $0.00011
- Standard fetch
- $0.00011
- Rendered fetch
- $0.0011
- Protected fetch
- $0.003
Per page, at the level that delivered it.
Description
Returns 202 with a job_id straight away. Read the results with GET /v1/crawls/{id}, or set webhook_url and we POST the finished job to it. Options apply to every target. If any target isn't a valid public URL, nothing is queued and the response lists each bad target.
The wallet check reserves the worst case for every target (or max_cost each). Billing. One page at the price of the fetch level that delivered it (Standard $0.00011, Rendered $0.0011, Protected $0.003). Blocked, failed and non-substantive pages cost $0.
Request
- Endpoint
- POST https://api.dataforgaio.com/v1/crawls/batch
- Authentication
- HTTP Basic auth: any login, with your
dg_API key as the password. ABearerheader with the key also works. Create a key. - Body
- JSON object
Fields
- The pages to fetch, 1 to 100.Min
1Max100Example[{"url":"https://summitrunning.example/trail-shoes"},{"url":"https://summitrunning.example/stores"}]Show 1 child fieldsHide child fields
- An absolute http(s) URL on a public host.Max
2000Examplehttps://summitrunning.example/trail-shoes
- An absolute http(s) URL on a public host.
- We POST the finished job (the GET /v1/crawls/{id} body) here. Must be https on a public host.Max
2000Examplehttps://hooks.summitrunning.example/crawls - Lets a blocked page move to a higher fetch level, billed at the level that delivered it.
falsestops at the requested level and returns the failure at $0.DefaulttrueExampletrue - The highest fetch level Auto-upgrade may use.Default
protectedOne ofstandardrenderedprotectedExamplerendered - The most one page may cost, in USD, up to 6 decimal places. The wallet check reserves this instead of the worst-case price, and a fetch never upgrades past it.Min
0Example0.002 - What
contentholds: Markdown text, the page HTML, or a JSON object of the page's title, text and metadata.DefaultmarkdownOne ofmarkdownhtmljsonExamplemarkdown - The level to start at.
renderedruns JavaScript from the first fetch and needsmax_levelrendered or protected.browseris accepted as an older name forrendered.DefaultstandardOne ofstandardrenderedExamplestandard trueis the same asengine: rendered.Defaultfalse- Include the receipt on each task.Default
trueExampletrue - A project in your organization to file this under. Leave it out for the default project.Example
5b2f8c1e-3d4a-4e6f-9a0b-1c2d3e4f5a6b
Response
Shape: Native. Expand a field to see its children; every field has a link anchor.
- job_idstringJob id,
job_….Examplejob_8cbb5b5c8e155c82995945f93cdad009 - tasks_countintegerNumber of targets queued.Example
2 - statusstringAlways
queued.Examplequeued
Errors
| Code | When |
|---|---|
| invalid_request | HTTP 400. Invalid options, an empty list, or more than 100 targets. |
| unauthorized | HTTP 401. Missing, malformed or revoked API key. |
| balance_required | HTTP 402. Your wallet balance is below the most this request could cost. Nothing ran. |
| invalid_target | HTTP 422. A URL is not an absolute public http(s) URL. Nothing was fetched. |
| rate_limited | HTTP 429. Too many requests, or too many inline requests in flight for your organization. Honor Retry-After. |
Tasks that end in an error are not billed. All status codes
Related endpoints
- POSTCrawl a pageFetch one page now and get its content with a receipt: where and when it was fetched, what robots.txt and the site's AI-use signals said, a content hash and the cost.
- GETGet a crawlA batch job and its tasks, or one task, with content and receipts.
- GETGet crawl receiptsJust the receipts for a job or task, one per page.