Data extraction API: how it works, how to choose one and how to use it

For developers and operations leads adding document extraction to their systems: what these APIs return, what to check before you pick one, and the 5 steps from getting an API key to going live.

Illustration of a developer writing API code that returns validated results

Key takeaways

  • A data extraction API takes a source, such as a PDF, a scan or a web page. It returns the data in it as structured output, usually JSON.
  • There are four kinds. OCR APIs return text, and document extraction APIs return named fields and tables. Web data extraction APIs return content from web pages, and database and application APIs return records a system already holds.
  • A good document extraction API returns a confidence score and a location for every value. Doubtful values can then go to a person, and any value can be traced to its source.
  • Document APIs are often asynchronous. You upload a file and get the result later, by webhook or from a status endpoint. So plan for retries, rate limits and review from the start.
  • Compare APIs on total cost per document, including the time people spend fixing values, not on the price per page.
On this page
  1. Document extraction APIs compared
  2. Types of data extraction API
  3. How a document extraction API call works
  4. The best data extraction APIs for documents
  5. How to choose a data extraction API
  6. How to use a data extraction API in 5 steps
  7. Building blocks or a platform
  8. Frequently asked questions

A data extraction API turns a PDF, a scanned form or a web page into structured data. The data usually comes as JSON, a format other software can read. A document extraction API is the kind built for business documents. It first works out the document type. It then returns named fields and tables instead of raw text. Each value comes with a confidence score, which shows how sure the API is, and its place on the page.

First we compare four document extraction APIs, and what each one means if you build it into your own software. Then we cover the four kinds of API and what happens when your system sends a document to one. Last comes how to go live.

Document extraction APIs compared

Docsumo is our product. The other three are the document AI services of the big cloud providers. We took details from each vendor's own website in September 2026. The links are in the sources at the end.

ToolReturnsReview screenRuns onPricingWatch for
IDP platforms1 tool
DocsumoOur productChecked fieldsTablesIncluded; can run in your product without Docsumo brandingCloudFree trial; paid plans priced on requestCloud only, and your own team does the review
Cloud document AI APIs3 tools
Amazon TextractTextFormsTablesBuild your ownAWS$1.50 per 1,000 pages for plain textHandwriting in English only; AWS's human review service, A2I, is closed to new customers
Google Document AITextLayoutEntitiesBuild your ownGoogle Cloud$1.50 per 1,000 pages for OCRGoogle deprecated (marked as no longer supported) its human review feature in January 2024
Azure Document IntelligenceTextTablesKey-value pairsBuild your ownAzure, or containers you run yourself$1.50 per 1,000 pages for the Read modelCustom extraction costs $30 per 1,000 pages

For more OCR-only options, see the best OCR APIs.

Embedding an extraction API in your own product

Software companies that add document extraction to their product need more than JSON. Their users also need a way to fix the values the API is unsure about. Docsumo's document extraction API returns checked fields, and its review screen can run inside your product without Docsumo branding. Your product can create a Docsumo account for each of your customers through a signup API. Uploads can be up to 500 pages per file. With the cloud APIs, your team builds the checks and the review screen itself.

Types of data extraction API

Which kind you need depends on where the data lives.

  • OCR APIs

    Return the text on a page image, with each word's position and a confidence score. You write the rules that turn text into fields. See the best OCR APIs.
  • Document extraction APIs

    Return named fields and tables for a document type. Examples are an invoice's number and line items, the boxes on a tax or insurance form, and the tables in a report or research paper. Smart, intelligent and form data extraction APIs are all this kind, and it's the one for business documents.
  • Web data extraction APIs

    Fetch web pages and return their content as clean data. Examples are an article's main text without menus and ads, or a product's name, price and reviews. Content extraction and scraping APIs usually mean this kind. See data extraction vs data scraping.
  • Database and application APIs

    Return records a system already holds, from a database or a software product's REST API. Nothing is read, because the data is already structured.

How a document extraction API call works

You send a file, the service reads and checks it, and the result comes back as JSON. It often comes by webhook, because a long document can take a while.

  • PDFs and scans
  • Phone photos
  • Email attachments
Extraction API
  1. 01Classify the document
  2. 02Extract fields and tables
  3. 03Validate the values
  4. 04Review low-confidence fields
JSON to your system by webhook
What happens between the upload and the webhook

Field names differ by vendor, but the response usually carries the same things. It holds the document type, each value, a confidence score and the page the value came from, often with its coordinates.

