Skip to main content

Fetch a Single Page

Extract content from any URL as clean Markdown:
Output:

Batch Fetch

Fetch up to 10 URLs in a single request. Failed URLs appear in errors[] without affecting the rest:

Fetch with Intent

Pass the optional purpose parameter to state why you are fetching — the goal or task the content will be used for. It is always optional, but supplying it gives the fetch additional intent signal beyond the raw URLs, helping deliver better-quality results.

Control Cache Freshness

Use ttl when you need to bound how old a cached page can be. Set ttl to 0 when you want a live fetch, or to a positive number of seconds to accept cached entries younger than that window.

Detect Page Changes with Conditional Requests

Save a page’s etag, then replay it on your next fetch to skip re-processing content that hasn’t changed. Conditional requests are a stateless pass-through — Fetch doesn’t store the validators for you. 1. Bootstrap: fetch once and save the etag
Output:
Save etag (or last_modified) somewhere durable, keyed by URL. 2. Later: replay the etag to check for changes
The origin confirms nothing changed — skip re-processing:

Scope Extraction to Part of the Page

Use include_selectors to extract only the elements you care about, and exclude_selectors to strip noise (removed before include_selectors is applied). Selected content is returned verbatim in the requested format — automatic boilerplate removal is bypassed — while page-level metadata (title, description, etc.) still comes from the full document.
Output:
Here article matched but aside.related didn’t — a partial miss. The URL still succeeds with the matched content, and the entries that matched nothing are listed in the result’s unmatched_selectors (omitted when everything matched).
If no include_selectors entry matches anything on a page, that URL fails with the per-URL error code selector_not_matched in errors[] — there is no silent full-page fallback. The error carries unmatched_selectors (what missed) and candidate_selectors (up to 10 landmark tags and #id selectors found on the page), so agents can retry with include_selectors drawn from candidate_selectors. exclude_selectors entries that match nothing are simply a no-op.

Extract Ranked Passages with Highlights

Add a highlights object with a question to pull the passages that best answer it from each page — ranked, and quoted word-for-word from the page. Passages are extracted, never generated, so they’re citable evidence with zero fabrication risk. Highlights is in beta, enabled per-account — requests from an account that isn’t enabled return 403 FORBIDDEN.
Output:
text is null because a highlights request returns just the passages by default — set highlights.include_full_page_text: true to also receive the full page markdown.
An empty highlights array means the page was fetched and analyzed and does not answer the query — a calibrated “nothing here”, not a failure. The API may also return passages that are related to the query without directly answering it, so treat highlights as candidate evidence to extract from: if the asked-for fact isn’t in the passages, the correct conclusion is “not on this page.”
Get all hyperlinks and image URLs from a page:

Fetch as HTML

Get semantic HTML instead of Markdown — useful for preserving structure:

Fetch Reference

Full parameter, response, and content type docs

Search Examples

Web search with geo-targeting