PDF to text API
Send the URL of a PDF, get its text back as JSON, page by page. One GET request, no SDK.
- Text per page, with the title, author and page count
- Read only the pages you need: a first page and a page count, up to 200 pages a call
- Files up to 10 MB; arXiv abstract links work as they are
- A file that cannot be read (scanned, encrypted, not a PDF) is never charged
No account to create. Failed calls are never charged.
One request
curl -H "Authorization: Bearer $API_KEY" \
"https://agent-data-tools.revmesh2074.workers.dev/pdf/text?url=https%3A%2F%2Fbitcoin.org%2Fbitcoin.pdf"
Python
import os, requests
r = requests.get(
"https://agent-data-tools.revmesh2074.workers.dev/pdf/text",
params={
"url": "https://bitcoin.org/bitcoin.pdf",
},
headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
timeout=60,
)
r.raise_for_status()
print(r.json())
Node.js
const params = new URLSearchParams({
url: "https://bitcoin.org/bitcoin.pdf",
});
const r = await fetch(`https://agent-data-tools.revmesh2074.workers.dev/pdf/text?${params}`, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!r.ok) throw new Error(await r.text());
console.log(await r.json());
The answer
{
"url": "https://bitcoin.org/bitcoin.pdf",
"title": null,
"author": null,
"totalPages": 9,
"firstPage": 1,
"pagesRead": 1,
"chars": 46,
"truncated": true,
"pages": [
{
"page": 1,
"chars": 46,
"text": "Bitcoin: A Peer-to-Peer Electronic Cash System"
}
]
}
Pricing
One API key, paid by card through Stripe. $0.002 per successful call with a key; failed calls cost nothing.
A plan adds its credits each month when the payment succeeds; unused credits stay, and you can cancel at any time. Packs never expire. After paying you get your key on the next page. The same key works on every tool in the catalog. Details: credits and plans.
Inputs
| Name | Type | Description |
|---|---|---|
url (required) | string | Absolute public http(s) URL of the PDF |
firstPage | integer | First page to read (default 1) |
pages | integer | How many pages to read (1-200, default 20) |
maxChars | integer | Maximum characters of text returned across all pages (1000-200000, default 50000) |
What it does not do
- No OCR: it reads the text layer, so a scanned PDF without one returns little or nothing (and is not charged).
- Public URLs only: no uploads, logins or password-protected files.
Also on the same key
- Scrape website page to Markdown: page URL into clean Markdown or text for LLMs · $0.002 a call
- arXiv search: preprints by topic, or one paper by ID · $0.01 a call
Questions
Does it OCR scanned PDFs?
No. It extracts the text layer. A scanned file without one fails and is not charged.
How large can the PDF be?
Up to 10 MB, and up to 200 pages in one call. Ask for a first page and a page count to read a long report in parts.
Can I send a file instead of a URL?
No. The PDF has to be at a public http or https URL.
What happens when the site blocks the download?
The Internet Archive's dated copy is read when there is one, and the answer says so. If nothing can be read, the call is not charged.
Is there a subscription?
There is a monthly plan and there are one-off credit packs. Both give one API key; a plan adds credits each month and unused credits stay.
Guides
- PDF to text API in Python
- PDF to text API in Node.js
- PDF to text API
- Extract text from a PDF URL
- PDF parser API for LLMs and RAG
- arXiv paper to text API
For AI agents
The same tool is on the MCP server https://agent-data-tools.revmesh2074.workers.dev/mcp (the first 25 successful calls are free), and an agent with a wallet can pay per call in USDC: the tool URL answers 402 Payment Required with x402 and MPP terms. Reference: tool page · OpenAPI · docs for agents.