Need more than one page? Crawl a website. Need JSON fields rather than page content? Extract structured data.
Prerequisites
Create an API key in the dashboard and keep it in a server-side environment variable:Get Markdown
Pass a completehttp:// or https:// URL. useMainContentOnly removes detected navigation, sidebars, and footers so the result focuses on the page body.
Get rendered HTML
UseGET /web/scrape/html when downstream code needs DOM markup rather than Markdown.
includeHTML=true on a Markdown request when you need both representations from the same scrape.
Content controls
If an include selector matches nothing, the request can still succeed with an empty result. Check
contentLength before indexing or summarizing the page.
Handle dynamic or protected pages
Use the least expensive control that produces the page state you need:- Set
waitForMswhen content appears shortly after load. - Set
settleAnimations=truewhen transitions make captures inconsistent. - Use browser actions when the page requires a click, scroll, or ordered interaction.
- Set
countrywhen the page varies by country or is unavailable from the default route.
WEBSITE_BLOCKED; unsuccessful requests are not billed.
Control freshness and retention
The defaultmaxAgeMs is 86400000 (one day). A matching cached result younger than that value can be returned.
Forwarding custom
headers also bypasses cache reads and writes. Keep secrets out of forwarded headers unless the target site requires them.
Plan for failures
See Troubleshooting for stable error codes and retry guidance.
Next steps
Build live web tools for an agent to turn selected pages into bounded, citable evidence with explicit read failures.Discover website URLs
Find candidate URLs in public sitemaps.
Crawl a website
Follow links and collect content from multiple pages.
Extract page images
Get image sources, dimensions, and optional classification.
Extract structured data
Return fields shaped by your JSON Schema.
Scrape websites in batches
Process large or asynchronous scraping workloads.
Production best practices
Prepare retries, caching, and error handling for user-facing requests.
timeoutOpts.behavior: "return-partial", a scrape can return finalDOMState: "still-loading" when the deadline arrives before the requested waits finish. Treat that content as incomplete. See Timeouts and partial results for minimum budgets, billing, and migration guidance.