PDF Table Extractor – PDF to CSV & JSON avatar

PDF Table Extractor – PDF to CSV & JSON

Pricing

from $10.00 / 1,000 pages

Go to Apify Store
PDF Table Extractor – PDF to CSV & JSON

PDF Table Extractor – PDF to CSV & JSON

Extract tables from PDF URLs to CSV and JSON in bulk. Clean multi-level headers, page numbers and source links on every table, optional OCR for scanned PDFs. Pay per page; failed PDFs are free.

Pricing

from $10.00 / 1,000 pages

Rating

0.0

(0)

Developer

Kiwi Tools

Kiwi Tools

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a month ago

Last modified

Features

Limited permissions

Share

PDF Table Extractor – PDF to CSV and JSON

Extract tables from PDFs into clean CSV and JSON: paste PDF links, click Start, and get one spreadsheet-ready file per table, with the source URL and page number on every table. Multi-level headers are flattened into readable column names, contents pages are skipped, and scanned PDFs can be read with optional OCR. You pay per processed page (US$0.01), and failed PDFs are free.

Try it in one click: the form is prefilled with a public research paper and a 4-page limit, so pressing Start extracts its first table for about US$0.04.

Powered by the open-source Docling library for layout and table-structure recognition, with optional English OCR for scanned pages.

What it's good for

  • PDF to CSV for spreadsheets: open every extracted table directly in your spreadsheet app.
  • PDF to JSON for code and pipelines: structured columns and rows, ready for databases, ETL and AI workflows.
  • Financial statements and annual reports: income statements, balance sheets and cash-flow tables.
  • Government and statistics publications: pull the data tables out of 50-page reports without copying by hand.
  • Research papers: results tables from scientific PDFs, keeping multi-level headers readable.
  • Batch jobs: up to 100 PDFs per run, with per-PDF status so one bad link never stops the batch.
  • Scanned documents: turn on OCR for pages that have no text layer (see OCR caveats below).

How it compares

This ActorCopy-paste or a basic PDF converter
Batch of PDF URLs in one runUp to 100Usually one file at a time
OutputOne CSV and one JSON file per table, plus dataset recordsOften one text dump per document
Source URL and page numbers on every tableYesRarely
Multi-level headersJoined as Parent / ChildOften lost or misaligned
Tables of contents and figure listsSkipped automaticallyOften returned as "tables"
Scanned PDFsOptional OCR, with suspicious numbers flaggedOften unsupported
Spreadsheet formula injectionNeutralised in CSV by defaultRarely handled
Failed PDFsFree, with a clear error recordVaries

How it works

  1. Each PDF is downloaded (public HTTP/HTTPS links only) and checked.
  2. Docling detects tables and their cell structure on the first maxPages pages.
  3. Tables are cleaned up:
    • Stacked headers become Parent / Child names, e.g. Three Months Ended / September 28, 2024.
    • Merged cells and section labels such as ASSETS: appear once, not repeated across every column.
    • Tables of contents and lists of figures are skipped.
  4. Each table is saved as its own CSV and JSON file, and listed in the dataset with download links.

Input

FieldTypeDefaultDescription
pdfUrlsarray of URLsrequiredDirect links to public PDFs, 1–100. Duplicates are processed once.
maxPagesinteger20Process the first N pages of each PDF (1–200). You pay per processed page.
enableOcrbooleanfalseRead scanned pages (no text layer) with English OCR.
tableModeaccurate / fastaccurateTable-structure model. fast is quicker on simple grids.
headerStylejoined / leaf / dottedjoinedMulti-level headers as Parent / Child, lowest header only, or Parent.Child.
mergedCellsfirst / repeatfirstPut a merged cell's text in its first cell only, or repeat it in every covered cell.
includeNonDataTablesbooleanfalseKeep contents pages and lists of figures (marked tableType: "contents").
safeCsvbooleantruePrefix formula-like CSV cells (=, +, -, @) with an apostrophe so spreadsheets don't execute them. JSON keeps the original text.
maxFileSizeMbinteger25Reject larger downloads (1–100 MiB).
documentTimeoutSecondsinteger180Stop converting a PDF that takes longer than this (30–1800).
{
"pdfUrls": ["https://example.org/annual-report.pdf", "https://example.org/statistics.pdf"],
"maxPages": 20,
"enableOcr": false,
"headerStyle": "joined"
}

