Skip to main content
Crawl and batch require an API key with scrape scope. Creation returns HTTP 202 with a collection ID in data.id. Collections continue after the client disconnects.

Crawl a website

Create an operation key once before a new request:
Save that value with your task. Keep it when rerunning the script for an identical retry; do not rerun the generation command. If uuidgen is unavailable, set your own unique value. For a different request, generate a new value. Node.js and Python require the saved key and use the shared HTTP client. Read retries before retrying a request whose result you did not receive.
Crawl follows site links and sitemap URLs, with a maximum of 100 pages and depth 10. The start page is depth zero and attempted first. Sitemap candidates and links from the start page are depth one. Robots rules apply to the start page and redirected destinations. The start URL may redirect to its final site URL, which becomes the starting point for link and sitemap discovery. Subsequent page redirects must stay within the configured crawl scope.
  • includePaths and excludePaths match URL pathnames using regex, such as ^/docs/. Exclusions win. Each list accepts 20 patterns of up to 512 characters. Look-around and backreferences are rejected.
  • includeSubdomains is off by default, matching the map API’s naming.
  • crawlEntireDomain defaults to false, keeping discovered pages within the starting path. Enable it to follow sibling and parent paths.
  • ignoreQueryParameters defaults to false. Enable it to visit one variant per path while preserving the first discovered URL’s query.
  • sitemap accepts include, skip, or only. only attempts the start URL and sitemap candidates without following page links.
scrapeOptions reuses the page-scrape schema for formats, content filtering, rendering and waits. Page options are not duplicated at the crawl root.

Scrape a URL list

A batch accepts up to 100 URLs and deduplicates identical entries. scrapeOptions uses the supported page-scrape options. Crawl and batch requests do not accept custom request headers.

Save the collection ID

Creation returns HTTP 202. This response excerpt shows a queued two-page batch:
Keep data.id. All status, results, and cancellation calls use that ID and a key with scrape scope from the same organization.

Check progress

Save the returned data.id before closing your application. Set it in the shell where you run these examples:
The examples below check batch status at most 60 times, waiting two seconds between checks. They use the existing ID and never create another collection. Node.js and Python use the shared HTTP client.
The cURL loop requires Bash and jq. If a status request fails or the loop ends while work is still queued or running, keep the ID and resume polling later. Stopping polling does not cancel work. Do not fetch final results until you have checked the status. For a crawl, replace /v1/batch/scrape with /v1/crawl. For domain branding, poll /v1/brand/$COLLECTION_ID/status. Check failed, warning, and each page’s result before using the content.

Read all results

A response excerpt for GET /v1/batch/scrape/$COLLECTION_ID/results?cursor=0&limit=1:
Pass data.next_cursor as the next cursor until it is null. Result cursors are integer offsets; limit defaults to 10 and accepts up to 20. Results remain accessible after cancellation. These examples read every batch results page using pages from the shared HTTP client:
Use /v1/crawl/$COLLECTION_ID/results for crawl results. If a page request fails, retry the read using that collection ID and the last saved cursor. Do not create another collection.

List previous collections

GET /v1/batch/scrape and GET /v1/crawl list collections for the key’s organization. Their data contains collections and an opaque next_cursor; pass that cursor to list older entries. List limit defaults to 20 and accepts up to 100. List cursors and result cursors are different types.
Use /v1/crawl for crawl history. To resume pagination, pass the last saved cursor as the third argument to pages. The first results cursor is 0; the first history request omits the cursor.

Cancel a collection

For a crawl, send DELETE /v1/crawl/$COLLECTION_ID. Cancellation stops pending work and releases unused reserved credits. A page already being fetched may take a short time to stop. Revoking the key that started the collection also stops pending work.

Credits and limits

The page limit is reserved upfront at the normal page price. Pages that are charged use one credit each. Unused, failed, and cancelled pages release their reserved credits. Previously completed pages retain their charges after cancellation. Unfinished collections expire 24 hours after creation and release unused reserved credits. Time spent waiting to start counts toward this window. The window does not determine how long results are stored. At most ten collections may be active per organization. Use Idempotency-Key on creation to safely retry identical inputs without creating a second collection. Poll the returned ID after a replay. See retries before retrying an uncertain result. Collection creation shares the organization limit of 30 calls per minute with map, search, and brand.