PDF Table, Invoice & Statement Extractor (XLSX/CSV + MCP) avatar

PDF Table, Invoice & Statement Extractor (XLSX/CSV + MCP)

Pricing

from $4.20 / 1,000 pdfs analyzed for tables/invoices

Go to Apify Store
PDF Table, Invoice & Statement Extractor (XLSX/CSV + MCP)

PDF Table, Invoice & Statement Extractor (XLSX/CSV + MCP)

Extract geometric multi-page PDF tables to JSON, Markdown, CSV, and formula-safe XLSX plus deterministic invoice and bank statement fields with arithmetic reconciliation and Standby MCP.

Pricing

from $4.20 / 1,000 pdfs analyzed for tables/invoices

Rating

0.0

(0)

Developer

James Edmans

James Edmans

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

15 hours ago

Last modified

Categories

Features

Limited permissionsSingle-tenantServer interface

Share

PDF Structured Table & Invoice/Statement Extractor (JSON, CSV, XLSX + MCP)

Apify Store Actor: forgekit/pdf-table-invoice-extractor | Runtime: Node.js 22 (pdfjs-dist + xlsx + csv-stringify) | Billing: Pay-Per-Event (PPE) + Standby MCP Server

Overview

PDF Structured Table & Invoice/Statement Extractor converts digital PDF tables, invoices, receipts, and bank statements into structured JSON records, Markdown tables, formula-safe .csv files, and multi-sheet .xlsx workbooks — completely deterministically at zero LLM token cost and zero external third-party OCR dependency.

Using geometric X/Y text coordinate projection via pdfjs-dist, it accurately aligns sparse/empty cells, stitches wrapped multi-line descriptions, merges tables spanning consecutive pages, parses US ($1,234.56) and EU (€1.250,00) currencies, and runs automated mathematical reconciliation (sum(lineItems) === subtotal, subtotal + tax === total, and bank statement running balances) so finance and automation workflows immediately distinguish 100%-balanced invoices from exceptions.

Feature Comparison vs. Top Competitors

  • Zero-Charge on Unreadable & HTML-Viewer Failures: Verifies %PDF- magic bytes before parsing; HTML login walls return explicit status: "error" with errorCode: "HTML_INSTEAD_OF_PDF" and zero pdf-analyzed or page-parsed billing — never returning silent 0-row "Succeeded" runs.
  • Automatic Cloud Link Normalization (normalizeCloudPdfUrl): Converts public Google Drive (/file/d/<ID>/view), Dropbox (dl=0 -> dl=1), and OneDrive share links into direct binary PDF downloads automatically.
  • Geometric Multi-Page Table Stitching (mergeContinuedTables): Clusters X/Y text coordinates into column projections, preserves empty cells, stitches wrapped lines, and seamlessly merges continued multi-page tables without duplicating headers.
  • Deterministic Invoice & Bank Statement Reconciliation: Extracts vendor, invoice number, PO number, issue/due dates, VAT ID, IBAN, currency, subtotal, tax rate/amount, total, and line items, then checks arithmetic balance within ±0.02 (reconciliation.passed, discrepancy, confidenceScore).
  • Formula-Safe Excel (.xlsx) & CSV Export: Neutralizes spreadsheet formula injection (=, +, -, @) before writing multi-tab .xlsx workbooks (1 sheet per table) and .csv files to Apify Key-Value Store.
  • Native Standby MCP Server: Exposes extract_pdf_tables and extract_invoice_fields for finance AI agents.
CapabilityPDF Table & Invoice Extractor (Ours)lergassy/pdf-text-extractoractorzlab/docling-pdf-converterformnexa/invoice-receipt-data-extractor
Geometric Multi-Page Table StitchingYes (X-projection + header dedupe)Basic heuristicsPartial (4 GB RAM, 90.2% success)No arbitrary multi-page tables
Invoice + Bank Statement SchemaYes (US & EU formats, IBAN, VAT)NoNoInvoices only (no bank statements)
Arithmetic Balance ReconciliationYes (reconciliation.passed + discrepancy)NoNoNo
Formula-Safe XLSX & CSV ExportYes (multi-sheet .xlsx + .csv)NoNoNo
Cloud Share Rewriter + %PDF- GuardYes (Drive/Dropbox/OneDrive)NoNoNo
Standby MCP ServerNative (/mcp — 2 tools)NoNoNo
Pricing (FREE Tier)$0.002 start + $0.006/pdf + $0.002/page$0.003/doc + $0.0001/page$0.005/page + $0.002/table$0.01/item

