# PDF table extraction API for RAG and financial documents

Canonical URL: https://webcite.co/table-extraction-api | Last updated: 2026-11-25

Webcite's table extraction API returns every table in a PDF or scan as an HTML table inside the page's Markdown, with merged header cells kept as `rowspan` and `colspan` and the table's position on the page. Below is a saved read of a Bureau of Labor Statistics table.

## A saved table read

Summary table A of the BLS Employment Situation release for October 2026, recorded on 24 November 2026 for 0.3981 credits. This is the page's `table` element; its `markdown` is cut after the third body row.

```json
{
  "type": "table",
  "bbox": [
    0.05799165086407973,
    0.07206000202272496,
    0.9398035735538126,
    0.7486695181792951
  ],
  "markdown": "<table><thead><tr><th rowspan=\"2\">Category</th><th rowspan=\"2\">Oct. 2025</th><th rowspan=\"2\">Aug. 2026</th><th rowspan=\"2\">Sept. 2026</th><th rowspan=\"2\">Oct. 2026</th><th>Change from:</th></tr><tr><th>Sept. 2026- Oct. 2026</th></tr></thead><tbody><tr><th colspan=\"6\">Employment status</th></tr><tr><td>Civilian noninstitutional population<sup>1</sup></td><td>–</td><td>275,415</td><td>275,554</td><td>275,682</td><td>128</td></tr><tr><td>Civilian labor force</td><td>–</td><td>169,777</td><td>170,262</td><td>170,683</td><td>421</td></tr>..."
}
```

The full table has 2 header rows, 6 section rows written as `<th colspan="6">` and 35 data rows. The footnote under it is a separate `footnote` element. [The full saved response](https://webcite.co/samples/doc-bls-table.json) and [the PDF](https://webcite.co/samples/bls-employment-situation-2026-10-summary-table-a.pdf).

## Request

```bash
curl --fail-with-body -X POST https://api.webcite.co/api/v1/upload \
  -H "x-api-key: $WEBCITE_API_KEY" \
  -F "file=@./report.pdf"

curl --fail-with-body --max-time 900 -X POST https://api.webcite.co/api/v1/extract \
  -H "x-api-key: $WEBCITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"asset_id":"YOUR_ASSET_ID","mode":"standard"}'
```

```typescript
import { readFile } from "node:fs/promises";
import { Webcite } from "webcite";

const client = new Webcite();
const bytes = new Uint8Array(await readFile("table.pdf"));
const { data } = await client.upload(bytes, { filename: "table.pdf" });
const doc = await client.extract({ asset_id: data.asset_id, mode: "standard" });
const tables = (doc.units ?? []).flatMap((unit) =>
  (unit.elements ?? []).filter((element) => element.type === "table")
);
console.log(tables.length, JSON.stringify(tables[0]?.bbox));
```

```text
1 [0.05799165086407973,0.07206000202272496,0.9398035735538126,0.7486695181792951]
```

The [TypeScript SDK](https://www.npmjs.com/package/webcite) wraps the same calls: `npm install webcite` installs it, and `npx webcite` runs its command line tool. It reads the key from `WEBCITE_API_KEY`. The last block is the output for the saved BLS response.

## Output formats

- PDF pages and images: each table is an HTML or Markdown table in the element's `markdown`, with a `bbox` locating it on the page.
- Spreadsheets: cells are read from the workbook (`extraction_method` is `spreadsheet_cells`) and cost 0 credits.
- For CSV or JSON, parse the HTML table. The [PDF table extractor](https://webcite.co/tools/pdf-table-extractor) has this table as [CSV](https://webcite.co/tools/pdf-table-extractor/bls-summary-table-a.csv) and [JSON](https://webcite.co/tools/pdf-table-extractor/bls-summary-table-a.json).
- Standard is more accurate than lite on multi-level headers and dense tables. A dense table page costs about 2.15 credits in standard.

The [extract endpoint reference](https://webcite.co/api-docs/extract) lists every field of the response. To compare providers, read [the best PDF table extraction APIs](https://webcite.co/blog/best-pdf-table-extraction-api-2026/).

## Benchmark result

In its own full run, Webcite scored 91.74 overall on [ParseBench 2](https://webcite.co/benchmarks), the public document parsing benchmark.

## Check a number against its source

A figure taken from a table can be checked against the same uploaded file, so the answer cites the page it came from.

- [Check quotes in a batch](https://webcite.co/api-docs/batch): pass the same `asset_id` and a page, and each quote comes back with whether it was found in that source, for 1 credit a quote.
- [Analyze document figures](https://webcite.co/api-docs/analyze-document) extracts the numbers from a PDF or spreadsheet, then recomputes and compares them, for 3 credits.

```typescript
import { Webcite } from "webcite";

const client = new Webcite();
const results = await client.verifyBatch([
  { id: "labor-force", quote: "Civilian labor force", asset_id: "YOUR_ASSET_ID", page: 1 },
]);
console.log(results[0].binding, results[0].verification);
```

## Limits

- Files up to 100 MB; extraction counts at half of your plan's request limits: 25 a minute and 250 a day on Free.

## Try it

Open the saved table without an account in the [PDF table extractor](https://webcite.co/tools/pdf-table-extractor). Forms, charts and other inputs are on the [document parsing API](https://webcite.co/document-parsing-api) page. To extract your own, create an account; the Free plan includes 100 credits.

[Create a free account](https://webcite.co/signup)
