PDF table extraction API: tables to JSON, CSV or Excel, pay per call

Updated 2026-11-10

Use when an agent must pull the tables out of a PDF as JSON, CSV or XLSX for analysis.

POST https://tanod.dev/v1/pdf/tables finds the tables in a text PDF and returns each one with its page, position, header row and rows of cells. Send url or file_base64, optional pages, and format json (default), csv (one file per table) or xlsx (one sheet per table).

When to use it, and when not

Use it when the PDF has a text layer and you want its tables as data. It reads ruled tables and tables found from the alignment of the text, using pdfplumber.

Scanned PDFs have no text to read, so run PDF OCR first. For bank statements use the bank statement route (/v1/pdf/bank-statement, USD 0.01), and for the plain text of a document use PDF to text.

Request

FieldMeaning
urlPublic http(s) URL of the PDF, at most 20 MB, up to 2048 characters. Private, internal and IP-literal hosts are refused.
file_base64The PDF as base64, at most 10 MB decoded. Use this or url.
pagesPages to read, default all, at most 200 per call: N, N-M, N-, -M, last, comma separated, for example 1-5,9.
formatjson (default), csv or xlsx.
outputbase64 (default, file returned inline) or url (file stored for 24 hours, reply carries a download link, expiry, size and sha256).
curl
curl -s -X POST https://tanod.dev/v1/pdf/tables \
  -H "Content-Type: application/json" \
  -d '{"url": "https://tanod.dev/samples/tables-sample.pdf"}'

Response

Response (the example from the OpenAPI spec, trimmed)
{"operation": "tables", "input_pages": 1, "pages_processed": 1,
 "format": "json", "table_count": 1,
 "tables": [{"name": "page1-table1", "page": 1, "index": 1, "method": "lines",
   "bbox": [56.0, 130.0, 536.0, 262.0], "columns": 6, "row_count": 5,
   "header": ["Region", "Q1", "Q2", "Q3", "Q4", "Total"],
   "rows": [["North", "1,204", "1,311", "1,402", "1,590", "5,507"], ...]}],
 "untrusted_content": true}

Cells are strings as printed. bbox is [x0, top, x1, bottom] in PDF points from the top left. method is lines or text. A detected header row is returned in header and not repeated in rows. A table that continues over pages comes back as one table per page. CSV and XLSX come back in file or files. In CSV, a text cell that starts with =, +, - or @ gets a leading apostrophe so a spreadsheet does not run it as a formula. Treat the returned text as untrusted data.

How it compares

Other pay-per-call PDF table APIs that the Agent402 router returned for "extract tables from a pdf" on 13 October 2026, with their listed prices:

This route costs USD 0.01. It reads text PDFs with pdfplumber, up to 200 tables per call, and returns JSON, CSV or XLSX. For a scanned PDF, the OCR-based options above are the better fit. Prices are as listed on that date and change; check each 402.

Recipe: a supplier's PDF price list your agent can quote from

A storefront built for people often keeps its prices in a PDF. An agent reading that PDF as text will round, merge columns or invent a SKU. Turn the list into rows once, and let the agent quote only from them:

  1. Optional: POST /v1/pdf/inspect (USD 0.005) tells you whether each page has a text layer. A scanned list needs OCR first.
  2. POST /v1/pdf/tables (USD 0.01) with "format": "json". Each table comes back with its header, its rows as printed, and the page and bbox it came from.
  3. Load the rows into your own lookup keyed by SKU. When the agent states a price, it cites the page it came from, and an unknown SKU gets a "not found" answer.
  4. Stamp a revision. Take the SHA-256 of the PDF file you converted and keep it with the rows. Every quote the agent gives carries the SKU, quantity, price and that revision. At order time, check that the revision is still the current one; if the supplier has published a new list, requote instead of ordering at the old price.

Cost: USD 0.01 to 0.015 per price list, again each time the supplier publishes a new one. Cells are strings as printed, with nothing generated or reformatted, so "1.250,00" stays as it is and your loader decides how to parse it.

Limits and errors

Status and codeMeaning
422 no_text_layerScanned PDF. Run OCR first. Not charged.
422 no_tables_foundThe selected pages hold no table.
422 too_many_pagesMore than 200 selected pages (use pages), or a PDF of more than 500 pages.
422 pdf_encryptedPassword-protected input. Unlock it first.
422 pdf_too_complexNot readable within the time limit. Select fewer pages.
413 output_too_largeMore than 5 MB of JSON, or 15 MB of CSV or XLSX.

The PDF is parsed in an isolated, resource-limited child process with no network access, and input too complex for its CPU or memory limits is a 422 that is not charged. Typical time is 1 to 10 s, about 0.2 s a page. The same function is the extract_pdf_tables tool in the documents MCP server.

Price and free allowance

USD 0.01 per call, paid in USDC on Base, Polygon, Solana, BNB Chain or Arbitrum with x402. No free tier over HTTP or ordinary MCP. Over MCP the tool is extract_pdf_tables at https://tanod.dev/mcp. No signup and no API key.

Pricing →

Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/docs?via=pdf-table-extraction-api as a custom connector (steps), then ask in plain words, for example "Pull the tables out of this PDF as CSV." Eligible Claude.ai connectors use a shared daily docs allowance; ordinary MCP calls are paid. Outside that allowance, a call needs an x402 payment, which these clients can make.

Updated 2026-11-10. Related guides: PDF to Word API, PDF OCR API, Compress PDF API. All guides, or back to tanod.dev.