Input Configuration

FieldTypeRequiredDefaultDescription
urlsstring[]No*[]Public PDF URLs (SSRF-protected, up to 200).
normalizeCloudPdfUrlbooleanNotrueAuto-convert public Google Drive, Dropbox, and OneDrive share links to direct PDF downloads.
base64Pdfsobject[]No*[]Inline PDFs [{ "filename": "invoice.pdf", "dataBase64": "..." }] (up to 50).
kvsKeysstring[]No*[]Binary PDF keys in Apify Key-Value Store (up to 200).
sourceKeyValueStoreIdstringNo""Optional external Apify KVS ID for kvsKeys.
inputDatasetIdstringNo*""Upstream Apify Dataset ID to pull PDF URLs from.
datasetUrlFieldstringNo"url"URL field inside inputDatasetId.
modestringNo"both""tables-only", "invoice-statement", or "both".
pageRangestringNo""Optional 1-indexed page subset e.g. "1-10".
maxPagesintegerNo100Maximum pages parsed per PDF (1–1000).
passwordstringNo""Optional secret password for encrypted PDFs (isSecret: true).
rowTolerancePtnumberNo3.5Vertical Y-clustering tolerance in PDF points (1–20).
columnGapThresholdPtnumberNo12Minimum horizontal gap in points separating adjacent columns (3–100).
minTableRowsintegerNo2Minimum rows required to emit a table (2–50).
minTableColumnsintegerNo2Minimum columns required to emit a table (2–30).
mergeContinuedTablesbooleanNotrueMerge tables continuing across consecutive pages with matching column geometry.
exportTablesToXlsxbooleanNotrueWrite formula-safe multi-sheet .xlsx workbook to KV store.
exportTablesToCsvbooleanNofalseWrite each table as a formula-safe .csv file to KV store.
maxConcurrencyintegerNo4Concurrent PDF workers (1–15).
maxPdfSizeMbnumberNo30Maximum PDF download/base64 size in MB (1–150).
timeoutSecsintegerNo30Per-PDF timeout in seconds (5–180).

*At least one input source (urls, base64Pdfs, kvsKeys, or inputDatasetId) is required.

Output Example

Below is an exact real output record captured from running this Actor locally:

{
"source": "invoice-2026-0042.pdf",
"filename": "invoice-2026-0042.pdf",
"status": "ok",
"pageCount": 1,
"pagesParsed": 1,
"tablesCount": 1,
"tables": [
{
"tableIndex": 0,
"pages": [1],
"headers": ["Description", "Qty", "Unit Price", "Amount"],
"rows": [
["Cloud Hosting", "2", "$150.00", "$300.00"],
["Support Plan", "1", "$200.00", "$200.00"]
],
"records": [
{ "Description": "Cloud Hosting", "Qty": "2", "Unit Price": "$150.00", "Amount": "$300.00" },
{ "Description": "Support Plan", "Qty": "1", "Unit Price": "$200.00", "Amount": "$200.00" }
],
"markdown": "| Description | Qty | Unit Price | Amount |\n| --- | --- | --- | --- |\n| Cloud Hosting | 2 | $150.00 | $300.00 |\n| Support Plan | 1 | $200.00 | $200.00 |"
}
],
"invoiceData": {
"documentType": "invoice",
"invoiceNumber": "INV-2026-0042",
"poNumber": null,
"issueDate": "2026-11-15",
"dueDate": "2026-12-15",
"currency": "USD",
"vendorName": "Acme Cloud Ltd",
"vendorVatId": "GB123456789",
"iban": "DE89370400440532013000",
"subtotal": 500,
"taxRate": 20,
"taxAmount": 100,
"totalAmount": 600,
"lineItems": [
{ "description": "Cloud Hosting", "quantity": 2, "unitPrice": 150, "lineTotal": 300 },
{ "description": "Support Plan", "quantity": 1, "unitPrice": 200, "lineTotal": 200 }
],
"transactions": [],
"reconciliation": {
"lineItemsSum": 500,
"expectedTotal": 600,
"passed": true,
"discrepancy": 0,
"checks": [
"lineItemsSum (500) == subtotal (500)",
"expectedTotal (600) == totalAmount (600)"
]
},
"confidenceScore": 1
},
"exportedXlsxKey": "tables-invoice-2026-0042-0.xlsx",
"exportedCsvKeys": [],
"errorCode": null,
"error": null
}

