PDF Extract API

Upload a PDF, get back structured JSON. $0.02 per request.

What it does

Send a PDF. Get structured JSON back — either matching a schema you supply, or a sensible best-effort default (document type, summary, key fields, tables).

Endpoint

MethodPOST
Path/extract
Content-Typemultipart/form-data

Fields

fieldrequireddescription
fileyesThe PDF file, max 10MB
schemanoJSON Schema object, or a JSON array of field names, as a string

Example

curl -X POST https://pdf-extract-api.pdfextractapi.workers.dev/extract \
  -F "file=@invoice.pdf" \
  -F 'schema=["invoice_number","date","total","vendor_name"]'

Example response

{
  "data": {
    "invoice_number": "INV-2041",
    "date": "2026-08-01",
    "total": "£412.00",
    "vendor_name": "Acme Supplies Ltd"
  },
  "meta": { "pages": 1, "truncated": false }
}

Errors

Errors return a non-200 status with { "error": { "code": "...", "message": "..." } }. Common codes: missing_file, file_too_large, invalid_file, corrupted_file, password_protected, no_text_layer (scanned PDFs aren't supported yet), invalid_schema.

Payment

This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.

Try it in your browser

Upload a PDF below and submit — you'll be prompted to connect a wallet and pay $0.02, then see the result.