# Migrate from Amazon Textract to Webcite

Canonical URL: https://webcite.co/migrate/textract | Last updated: 2026-11-25

To move Textract forms extraction to Webcite, replace `AnalyzeDocument` with an upload and an extract call. Form fields come back in the page Markdown as one line per field, the label, a colon, then the entry, instead of linked KEY and VALUE blocks. Each element also carries its box on the page.

## Who wrote this

Webcite wrote this guide. Each Amazon Textract term links the Amazon Textract documentation it comes from, checked on 25 November 2026; the Webcite calls follow the [API reference](https://webcite.co/api-docs). Corrections: [support@webcite.co](mailto:support@webcite.co).

## What maps to what

| Amazon Textract | Webcite |
| --- | --- |
| [AnalyzeDocument with FeatureTypes FORMS](https://docs.aws.amazon.com/textract/latest/dg/how-it-works-kvp.html) | `POST /api/v1/upload`, then `POST /api/v1/extract`; form fields are always included |
| [KEY_VALUE_SET blocks linking KEY and VALUE](https://docs.aws.amazon.com/textract/latest/dg/how-it-works-kvp.html) | One line per field in `units[].elements[].markdown`: the label, `: `, then the entry (`___` when empty, `[ ]` for an empty box) |
| [AnalyzeDocument (synchronous) or StartDocumentAnalysis (asynchronous)](https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeDocument.html) | One synchronous extract call; allow a long timeout |

## The replacement calls

Upload is free and returns `data.asset_id`. Extract 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"}'
```

## With the TypeScript SDK

The code reads key and value pairs from the element Markdown. Each element's `bbox` is `[x0, y0, x1, y1]` as fractions of the page, measured from the top left.

```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 });

// Each form line reads "label: entry". An empty entry is ___ and an empty box is [ ].
const fields = (doc.units ?? [])
  .flatMap((unit) => unit.elements ?? [])
  .flatMap((el) => String(el.markdown ?? "").split("\n"))
  .flatMap((line) => {
    const at = line.lastIndexOf(": ");
    return at > 0 ? [{ key: line.slice(0, at).replaceAll("**", "").trim(), value: line.slice(at + 2).trim() }] : [];
  });
for (const field of fields.slice(7, 10)) console.log(`${field.key} -> ${field.value}`);
```

```text
5 Address (number, street, and apt. or suite no.). See instructions -> ___
6 City, state, and ZIP code -> ___
Requester’s name and address (optional) -> ___
```

The output above is recorded from the API for the [sample W-9](https://webcite.co/samples/irs-form-w9-page-1.pdf). The Free plan includes 100 credits.

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

## Before you switch

[Amazon Textract alternative for forms and claims](https://webcite.co/compare/aws-textract) shows where Amazon Textract is the better choice.
