Migrate from Amazon Textract to Webcite
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.
Last updated
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. Corrections: support@webcite.co.
What maps to what
| Amazon Textract | Webcite |
|---|---|
| AnalyzeDocument with FeatureTypes FORMS | POST /api/v1/upload, then POST /api/v1/extract; form fields are always included |
| KEY_VALUE_SET blocks linking KEY and VALUE | One line per field in units[].elements[].markdown: the label, : , then the entry (___ when empty, [ ] for an empty box) |
| AnalyzeDocument (synchronous) or StartDocumentAnalysis (asynchronous) | 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.
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.
npm install webciteimport { 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}`);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. The Free plan includes 100 credits.
Create a free accountBefore you switch
Amazon Textract alternative for forms and claims shows where Amazon Textract is the better choice.