Skip to main content
GET
Scrape a page

Overview

/scrape fetches one URL and gives it back to you in whichever formats you ask for. It handles the parts that make scraping tedious:
  • 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 somewhere else.
Pass formats as a comma-separated list. Each format you request appears as its own object on data. Formats you do not request are absent, not null — so if (data.markdown) is a reliable check. metadata is always present, whatever you request.

Example requests

Example response

Main content isolation

only_main_content defaults to true. It removes navigation, headers, footers, sidebars, share widgets, and cookie bars before rendering markdown, html, summary, and json. When a page is not article-shaped — a product grid, a landing page — isolation would have to guess which fragment is “the content”. Rather than guess, it returns the full page body, sets main_content_only: false, and tells you in warnings:
links and images are always read from the full document, even when only_main_content is true. If you are mapping a site, the navigation links are exactly the ones you want.
To take control yourself, use include_selectors to name the content, or exclude_selectors to name what to drop:

Structured extraction with json

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

Partial failures

The LLM-backed formats (summary and json) can fail on their own 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 are still charged — 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:

GET /map

Find every URL on a site before you scrape it. 3 credits.

POST /crawl

Scrape a whole site in one job. 3 credits + 3 per page.

Authorizations

X-API-Key
string
header
required

Your Prefetch API key. Obtain one from the dashboard.

Query Parameters

url
string
required

The website URL to process. https:// is prepended automatically if no protocol is provided.

Example:

"https://stripe.com"

formats
string
default:markdown

Comma-separated list of output formats. Each requested format appears as its own object on data; formats you do not request are absent, not null.

Example:

"markdown,links"

only_main_content
boolean
default:true

Strip navigation, sidebars, footers, and cookie banners before rendering markdown, html, summary, and json. links and images always come from the full document.

Keep hyperlinks in the markdown and html output. When false, link text is kept and the target is dropped.

include_images
boolean
default:true

Keep images in the markdown and html output.

include_base64_images
boolean
default:false

Keep inline data: images. Off by default because base64 payloads are large and carry no meaning as text.

include_selectors
string

Comma-separated CSS selectors to keep. Overrides main-content detection entirely.

Example:

"article,.post-body"

exclude_selectors
string

Comma-separated CSS selectors to remove before rendering.

Example:

".cookie-bar,#promo"

json_prompt
string

What to extract, in plain language. Required for the json format unless json_schema is given.

Example:

"product name, price and availability"

json_schema
string

A JSON Schema, passed as a JSON string, describing the object the json format should return.

summary_max_words
integer
default:120

Word budget for the summary format.

Required range: 20 <= x <= 400

Response

Page scraped.

success
enum<boolean>
required
Available options:
true
data
object
required

The page content fields. Which of them are present depends on the formats requested.

meta
object
required