Pay-Per-Event (PPE) Pricing

Event KeyEvent TitlePrice (USD)Billing Trigger
actor-startActor run start$0.002Charged once per batch run that analyzes at least one valid PDF.
pdf-analyzedPDF analyzed for tables/invoices$0.006Charged per valid PDF successfully parsed (never billed on HTML pages or corrupt files).
page-parsedPDF page parsed for tables$0.002Charged per page parsed from a valid PDF.
mcp-tool-callStandby MCP tool execution$0.005Charged per successful Standby MCP tool call.

Illustrative Cost Example: Extracting tables & invoices from 100 two-page PDFs (200 pages) costs $0.002 + (100 * $0.006) + (200 * $0.002) = $1.002 USD.

Standby MCP Server & AI Agent Integration

Connect forgekit/pdf-table-invoice-extractor in Apify Standby Mode (APIFY_META_ORIGIN=STANDBY) to expose two structured finance tools over Streamable HTTP / SSE:

  • Health endpoint: GET /health
  • MCP endpoint: POST /mcp and GET /mcp
  • Exposed MCP tools: extract_pdf_tables, extract_invoice_fields
{
"mcpServers": {
"pdf-table-invoice-extractor": {
"url": "https://forgekit--pdf-table-invoice-extractor.apify.actor/mcp",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}

Error Handling, Rate Limits & Limitations

  • SSRF & Payload Hardening: Only public http:/https: URLs are allowed (loopback, RFC1918, and cloud metadata IPs are blocked before connect and across redirects). Download size is capped by maxPdfSizeMb.
  • Zero-Charge Partial Resilience: Corrupt PDFs, 404 URLs, and HTML viewer pages emit status: "error" with explicit errorCode (HTML_INSTEAD_OF_PDF, INVALID_PDF_HEADER, HTTP_ERROR, SSRF_BLOCKED) and zero pdf-analyzed / page-parsed charges.
  • Scope: Designed for digital text-layer PDFs (invoices, accounting exports, bank statements, reports). For image-only scanned PDFs, run our Bulk Image & Scanned-PDF OCR Engine first.

Quick Start & Example Input

1. Run in Apify Console (No Code)

  1. Open forgekit/pdf-table-invoice-extractor in Apify Console and click Try for free.
  2. Paste or adjust the ready-to-run input JSON below (safe defaults are pre-filled).
  3. Click Start and export results as JSON, CSV, Excel, or NDJSON from the Output tab.
{
"mode": "both"
}

2. Run via API (apify-client — Node.js & Python)

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('forgekit/pdf-table-invoice-extractor').call({"mode":"both"});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
from apify_client import ApifyClient
import os
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("forgekit/pdf-table-invoice-extractor").call(run_input={"mode":"both"})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(items)

3. Connect to n8n, Make, Zapier & Webhooks

  • n8n / Make / Zapier: Add the official Apify module, choose Run Actor, select forgekit/pdf-table-invoice-extractor, and pass the JSON payload above.
  • Schedules & Webhooks: Attach an Apify Schedule for recurring runs and trigger downstream webhooks automatically on ACTOR.RUN.SUCCEEDED.

Use Cases — What Can You Do With This Data?

  • Document & Invoice Ingestion Pipelines: Automate PDF, OCR, table, or media extraction with PDF Structured Table & Invoice/Statement Extractor (JSON, CSV, XLSX + MCP) to feed accounting systems, ERPs, legal archives, and AI knowledge bases.
  • E-Commerce & Content Operations: Process product images, generate pixel-perfect PDFs/screenshots, transcode media, or create/decode barcodes at scale via API without managing local FFmpeg or Chromium servers.
  • AI Vision & Multimodal Agent Workflows: Convert raw PDFs, videos, podcasts, or webpages into clean Markdown, keyframes, transcripts, or optimized thumbnails ready for multimodal LLMs.
  • Automated QA & Visual Monitoring: Schedule recurring captures or document checks and export structured metadata + KV Store artifacts directly into Slack, S3, Make, or n8n.

Frequently Asked Questions (FAQ)

How much does PDF Structured Table & Invoice/Statement Extractor (JSON, CSV, XLSX + MCP) cost to run?

You only pay for actual output via transparent Pay-Per-Event billing (starting at $0.006 per pdf-analyzed (PDF analyzed for tables/invoices); see the PPE Pricing table above). Runs that produce zero billable results or fail upstream incur $0.00 — including zero actor-start fee — and Apify's built-in Max total charge (ACTOR_MAX_TOTAL_CHARGE_USD) hard-caps spend automatically.

Does this Actor require proxies, logins, or CAPTCHA solving?

No. This Actor executes deterministic document/media processing locally inside the Apify container (Node.js 22, Sharp, PDF engines, FFmpeg, or Chromium where required) on files and URLs you supply, with strict SSRF protection blocking private/metadata IP ranges.

What export formats and integrations are supported?

Every run stores structured results in an Apify Dataset downloadable as JSON, CSV, Excel (XLSX), NDJSON, XML, or HTML Table via Console or REST API, plus native connectors for n8n, Make, Zapier, Google Sheets, Airtable, Slack, and webhooks.

Can AI agents (Claude Desktop, Cursor, ChatGPT, LangChain) call this Actor directly via MCP?

Yes! PDF Structured Table & Invoice/Statement Extractor (JSON, CSV, XLSX + MCP) includes a built-in Standby MCP Server at https://forgekit--pdf-table-invoice-extractor.apify.actor/mcp supporting JSON-RPC 2.0 (initialize, ping, tools/list, tools/call) with Claude-compliant ^[a-zA-Z0-9_.-]{1,64}$ tool schemas.

Do I need to provide an API key (password)?

All sensitive key fields (password) are optional BYOK upgrades marked isSecret: true — they are encrypted at rest by Apify and never echoed into datasets, KV summaries, or logs.

How fast and lightweight is it compared to browser scrapers?

It runs on lightweight Node.js 22 (256–512 MB RAM, zero headless browser) so typical runs finish in seconds with high reliability and low platform compute cost.

Explore companion Actors in Media, Document & PDF Processing and core ETL utilities to chain end-to-end pipelines:

ActorStore SlugMode
PDF-to-Markdown, Clean Text & Metadata Extractor (LLM & RAG Ready + MCP)forgekit/pdf-to-markdown-text-extractor✅ Standby MCP
PDF Toolkit: Bulk Merge, Split, Compress, Watermark, Rotate & Form Readerforgekit/pdf-toolkit-merge-split-watermarkBatch REST API
Bulk Image & Scanned-PDF OCR Engine (Multi-Language + Word Bounding Boxes + MCP)forgekit/bulk-image-pdf-ocr-engine✅ Standby MCP
HTML, Markdown & URL to Pixel-Perfect PDF & Invoice Rendererforgekit/html-markdown-url-to-pdf-rendererBatch REST API
Multi-Device Website Screenshot API (Desktop/Tablet/Mobile Matrix, Dark Mode, Visual Diff + MCP)forgekit/multi-device-website-screenshot-api✅ Standby MCP
Dataset Merge, Fuzzy Dedupe & Cross-Join Proforgekit/dataset-merge-dedupe-pro✅ Standby MCP
Dataset Diff & Change Detector (Added / Removed / Modified)forgekit/dataset-diff-change-detector✅ Standby MCP