Output

Dataset: one table record per extracted table and one document record per PDF. The Console's "Tables and document results" view shows the key fields with CSV/JSON links.

Table record (shortened):

{
"recordType": "table",
"sourceUrl": "https://example.org/annual-report.pdf",
"tableIndex": 1,
"pages": [1],
"columns": ["", "Three Months Ended / September 28, 2024", "Three Months Ended / September 30, 2023"],
"rows": [["Net sales:", "", ""], ["Products", "$ 69,958", "$ 67,184"]],
"rowCount": 38,
"columnCount": 5,
"headerRowCount": 2,
"sectionRows": [0],
"tableType": "data",
"ocrUsed": false,
"caption": "Table 1: …",
"csvUrl": "https://api.apify.com/v2/key-value-stores/…/records/doc-001-…-table-001.csv?signature=…",
"jsonUrl": "https://api.apify.com/v2/key-value-stores/…/records/doc-001-…-table-001.json?signature=…"
}

Document record (shortened):

{
"recordType": "document",
"sourceUrl": "https://example.org/annual-report.pdf",
"status": "success",
"totalPages": 61,
"convertedPages": 20,
"tableCount": 4,
"ocrPages": [],
"nonDataTablesSkipped": [{"pages": [5], "reason": "dot leaders"}],
"billing": {"events": {"page": 20, "ocr-page": 0}},
"warnings": ["Only the first 20 pages were requested."]
}

status is one of:

  • success
  • partial: Docling converted only some pages.
  • error: with errorType and error, e.g. HTTP 404, not a PDF, encrypted, corrupt, too large, or timed out.
  • skipped: your maximum charge was reached.

Key-value store: …-table-NNN.csv (UTF-8 with BOM, opens directly in Excel) and …-table-NNN.json for every table, plus a SUMMARY record with totals and any skipped URLs.

Use it from your code, an AI agent or a no-code tool

Replace <YOUR_API_TOKEN> with your token from Apify Console → Settings → API & Integrations.

HTTP API (one call, waits for the results):

curl -X POST "https://api.apify.com/v2/acts/kiwitools~pdf-tables-to-csv-json/run-sync-get-dataset-items" \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"pdfUrls": ["https://example.org/report.pdf"], "maxPages": 5}'

Python (pip install apify-client):

