Skip to main content
These fields decide which parts of a page end up in the Markdown and HTML: the main content, the parts you select, or only the passages that match a query. They also decide how links are written and how much text comes back in one call.

Make a request

Get an API key in the Quickstart. This request keeps the main element of a docs page, drops its code blocks, writes links as numbered references, and returns the first 600 characters.

Read the response

The Markdown holds the selected part only. Links are written as ⟨1⟩ and listed once at the end. The text was cut at 600 characters, so nextOffset says where the next part starts, and warning says the text was cut. This real response is cut to the fields that matter.
To read on, send the same request with "offset": 529 and the same maxChars. Repeat until the answer has no nextOffset.

Options

All selector lists need at least one selector. A selector is plain CSS.

Which outputs change

The filters shape the page text that markdown and html are made from, and everything built from the Markdown: summary, highlights, question and json. rawHtml is the page as sent.

Limits and errors

  • If includeTags matches nothing on the page, the call fails with 503 sourceUnavailable and the message The page did not finish loading. Try again shortly. Nothing is charged. Check the selector against the page’s HTML before you retry.
  • maxChars below 500 returns 400 invalidRequest.
  • Send query or offset, not both.
  • onlyCleanContent is skipped with a warning when the page is too long to clean or the model does not answer.

Price

$1 per 1,000 pages. Every field on this page adds nothing, and query adds nothing either. A PDF read with maxChars, offset or query is charged for the share of its pages that comes back. See PDFs and documents.
  • Markdown is the format these fields shape.
  • Highlights returns the passages that match a query as a format of its own.
  • Links lists the URLs linkStyle hides.
  • Scrape overview lists every format and option.