Skip to main content
/scrape fetches one URL and returns it in the formats you ask for. It handles the tedious parts of scraping:
  • JavaScript rendering: pages that need a browser get one, automatically. Static pages take the fast path.
  • Bot walls: blocked requests escalate through stealth and proxy tiers before giving up.
  • Boilerplate: navigation, sidebars, footers and cookie banners are stripped by default.
  • Absolute URLs: every link and image is resolved against the page, so the output still works once you store it elsewhere.

Formats

Pass formats as a comma-separated list. Each format you ask for appears as its own object on data. Formats you don’t ask for are absent, not null, so if (data.markdown) is a reliable check. metadata is always there, whatever you ask for. Every option also works as a JSON body to POST /scrape. That’s easier than a query string when you pass a json_schema or headers object.

Example requests

Example response

Main content

only_main_content is true by default. It removes navigation, headers, footers, sidebars, share widgets and cookie bars before building markdown, html, summary and json. Some pages aren’t shaped like an article, such as a product grid or a landing page. Rather than guess which part is “the content”, Prefetch returns the full page body, sets main_content_only: false, and says so in warnings:
links and images always come from the full page, even with only_main_content. If you’re mapping a site, the navigation links are the ones you want.
To decide yourself, name the content with include_selectors, or name what to drop with exclude_selectors:

Structured data with json

Ask for the json format with a plain-language json_prompt, a json_schema, or both. Asking for json without either returns a 400.
Values come only from the page. A field that isn’t on the page comes back null, rather than being filled in from the model’s own knowledge.

Pages that load late

Some pages fill in after they load. wait_for waits a fixed number of milliseconds (up to 30,000) before reading the page. wait_for_selector waits up to 10 seconds for a CSS selector to appear. If it never appears, you get the page as it is, with a warning. Either option renders the page in a browser.

Fresh or stored copies

Every request fetches the page live by default. Set max_age to accept a stored copy instead. See Caching.

PDFs

A URL that serves a PDF is read as a document. Its text becomes the markdown (and what summary and json read), and a pdf block reports page_count, pages_parsed and truncated. Up to 300 pages are read. Scanned PDFs have no text layer and aren’t OCR’d, and warnings says so.

Prompt-injection check

Pages are untrusted text, and most of what /scrape returns is read by a language model. Set check_prompt_injection=true and a model reads the page for instructions aimed at AI: telling an assistant to ignore its task, leak data or take an action. The verdict comes back in prompt_injection:
  • The page is still returned. The check warns but doesn’t block, so you can still read a page that only discusses prompt injection.
  • complete: false means part of the text couldn’t be checked, because the page was very long or the check was briefly unavailable. detected: false then means nothing was found in what was checked, not that the page is clean.
  • It costs the same 3-credit surcharge as summary and json, once per page however many of the three you ask for. Crawls and batch scrapes take it in scrape_options and charge it per page.
Over MCP, prefetch_scrape puts a flagged page’s verdict above the page text, where the agent reads it first.

Partial failures

summary, json and the prompt-injection check use a language model, and they can fail without losing the rest of the scrape. When that happens, the format returns null values and the reason appears in warnings:
The response is still success: true, and you’re still charged, because the page was fetched.

Content size

markdown, html and raw_html are each capped at 1 MB. Content that hits the cap is cut on a character boundary and flagged:

Next

Map a site

Find every URL on a site before you scrape it. 1 credit.

API reference

Every parameter, and a playground to try it.