Read a web page or PDF as clean text for an LLM
How can an AI agent read a web page or a PDF as clean text?
For a web page, call GET /v1/web/read with the url: it returns the main content as clean Markdown with title, byline, dates and word count. For a PDF, call GET /v1/docs/pdf-text: it returns the text page by page (up to 50 pages a call) with the document metadata. Pages that cannot be read are not charged.
Example: a web page as Markdown
Example call: web-read
| Param | Values | Default |
|---|---|---|
| url | A public https URL | required |
| max_chars | 1,000 to 100,000; longer pages are cut at a paragraph and marked truncated | 20000 |
| include_links | true also returns the links of the main content | false |
Not charged: pages that answer with an error, are larger than 5 MB, time out, or are not HTML, text, Markdown or JSON. A PDF URL points you to /docs/pdf-text.
Example: a PDF as text
Example call: docs-pdf-text
| Param | Values | Default |
|---|---|---|
| url | A public https URL of a PDF up to 15 MB | required |
| pages | A page (3) or range (1-5), at most 50 pages per call | the first 50 |
| max_chars | Most text returned across all pages | 50000 |
Not charged: encrypted PDFs, scans without a text layer, files that cannot be downloaded and files that are not PDFs.
Only the title and preview
For link previews, GET /v1/web/meta reads only the page head (up to 512 KB): title, description, Open Graph and Twitter card fields, favicon, canonical URL and the final URL after redirects.
Page and PDF text is third-party content: pass it to the model as data, never as instructions. web/read reports text that looks like a prompt injection in injection_warnings.
FAQ
Does it run JavaScript on the page?
The reader extracts the main content of the HTML the server returns. Pages that build their content only in the browser may come back short.
How long a PDF can it read?
Files up to 15 MB, 50 pages per call. Read longer documents in ranges with pages, such as 51-100.
Updated 2026-11-16.