Skip to main content
POST /web/crawl follows links from a starting URL and returns page Markdown in the same HTTP response. There is no background job to poll.
Use Crawl Sync for small crawls under 500 pages when you need results in one response. Choose Crawl Async (25K pages) for larger sites, background processing, or crawls that outlast the sync time budget.
Crawls cost 1 credit per successfully scraped page, plus 1 credit per PDF page recovered by OCR when enabled. Set maxPages to bound the crawl; PDF OCR can add to that budget.

Prerequisites

Export an API key from the dashboard:

Crawl a bounded section

This request starts at the Context.dev documentation, follows links one hop away, and collects up to three pages.

Read the result

The response separates page results from crawl-level totals:
Check results[].metadata.success before using a page’s Markdown. A successful HTTP response for the crawl can contain page-level failures or skipped pages.

Control crawl coverage

Content controls apply to each crawled page, including includeSelectors, excludeSelectors, includeFrames, country, and PDF parsing options.

Production behavior

  • The API accepts up to 500 pages, but maxPages is a ceiling, not a guarantee that the crawl finishes within its time budget. Use Crawl Async when the job needs to continue in the background.
  • maxAgeMs applies to each page and defaults to one day. Set it to 0 when every page must be fetched again.
  • A soft stopAfterMs can produce a useful partial result. A hard timeoutMS produces a 408 instead.
  • urlRegex is both a relevance control and a cost control. Test it against expected URLs before raising maxPages.
  • zdr=enabled bypasses shared caches and retained content logs when Zero Data Retention is enabled for your organization.

Next steps

Crawl Async

Crawl up to 25,000 pages in the background and retrieve results later.

Crawl API reference

Review the full crawl request and response contract.

Discover website URLs

Inspect sitemap URLs before estimating a large crawl.

Build a RAG pipeline

Turn the returned Markdown into a searchable knowledge base.