EN
EnglishEspañolDeutschFrançaisSvenskaNederlandsLietuviųไทยPortuguêsРусский中文Українськаहिन्दीBahasa Indonesia

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.

Plans from $3 a month Sample answer (JSON)

No account to create. Failed calls are never charged.

One request

curl -H "Authorization: Bearer $API_KEY" \
  "https://glyphtools.com/pdf/text?url=https%3A%2F%2Fbitcoin.org%2Fbitcoin.pdf"

Python

import os, requests

r = requests.get(
    "https://glyphtools.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://glyphtools.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://glyphtools.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"
    }
  ]
}

Pricing

One API key, paid by card through Stripe. $0.002 per successful call with a key; failed calls cost nothing.

$3 a month1,500 PDFs each monthStart plan
$9 a month4,500 PDFs each monthStart plan
$39 a month19,500 PDFs each monthStart plan
$129 a month64,500 PDFs each monthStart plan
$349 a month174,500 PDFs each monthStart plan
$1 once500 PDFsBuy
$5 once2,500 PDFsBuy
$20 once11,000 PDFsBuy
$100 once62,500 PDFsBuy

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

NameTypeDescription
url (required)stringAbsolute public http(s) URL of the PDF. With no input at all this reads the published sample (the Bitcoin white paper); send url for your own PDF.
firstPageintegerFirst page to read (default 1)
pagesintegerHow many pages to read (1-200, default 20)
maxCharsintegerMaximum characters of text returned across all pages (1000-200000, default 50000)

What it does not do

Also on the same key

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

For AI agents

The same tool is on the MCP server https://glyphtools.com/mcp (the first 10 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.