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.
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: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
maxPagesis 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. maxAgeMsapplies to each page and defaults to one day. Set it to0when every page must be fetched again.- A soft
stopAfterMscan produce a useful partial result. A hardtimeoutMSproduces a408instead. urlRegexis both a relevance control and a cost control. Test it against expected URLs before raisingmaxPages.zdr=enabledbypasses 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.