from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("kiwitools/pdf-tables-to-csv-json").call(
run_input={"pdfUrls": ["https://example.org/report.pdf"], "maxPages": 5}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
if item["recordType"] == "table":
print(item["pages"], item["columns"], item["csvUrl"])

JavaScript / Node.js (npm install apify-client):

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('kiwitools/pdf-tables-to-csv-json').call({
pdfUrls: ['https://example.org/report.pdf'],
maxPages: 5,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.filter((i) => i.recordType === 'table').forEach((t) => console.log(t.pages, t.jsonUrl));

No-code and AI tools: run it from Make, Zapier or n8n with Apify's official integrations (Make, Zapier, n8n), give it to an AI agent through the Apify MCP server, or process new reports on a timetable with schedules and webhooks.

Pricing

Pay per event: you pay only for pages of PDFs that convert successfully.

EventPriceWhen it's charged
Page processed (page)$0.01Each page converted and searched for tables, including pages where no table was found.
OCR page processed (ocr-page)$0.025Each scanned page (no text layer) read with OCR when enableOcr is on. Charged instead of a normal page, never both.
  • Failed, skipped and errored PDFs are free. Only the first maxPages pages are processed.
  • Digital pages are always charged as normal pages, even with OCR enabled.
  • Example: a batch of 10 reports × 20 pages costs $2.00. Five 2-page scans with OCR cost $0.25.
  • Set Maximum cost per run in the run options. The Actor checks each PDF's page count before converting it. If processing it would go over your limit, it stops cleanly and lists the remaining URLs as skipped in the dataset and in SUMMARY.skippedUrls.

OCR caveats (read before using scans)

  • OCR reads pixels, not text. It can silently misread numbers: dropped decimal points (1.47 → 147), missing or wrong thousands separators (294,866 → 294866, 14,695 → 14.695), and stray characters (14,874 um).
  • In testing on a clean 200 dpi scan of financial statements, table structure was recovered exactly, but about 7% of cells differed from the digital original.
  • Tables read with OCR have ocrUsed: true and a suspiciousValues list flagging values that look misread, with row, column and reason. In the same test it flagged 12 of the 13 numeric errors. It is a prompt to check, not a guarantee: values it doesn't flag can still be wrong.
  • Verify important figures against the PDF, especially for scans, low-resolution images, handwriting, or non-English text. Only English OCR is included.
  • Digital PDFs don't need OCR. Leave it off for faster, cheaper and more accurate results.

Limits and accuracy

  • Table detection is machine learning, not magic. It can miss borderless tables, split or merge cells, or misread complex layouts. "No tables found" doesn't prove a PDF has no tables.
  • Tables that continue across pages are returned as separate tables, one per page.
  • Header rows are detected automatically. Occasionally the first data row is treated as part of the header.
  • Contents-page detection is heuristic. Turn on includeNonDataTables if a real table goes missing.
  • Up to 100 PDFs, 200 pages per PDF and 100 MiB per file per run. Password-protected PDFs, login-only links, private-network addresses and non-standard ports are not supported.
  • The default memory is 4 GB. Most PDFs peak at 1–2.2 GB. Choose 8 GB for roughly 1.7× faster processing.

FAQ

How much does it cost? US$0.01 per processed page and US$0.025 per scanned page read with OCR (charged instead of a normal page, never both). Failed and skipped PDFs are free. A 10-page report costs US$0.10. Use maxPages and Maximum cost per run to cap spending.

Can I convert a PDF to CSV or Excel? Yes. Every table is saved as its own UTF-8 CSV file (with BOM, so Excel opens it directly) and linked from the dataset.

Can I convert a PDF table to JSON? Yes. Every table is also saved as a JSON file and as a dataset record with columns, rows, page numbers and the source URL.

Does it work on scanned PDFs? Yes, with OCR switched on (English only). OCR can misread numbers, so check important figures; suspicious values are flagged in suspiciousValues.

Can I upload a PDF file instead of a URL? The Actor reads public http(s) links. Host the file anywhere that gives it a direct public download link, and paste that link.

Why does a PDF return no tables? Borderless or unusual tables can be missed, and contents pages are skipped on purpose. If you switched to tableMode: "fast", go back to accurate; also try a higher maxPages, or switch on includeNonDataTables.

Does it handle password-protected PDFs? No. Encrypted, login-only and private-network PDFs return a free error record.

Something went wrong. How do I get help? Open an issue on the Issues tab of this Actor with the run ID and the PDF link.

Your responsibility

Only submit PDFs that you have the right to download and process, and respect any copyright, licence or confidentiality terms that apply to them. Results and downloaded files are stored in your Apify account storage and follow your account's retention settings.

Attribution and licences

This Actor is an independent product. It is powered by the open-source Docling library (MIT licence) and is not affiliated with, endorsed by or sponsored by IBM or the Docling project. It also uses:

  • Docling's layout model (Apache-2.0) and TableFormer model weights (CDLA-Permissive-2.0)
  • PyTorch (BSD-style licence)
  • Tesseract OCR (Apache-2.0)
  • the Apify SDK (Apache-2.0)

Licence texts and notices ship with the Actor image (THIRD_PARTY_NOTICES.md and the licenses/ folder).