Documentation
Extraction · Extract tables
Pull every recoverable table out of a PDF as data: rows plus a CSV rendering, each tagged with the page it came from. Deterministic by default — no model is invoked and nothing is guessed.
- Endpoint:
POST https://inkrun.dev/api/v1/extract/tables, authenticated withAuthorization: Bearer sk_.... - MCP tool:
extract_tables. - Cost: deterministic tables are 1 credit per 20 pages — the deterministic tier's price (see Extract → Tiers & credits).
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
file_base64 | string | one of | Standard base64 of the PDF bytes. (file_path works only on the local stdio MCP server, where the file is read on your machine.) |
file_url | string | one of | An http(s) URL the server downloads the PDF from — cheaper than base64 for agents, which would otherwise emit the whole file as tokens. Must be publicly reachable: private, loopback and link-local addresses are refused, redirects are capped, and the download is size-capped to your plan’s document limit. |
ocr_fallback | boolean | no | Read tables off scanned pages' images too. Defaults to false; OCR pricing and caveats are identical to Extract. |
mime | string | no | Content type hint; PDFs are detected without it. |
It takes no preset or schema — it always returns all tables (sending one is a 400). Want the same tables inside the extract envelope? Use Extract with preset table_dump — it honours ocr_fallback identically.
curl "https://inkrun.dev/api/v1/extract/tables" \
-H "Authorization: Bearer $INKRUN_API_KEY" \
-H "Content-Type: application/json" \
-d "{ \"file_base64\": \"$(base64 -i price-list.pdf)\" }"Response
{
"id": "ext_71d0b2ce",
"tables": [
{
"page": 1,
"index": 0,
"rows": [
["SKU", "Description", "Unit price"],
["A-100", "Widget", "12.50"],
["A-200", "Gadget", "34.00"]
],
"csv": "SKU,Description,Unit price\nA-100,Widget,12.50\nA-200,Gadget,34.00"
}
],
"extraction_method": "deterministic",
"warnings": [
"A table on page 3 could not be deterministically reconstructed and was skipped."
],
"credits_charged": 1,
"pages": 4,
"size_bytes": 96411,
"duration_ms": 233
}| Field | Description |
|---|---|
tables[] | Every recovered table: rows (arrays-of-arrays of cell strings, row-major), a csv rendering, and { page, index } provenance. |
warnings | A table whose grid can't be recovered from positioned text (borderless merged cells, wrapped multi-line rows) produces a warning naming its page — instead of a half-guessed grid. |
extraction_method | deterministic, or ocr when ocr_fallback read scanned pages. |
credits_charged | What this call actually cost. |
Scanned pages
Works on ruled tables and whitespace-aligned tables in the document's text layer. A scanned page has no positioned text at all, so it yields no tables by default — the response tells you so in warnings. Pass ocr_fallback: true to read its tables off the page image instead; call Inspect first (free) to see which pages are scanned and what that would cost.
Errors
Identical to Extract → Errors, plus 400 invalid_request if a preset or schema is sent.
Machine-readable spec
This page is the human reference; the machine-readable OpenAPI spec for the v1 API is planned as its own piece of work.