The extraction API.
One POST, a PDF in, structured data back — text, JSON, Markdown or CSV, plus bank-statement extraction with a reconciliation check. Batch-ready.
Authentication
Every request needs your API key as a bearer token. Get one — and 100 free pages to test on — from your account. The base URL is https://api.pdftojson.dev, and metering is per page processed (see pricing).
# all requests Authorization: Bearer $KEY
Extract — POST /v1/extract
Send a PDF as multipart form data and choose an output format. Digital PDFs are read directly; scanned PDFs are run through OCR automatically.
| Field | Values | |
|---|---|---|
file | a PDF | required — multipart file |
format | json · markdown · text · csv | output format |
pages | all or a range like 1-5 | optional, defaults to all |
curl -X POST https://api.pdftojson.dev/v1/extract \ -H "Authorization: Bearer $KEY" \ -F file=@document.pdf -F format=markdown
import requests
r = requests.post(
"https://api.pdftojson.dev/v1/extract",
headers={"Authorization": f"Bearer {KEY}"},
files={"file": open("document.pdf", "rb")},
data={"format": "markdown"},
)
print(r.json()["content"]) const form = new FormData(); form.append("file", fs.createReadStream("document.pdf")); form.append("format", "markdown"); const res = await fetch("https://api.pdftojson.dev/v1/extract", { method: "POST", headers: { Authorization: `Bearer ${KEY}` }, body: form, }).then((r) => r.json());
Response
{
"format": "markdown",
"pages": 3,
"content": "# Quarterly Report\n\n## Summary\n...",
"scanned": false
} Bank statements — POST /v1/bank-statement
The premium endpoint. It extracts every transaction into a structured schema, then runs a reconciliation check: the transactions must account for the change from the opening to the closing balance. If they don't, reconciled comes back false — so you catch a dropped or misread row before it reaches your books.
| Field | Values | |
|---|---|---|
file | a statement PDF | required — multipart file |
output | json · csv | defaults to json |
curl -X POST https://api.pdftojson.dev/v1/bank-statement \ -H "Authorization: Bearer $KEY" \ -F file=@statement.pdf -F output=json
Response
{
"account": { "bank": "...", "number_masked": "****1234", "period": "2026-07" },
"currency": "USD",
"transactions": [
{ "date": "2026-07-03", "description": "...", "amount": -42.10, "balance": 1875.00 }
],
"totals": { "credits": 3200.00, "debits": -1810.55, "net": 1389.45 },
"reconciled": true,
"pages": 4
} Errors
| Code | Meaning |
|---|---|
401 | Missing or invalid API key |
402 | Over your monthly page quota — upgrade |
413 | File too large for a synchronous request |
422 | PDF is unreadable or encrypted |
Requests are synchronous in v1 (up to ~20 pages). Need more? Get a key and start with 100 free pages.