# Document parsing API: PDFs, scans, tables, charts and forms to Markdown

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

Webcite's document parsing API reads a PDF, scan, slide deck or spreadsheet page by page and returns Markdown, with tables, charts and form fields kept in place and every element carrying its position on the page. The read below is a saved response for a public IRS form.

## A saved read of a public form

Form W-9, page 1, from the IRS, read on 24 November 2026. The page was classified as a `form` and came back as 45 elements, each with a bounding box in page coordinates from 0 to 1. The read cost 0.4966 credits. Three elements are shown; nothing else is changed.

```json
{
  "format": "pdf",
  "state": "complete",
  "units": [
    {
      "kind": "page",
      "index": 1,
      "reader": {
        "page_type": "form"
      },
      "extraction_method": "ocr",
      "elements": [
        {
          "type": "text",
          "markdown": "Form **W-9**  \n(Rev. March 2024)  \nDepartment of the Treasury  \nInternal Revenue Service",
          "bbox": [
            0.05872457486494331,
            0.0448175558839257,
            0.19542535848792816,
            0.10306223020890928
          ]
        },
        {
          "type": "title",
          "markdown": "# Request for Taxpayer Identification Number and Certification",
          "bbox": [
            0.30102168495309733,
            0.04781959115681964,
            0.6993639285090649,
            0.08171085992110318
          ]
        },
        {
          "type": "text",
          "markdown": "**Go to *www.irs.gov/FormW9* for instructions and the latest information.**",
          "bbox": [
            0.2808420826304612,
            0.09019152900609942,
            0.7189029945298423,
            0.10099802622217478
          ]
        }
      ]
    }
  ],
  "usage": {
    "credits": 0.4966,
    "pages": 1,
    "page_charges": [
      {
        "page": 1,
        "page_type": "form",
        "credits": 0.4966
      }
    ]
  }
}
```

[The full saved response](https://webcite.co/samples/doc-irs-w9.json) and [the PDF that was read](https://webcite.co/samples/irs-form-w9-page-1.pdf).

## A table keeps its structure

A summary table from the Bureau of Labor Statistics release for October 2026, read on 24 November 2026 for 0.3981 credits. Merged header cells come back as `rowspan` and `colspan` in an HTML table inside the Markdown. The first rows:

```markdown
**HOUSEHOLD DATA**

# Summary table A. Household data, seasonally adjusted

[Numbers in thousands]

<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><tr><td>Participation rate</td><td>–</td><td>61.6</td><td>61.8</td><td>61.9</td><td>0.1</td></tr>
```

[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).

## Benchmark result

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

## What it reads

- PDF, JPEG and PNG pages are read with layout elements: typed blocks such as titles, text, tables and pictures, each with a bounding box.
- Spreadsheets, DOCX, PPTX, HTML and text files are read from the file itself and cost 0 credits.
- Files up to 100 MB. Extraction counts at half of your plan's request limits: 25 a minute and 250 a day on Free.
- A page that cannot be read is not charged, and one page is never charged more than 10 credits.

## Two modes: lite and standard

| Mode | Typical credits a page | Use it for |
| --- | --- | --- |
| Lite | 0.05 to 0.23 | High-volume plain documents |
| Standard | About 0.74 | Complex tables, handwriting and scans, where it is more accurate |

Extraction is charged at cost, at $0.04 a credit. From 1 December 2026 the average standard page costs about 1.27 credits. [What a document costs](https://webcite.co/api-docs/extraction#cost) lists each page type, and [the best document parsing APIs](https://webcite.co/blog/best-document-parsing-apis-2026/) compares providers.

## Make the first call

Upload the file, then extract it with the returned `data.asset_id`. Extraction returns when every page is read, so allow a long timeout.

```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";

const API = "https://api.webcite.co/api/v1";
const headers = { "x-api-key": process.env.WEBCITE_API_KEY! };

const form = new FormData();
form.append("file", new Blob([await readFile("report.pdf")]), "report.pdf");
const upload = await fetch(`${API}/upload`, { method: "POST", headers, body: form });
if (!upload.ok) throw new Error(await upload.text());
const { data } = await upload.json();

const extract = await fetch(`${API}/extract`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({ asset_id: data.asset_id, mode: "standard" }),
  signal: AbortSignal.timeout(900_000),
});
if (!extract.ok) throw new Error(await extract.text());
const doc = await extract.json();
console.log(doc.state, doc.usage.credits, doc.markdown.slice(0, 500));
```

The [extraction quickstart](https://webcite.co/api-docs/extraction) has the same calls in Python, and the [extract endpoint reference](https://webcite.co/api-docs/extract) lists every field of the response. A new account starts on the Free plan with 100 credits.

## Use the TypeScript SDK

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 same two calls read the saved IRS form. The last block is the recorded output, printed from the same saved response.

```bash
npm install webcite
```

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

const client = new Webcite();
const bytes = new Uint8Array(await readFile("irs-form-w9-page-1.pdf"));
const { data } = await client.upload(bytes, { filename: "irs-form-w9-page-1.pdf" });
const doc = await client.extract({ asset_id: data.asset_id, mode: "standard" });
console.log(doc.state, doc.usage?.credits);
console.log(doc.markdown?.split("\n")[0]);
```

```text
complete 0.4966
Form **W-9**
```

## After the read: check and cite

- [Anchored chunks](https://webcite.co/api-docs/chunks) split the read into chunks that keep their page, sheet or section location, for retrieval.
- [Fact-check API](https://webcite.co/fact-check-api): check a claim from the document against sources and get a verdict with quotes.
- [Citation API](https://webcite.co/citation-api): bind each answer to the exact quote, page or spreadsheet cell.
- [Analyze document figures](https://webcite.co/api-docs/analyze-document): extract the numbers, then recompute and compare them.

## Inside your own boundary

For documents that cannot leave your environment, Webcite runs self-managed in your own cloud tenant, with model calls kept inside it. [Enterprise deployments](https://webcite.co/enterprise).

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