---
title: "Extract tables from a PDF"
method: POST
path: "/v1/documents/tables"
tags: ["documents"]
---

# Extract tables from a PDF

`POST /v1/documents/tables`

## Request

- Base URL: `https://api.relaex-engineers.de`
- URL: `https://api.relaex-engineers.de/v1/documents/tables`
- Auth: none declared

Extracts tables from a text-based PDF.

**Input:** multipart `file` (PDF up to 20 MiB, 60 pages per call) and optional `options` as a JSON
string following `/v1/schemas/documents-tables-options`: `pages` (e.g. `"1-3,7"`), `strategy`
(`lines`, `text`, `auto`), `merge_continuations`, `include_cells`, `output` (`json` or `csv`),
`table_id` to choose the CSV table.

**Behaviour:** pdfplumber line and text strategies, detection of header rows, titles and
footnotes, tables continued across pages are merged only with evidence (identical header row
or column edges). Each table carries page, bounding box in PDF points (origin top left) and a
quality level with reasons. Cells stay text. Pages without text are reported, scans as
`OCR_REQUIRED`; nothing is guessed.

**Output:** `ApiResponse` with `TablesResult`, or with `output=csv` the best table as `text/csv`
(semicolon) with headers `X-Table-Id`, `X-Table-Page`, `X-Table-Confidence`. The CSV can be
passed straight to `/v1/supplier/compare`, which also accepts PDFs directly
(`options.pdf_old`, `options.pdf_new`).

**Errors:** 400 not a PDF or encrypted, 413 too large or too many pages, 422 invalid options or
table not found, 429 rate limit, 504 timeout.

**Languages:** responses are in English. Error, warning and rule codes are stable and
language-neutral; agents may translate messages for the user. Text in any language or script is extracted as embedded in the PDF.

**Access:** open, rate-limited per IP and per MCP session; an `X-API-Key` header raises the
limit. Uploaded files are processed in memory and never stored. Also available as MCP tool
`documents_tables` at `/mcp` (Streamable HTTP).

## Response `200`

ApiResponse with TablesResult (JSON) or the best table as CSV

- unknown

## Other responses

- `400`: INVALID_PDF, ENCRYPTED_PDF
- `413`: FILE_TOO_LARGE, PAGE_LIMIT_EXCEEDED
- `422`: INVALID_OPTIONS, NO_TABLE_FOUND, TABLE_NOT_FOUND
- `429`: RATE_LIMITED
- `504`: ANALYSIS_TIMEOUT

---

[API](https://skmtc.dev/relaex-engineers/apis/boring-api.md) · [All operations](https://skmtc.dev/relaex-engineers/apis/boring-api/llms.txt) · [OpenAPI document](https://skmtc.dev/relaex-engineers/apis/boring-api/revisions/269481105eb2?raw)
