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: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.
includePathsandexcludePathsmatch 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.includeSubdomainsis off by default, matching the map API’s naming.crawlEntireDomaindefaults to false, keeping discovered pages within the starting path. Enable it to follow sibling and parent paths.ignoreQueryParametersdefaults to false. Enable it to visit one variant per path while preserving the first discovered URL’s query.sitemapacceptsinclude,skip, oronly.onlyattempts 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
scrapeOptions uses the supported page-scrape options. Crawl and batch requests do not accept custom request headers.
Save the collection ID
Creation returns HTTP202. This response excerpt shows a queued two-page batch:
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 returneddata.id before closing your application. Set it in the shell where you run these examples:
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 forGET /v1/batch/scrape/$COLLECTION_ID/results?cursor=0&limit=1:
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:
/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.
/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
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. UseIdempotency-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.