PDF to Structured Data (Excel/JSON) with OCR
Pricing
from $2.00 / 1,000 file converteds
PDF to Structured Data (Excel/JSON) with OCR
Convert PDF invoices, forms, statements and reports into clean structured JSON (text, tables, key/values) with an OCR fallback for scanned pages.
Pricing
from $2.00 / 1,000 file converteds
Rating
0.0
(0)
Developer
Simon Fletcher
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
PDF to Structured Data turns PDF invoices, receipts, purchase orders, bank statements, forms and reports into clean, structured JSON — full text, detected tables, and key/value fields — with an OCR fallback for scanned pages. Send a URL, an uploaded file, or a base64 payload; get back agent-ready data you can push straight into Excel, a database, or an AI workflow. Built on the Apify platform, so you get an API, scheduling, and integrations (Make, Zapier, n8n) out of the box.
What does PDF to Structured Data do?
It reads each PDF you give it and emits one structured record per document:
text— the full document text, whitespace-normalized.tables— every detected table as a clean rows/cells matrix (no HTML).keyValues—Label: valuefields parsed out automatically (invoice number, dates, totals, account numbers…).pages— an optional per-page breakdown of text and tables.
Output is agent-first: compact JSON with no HTML blobs or nested junk, so it drops directly into AI agents (via the Apify MCP server), spreadsheets, or a data pipeline.
Why use PDF to Structured Data?
- Back-office automation — convert incoming invoices, receipts and POs into rows for accounting/ERP import.
- Data extraction at scale — batch hundreds of PDFs per run via the API or a schedule.
- AI/RAG ingestion — feed clean text + tables to an LLM without a bespoke parser.
- No subscription lock-in — pay only for what you convert (see Pricing), instead of a fixed monthly SaaS seat.
How to use PDF to Structured Data
- Open the Input tab.
- Provide your PDFs one of three ways:
- PDF URLs — paste public links to the files.
- Uploaded files — upload PDFs (passed as key-value-store keys).
- Base64 PDFs — inline payloads for API/agent callers.
- (Optional) toggle table extraction, key/value detection, per-page breakdown, or the OCR fallback.
- Click Start. Each converted document appears as a row in the Output dataset.
Input
| Field | Type | Description |
|---|---|---|
pdfUrls | array | Public URLs of PDFs to download and convert. |
keyValueStoreKeys | array | Keys in the run's key-value store holding uploaded PDF bytes. |
pdfBase64 | array | Base64-encoded PDF payloads (inline). |
includePages | boolean | Include the per-page pages breakdown (default true). |
extractTables | boolean | Detect and emit tables (default true). |
detectKeyValues | boolean | Parse Label: value fields (default true). |
ocrFallback | boolean | OCR scanned/image-only pages with Tesseract (default true). |
Example input:
{"pdfUrls": [{ "url": "https://example.com/invoice-1001.pdf" }],"extractTables": true,"detectKeyValues": true}
Output
Each input PDF becomes one dataset item. You can download the dataset in JSON, CSV, Excel, or HTML.
{"source": "invoice-1001.pdf","status": "ok","error": null,"pageCount": 1,"text": "INVOICE\nInvoice Number: INV-1001\nDate: 2026-03-14\nBill To: Acme Corp\nItem Qty Price\nWidget 2 10.00\nGadget 1 25.00\nTotal: 45.00","pages": [{"page": 1,"text": "INVOICE\nInvoice Number: INV-1001\n...","tables": [[["Item", "Qty", "Price"], ["Widget", "2", "10.00"], ["Gadget", "1", "25.00"]]]}],"tables": [{ "page": 1, "index": 0, "rows": [["Item", "Qty", "Price"], ["Widget", "2", "10.00"], ["Gadget", "1", "25.00"]] }],"keyValues": {"Invoice Number": "INV-1001","Date": "2026-03-14","Bill To": "Acme Corp","Total": "45.00"},"meta": { "extractor": "pdfplumber", "ocrUsed": false, "charCount": 126, "tableCount": 1 }}
Output fields
| Field | Type | Description |
|---|---|---|
source | string | The URL, key, or label of the input PDF. |
status | string | ok or error. |
error | string / null | Failure reason when status is error. |
pageCount | number | Number of pages in the PDF. |
text | string | Full normalized document text. |
pages | array | Per-page { page, text, tables } (when includePages). |
tables | array | Detected tables as { page, index, rows }. |
keyValues | object | Parsed Label: value fields. |
meta | object | extractor, ocrUsed, charCount, tableCount. |
A document that fails to parse returns a row with status: "error" and a reason — one bad file never aborts the rest of the batch.
Very large documents: Apify caps a single dataset row at ~9 MB. When a converted PDF's text + pages + tables would exceed that, the full record is written to the run's key-value store and the dataset row is trimmed: pages and tables are omitted, text is truncated, and the row carries truncated: true plus fullResultKey (the key-value-store key of the complete, untruncated record). keyValues and meta always stay complete inline.
Pricing
This Actor uses pay-per-event: you are billed per successfully converted document, so you only pay for results. High-volume users can be moved to a flat monthly rental tier — see the Actor's pricing details. On a per-document basis this is dramatically cheaper than fixed PDF-extraction SaaS subscriptions.
Tips and advanced options
- Batch for efficiency — pass many PDFs in one run to amortize startup cost.
- Turn off OCR (
ocrFallback: false) for digital (text-layer) PDFs to run faster. - Turn off
includePagesif you only need document-leveltext,tablesandkeyValues— the output gets smaller.
FAQ and support
- Does it handle scanned PDFs? Yes — pages with no text layer are OCR'd with Tesseract. Digital PDFs are extracted directly (faster, more accurate).
- What about pages rotated sideways? Handled automatically. Pages flagged as rotated 90/180/270 degrees are read via OCR on the upright-rendered image (Tesseract), so
keyValuesand text are recovered correctly instead of coming out with broken line order. The output sets"ocrUsed": truefor these pages. Correctly-oriented digital pages are extracted directly and are unaffected. - What about personal data? You supply your own documents; process only files you're authorized to. Don't submit documents containing data you may not process.
- Found a problem? Use the Issues tab on the Actor page — include a sample PDF and the output you expected.