{
  "id": "doc_7Q2K9",
  "type": "invoice",
  "fields": {
    "invoice_number": { "value": "INV-20418", "confidence": 0.99, "page": 1 },
    "invoice_date": { "value": "2026-09-14", "confidence": 0.98, "page": 1 },
    "po_number": { "value": "PO-7731", "confidence": 0.64, "page": 1 },
    "total": { "value": 1260.00, "confidence": 0.99, "page": 1 }
  },
  "line_items": [
    { "description": "Work table", "qty": 2, "unit_price": 385.00, "amount": 770.00,
      "confidence": 0.97, "page": 1 },
    { "description": "Sheet pan rack", "qty": 2, "unit_price": 245.00, "amount": 490.00,
      "confidence": 0.96, "page": 1 }
  ]
}

The PO number at 0.64 is the value to send to a person. What you do with low-confidence values decides how much you can trust the rest.

The best data extraction APIs for documents

Docsumo is our product, so we've put it first and said plainly what it doesn't do. The other three are the document AI services of the big cloud providers.

1. Docsumo

IDP platformOur product
Docsumo is an intelligent document processing (IDP) platform with a document extraction API. You send a document, and it extracts the fields and tables, checks them and returns structured data through its API and webhooks. On the Business plan it also classifies and splits files that hold several documents. Fields below the confidence threshold you set go to your reviewers first, and their corrections improve the model. It supplies the software, not a review team, and it runs in the cloud only.
Reads
Any business document, printed or handwritten, covering 250+ document types, including invoices, bank statements and tax forms
Output
JSON through the API and webhooks, or an Excel export
In your product
The review screen can run without Docsumo branding, and each of your customers can get its own account
Testing
A test environment on the Business plan
Security
SOC 2 Type 2 audited, ISO/IEC 27001:2022 certified, and HIPAA and GDPR compliant; your documents aren't used to train shared or third-party models (security)
Pricing
A free 14-day trial for up to 1,000 pages, with the API and webhooks; Business and Enterprise plans are quoted
Watch for
It runs in the cloud only, and your own team reviews the values it's unsure about
Best fitLending, insurance and AP teams, and software companies, that need checked fields, not raw text
  • 99%field-level accuracy across 250+ document types
  • 95%+of documents processed straight through, without manual review
  • 3,000+hours a month saved at Arbor

2. Amazon Textract

