PDF to text API
Send a PDF as a URL or as a file, get its text back as JSON, page by page. One 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
- A public URL or the file itself, up to 10 MB; arXiv abstract links work as they are
- Uploaded files are read in memory for the one request and not stored
- A file that cannot be read (scanned, encrypted, not a PDF) is never charged
A free key makes 100 calls a month: leave an e-mail address, open the link, paste the key. Failed calls are never charged.
One request
curl -H "Authorization: Bearer $API_KEY" \
"https://glyphcall.com/pdf/text?url=https%3A%2F%2Fbitcoin.org%2Fbitcoin.pdf"
Python
import os, requests
r = requests.get(
"https://glyphcall.com/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://glyphcall.com/pdf/text?${params}`, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!r.ok) throw new Error(await r.text());
console.log(await r.json());
Send a file instead of a URL
curl -H "Authorization: Bearer $API_KEY" \
-F "file=@report.pdf" -F "pages=5" \
"https://glyphcall.com/pdf/text"
Or the raw file as the body: --data-binary @report.pdf -H "Content-Type: application/pdf". Up to 10 MB. The file is read in memory for this one request and not stored.
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"
}
]
}
Or try it on a PDF that is on the web:
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).
- No password-protected or encrypted files, and no pages behind a login.
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?
Yes. POST the file as application/pdf, as a multipart form field named file, or as base64 in JSON, up to 10 MB. firstPage, pages and maxChars go in the query string or as form fields.
What happens to a file I upload?
It is read in memory to answer that one request and then dropped. It is not written to any store or cache and is never fetched again.
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://glyphcall.com/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.