readfetch_pdf
Extract text from a PDF (%PDF- magic, not Content-Type). Send exactly one of url (public http(s) link — egress GET, ≤ 20 MB) or content_base64 (bytes you already have, ≤ 20 MB decoded; optional filename labels the upload). Returns pages (per-page text), one concatenated markdown body, title, and metadata; $0.005 per document, not per page. max_pages limits extraction (default 50, max 200); documents over 200 pages or above your cap return 413 and are not billed. Scanned/image-only PDFs may return empty text with billed: false and a hint. Prefer readfetch_text or readfetch_scrape for HTML articles; readfetch_fetch for raw PDF bytes without extraction; readfetch_batch for many HTML URLs, not PDFs. Read-only server-side; paid x402 like other routes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public PDF URL; fetched through egress (≤ 20 MB). Mutually exclusive with content_base64. | |
| filename | No | Optional label when using content_base64 (default upload.pdf); ignored for url-only requests. | |
| max_pages | No | Extract at most this many pages. Default 50; raise up to 200 when the document is longer. Over cap → 413, unbilled. | |
| content_base64 | No | Base64-encoded PDF bytes (≤ 20 MB). Mutually exclusive with url; pair with filename when the label matters. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | ||
| pages | No | ||
| title | No | ||
| billed | No | ||
| source | No | ||
| status | No | ||
| markdown | No | ||
| metadata | No | ||
| page_count | No | ||
| content_sha256 | No |