Cloud document AI API
Amazon Textract is AWS's machine learning service for text, handwriting, forms, tables and signatures. It has separate APIs for invoices and receipts (AnalyzeExpense), IDs (AnalyzeID) and mortgage packages (Analyze Lending).
Reads
PNG, JPEG, TIFF and PDF; printed text in 6 languages, handwriting in English only
Output
JSON blocks with coordinates and a confidence score for each item
Pricing
Text $1.50, tables $15 and forms $50 per 1,000 pages (AWS's US West example); a 3-month free tier for new AWS customers
Watch for
AWS's human review service, A2I, is closed to new customers, so you build the review step
Best fitDevelopers on AWS who want OCR and form extraction as building blocks. See Docsumo vs Amazon Textract.

3. Google Document AI

Cloud document AI API
Google Cloud's document service includes Enterprise Document OCR for text in 200+ languages, a Form Parser, a Gemini-based Layout Parser and a Custom Extractor. It also has pre-trained parsers for documents such as invoices, bank statements, pay slips, W-2s and US driver's licenses.
Reads
PDFs and images, including handwriting in some languages
Output
A JSON document object with text, layout, key-value pairs, tables and entities
Pricing
OCR $1.50 per 1,000 pages after the first 1,000; Form Parser and Custom Extractor $30 per 1,000 pages
Watch for
Google deprecated its human review feature in January 2024, so you build the review step
Best fitDevelopers on Google Cloud who want OCR and custom extraction in one service. See Docsumo vs Google Document AI.

4. Azure Document Intelligence

Cloud document AI API
Azure Document Intelligence is Microsoft's document extraction service. It's now called Azure Document Intelligence in Foundry Tools, and it was formerly Form Recognizer. It has read and layout models, prebuilt models for common documents, and custom extraction and classification models.
Reads
Printed text in 300+ languages and handwriting in 12; prebuilt models for invoices, receipts, IDs, bank statements, US pay stubs, US mortgage forms and US tax forms
Output
JSON through a REST API and SDKs for C#, Python, Java and JavaScript
Pricing
Read $1.50, prebuilt models $10 and custom extraction $30 per 1,000 pages; 500 free pages a month
Watch for
No review screen comes with it, so your team builds the review step
Best fitTeams on Azure, including those that need to run it in containers. See Docsumo vs Azure Document Intelligence.

How to choose a data extraction API

  • Models for your documentsCheck it has pre-trained models for the documents you actually receive, and what happens with the ones it doesn't know.
  • Confidence and location on every valueWithout them you can't route doubtful values to a person or show a reviewer where a number came from.
  • A review stepDecide who fixes low-confidence values. It can be a review queue in the product, or screens your team builds and maintains.
  • WebhooksResults are pushed to you when a document is done, so you don't have to keep asking.
  • SecurityCertifications such as SOC 2 Type 2, how long files are kept, and whether your documents train shared models.
  • SDKs and a test environmentReady-made code (client libraries) for the programming language your team uses, and a place to try changes before they go live.
  • Pricing modelPer page, per document or per plan. Compare the total cost per document, including review time.

Our take. Judge an extraction API by the values a person had to fix on your own documents, not by a vendor's accuracy figure. If you build the API into your product, your users will judge it the same way. So we'd test each API on a month of your real files and count the fixes before choosing.

Price per page is only part of the cost. Put in your own volumes.

Total cost per document

Per-page prices look small until you add the time people spend fixing what the tool gets wrong.

From the tool's pricing page or your quote
Tool cost per month
$200
Review time per month
$1,167
Total per month
$1,367
Total cost per document
$0.27
How it's worked out
  • Tool cost = documents × pages × price per page.
  • Review time = documents × the share reviewed × minutes per review ÷ 60 × hourly cost.
  • Compare tools on the total per document, not the price per page: a cheaper tool that sends more documents to review can cost more.

How to use a data extraction API in 5 steps

Write down what you need first. List the document types, the fields, your monthly volume and how fast results must come back. Then follow these steps.

  1. Get an API keySign up for a trial or a cloud account, create a key, and read the API docs for file size limits, rate limits and the current version. Keep the key on your server or in a secrets manager, never in browser code. Most APIs take it, or an OAuth 2.0 bearer token, in a request header over HTTPS.
  2. Send a test documentPost one real file with cURL or Postman before writing code. Send the file or a link to it, and the document type if you know it. Add your own reference ID, so the result maps back to your record.
  3. Take results by webhookExtraction can take seconds or minutes, so many document APIs work asynchronously. They call a webhook URL you give them when a document is done, or you check a status endpoint until it is. Reply to the webhook at once with a 2xx code, and process the payload in the background.
  4. Map the JSON to your systemMap the vendor's field names to yours, and put dates and amounts in one format. Keep the page and position of each value, so anyone can trace it to the source. See schema mapping.
  5. Handle errors and low confidenceRetry 429 (too many requests) and 5xx responses with growing waits, and honor any Retry-After header. Fix other 4xx errors, such as a bad file or an expired key, instead of retrying them. Send low-confidence values to a person, not into your system.

In the first weeks, compare the number of documents sent with the number of results received. Also check a sample of values against the documents themselves.

“We love Docsumo for its ease of integration and the flexibility it provides with API and webhook callbacks.”

Howard Leiner, CTO, Arbor

Building blocks or a platform

Choose the kind of API by where your data comes from. OCR APIs return text, web data extraction APIs read web pages, and document extraction APIs return named, checked fields from business documents. The big cloud services give developers basic parts to build their own tool. An IDP platform such as Docsumo adds the checks and the review step, so your team only handles the values the platform is unsure about.

Book a demo with a few of your own documents, or start a free trial and call the API on them.

Frequently asked questions

What is a data extraction API?

It's a web service that takes a document, an image or a web page and returns the data in it, usually as JSON. Document extraction APIs return named fields and tables, with a confidence score for each value.

Which document data extraction API is best to embed in our own software product?

Pick one that returns checked fields with a confidence score, and lets your users fix the values it's unsure about. Docsumo returns checked fields and tables, and its review screen can run inside your product without Docsumo branding. The cloud APIs from AWS, Google and Microsoft return extracted data without checks, so your team builds the checks and the review screen.

Can each of our customers have its own account?

With Docsumo, yes. Your product can call a signup API to create a separate Docsumo account for each of your customers. The signup API isn't in the public API reference, so ask us for the details.

How much does an embedded document extraction API cost?

Cloud APIs publish per-page prices, such as Amazon Textract at $1.50 per 1,000 pages for text. Docsumo starts with a free trial of 14 days and up to 1,000 pages, with the API and webhooks included. It then agrees terms with each software company before that company launches.

How large a file can a document extraction API take?

Limits differ by vendor, so check them in the API docs before you build. Docsumo takes uploads of up to 500 pages per file, and one upload can hold many document types.

How do you get data from an API?

Get an API key or token, send an HTTP request to the right endpoint with the key in a header, and read the JSON response. Document extraction APIs add a step. You upload the file, then receive the result by webhook or by checking a status endpoint.

See Docsumo read your own documents

Bring a few real samples. We'll show the fields extracted, the checks that ran and what a reviewer would see.