PDF to text API

Send the URL of a PDF, get its text back as JSON, page by page. One GET request, no SDK.

Try it free on your PDF (first 2 pages) Plans from $9 a month Sample answer (JSON)

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"
    }
  ]
}

Try it free on your PDF (first 2 pages)

Absolute public http(s) URL of the PDF

Uses one of your 3 free calls. Nothing is charged, and a call that fails is not counted.

Pricing

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

$9 a month7,500 PDFs each monthStart plan
$19 a month20,000 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
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?

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

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.