API · AI data extraction

AI data extraction API. PDFs in, structured JSON out.

AI data extraction for developers: Cogneris extracts fields, tables, line items, signatures, clauses, and decisions from PDFs, scans, and images. Send a document with a template or inline schema; get validated JSON with confidence scores, citations, review routing, and webhook delivery.

Extract the fields your workflow actually needs

Raw document text is rarely the target. Your system needs invoice totals, bank-statement transactions, KYC identity fields, contract clauses, claim amounts, policy numbers, and the evidence behind each value. Cogneris lets you request a shipped template or pass your own JSON schema so the response matches the object your application expects.

{
  "document_type": "invoice",
  "invoice_number": { "value": "INV-2048", "confidence": 0.99 },
  "line_items": [{ "description": "Platform usage", "amount": 1480.00 }],
  "validation": { "status": "passed" }
}

One API for PDFs, scans, images, and document packets

Use the same endpoint for native PDFs, scanned PDFs, mobile photos, email attachments, and multi-document packets. Cogneris classifies the document, chooses the right extractor, stitches multi-page files, splits bundled packets, and returns one normalized payload per document.

Schema-based output instead of raw OCR text

AI data extraction only pays off when the output is typed. The extraction response is JSON with values, confidence, page references, bounding boxes, validation status, and audit metadata. That makes the output ready for underwriting systems, AP automation, onboarding flows, claims platforms, data warehouses, and AI agents.

Financial documents

Invoices, receipts, payroll, tax forms, bank statements, and reconciliation packets.

Identity and onboarding

KYC IDs, passports, proof of address, beneficial ownership forms, and supporting evidence.

Contracts and claims

Clauses, obligations, FNOL packets, policy details, repair estimates, and medical bills.

Extract data from PDF: fields first

Fields are the values a system needs one at a time: an invoice number, a statement period, a counterparty, a due date. Cogneris returns each as a typed value with its own confidence score, page number, and bounding box, so the number that lands in your ERP can be traced back to the pixels it was read from. Dates and amounts are normalized on the way out, which is what makes the output usable without a second parsing step. Validation runs in the same pass: a total that does not equal its line items, a date outside the statement period, or an identifier with the wrong checksum comes back flagged rather than silently accepted.

Extract tables and line items from PDF

Tables are where most PDF extraction tools break. A useful result has to understand headers, row boundaries, descriptions that wrap onto a second line, subtotals that are not rows, and tables that continue across a page break. Cogneris returns each table as an array of rows, every cell typed and scored, so a 300-line invoice or a 12-page transaction list arrives as data rather than as a grid of strings to clean up.

  • Line items — description, quantity, unit price, amount, and tax per row, with the row total reconciled against the document total. See invoice extraction.
  • Transactions — date, description, amount, and running balance per row, with balance-math checked across the statement. See bank statement extraction.
  • Any other table — schedules, rate tables, rent rolls, and exhibits, returned with the same per-cell confidence and page evidence.

Extract data from PDF to Excel or CSV

The API returns JSON. That is the right contract for an integration, and it is also a short step away from a spreadsheet: every table or line-item array is a flat list of typed cells, so writing it to XLSX or CSV is a few lines of code rather than a separate product. The same JSON feeds a reconciliation workbook, a Google Sheet, and a data warehouse without three different exports. The Python sample below shows the whole step.

FormatWhat you getBest for
XLSX (Excel)One row per line item or transaction, typed columns, written from the JSON response.Reconciliation, review by a controller, sharing one document's data.
CSVThe same flat rows as plain text, one file per document or per table.Google Sheets, accounting-software imports, warehouse loads.
JSONThe full response: fields, tables, confidence, citations, and validation status.REST and webhook integrations, agent tools, the audit trail.

Confidence, citations, and human review

Every field carries confidence and source evidence. High-confidence values can move straight through. Low-confidence or high-risk fields can route to human review without blocking the full document.

Async jobs and webhooks for production volume

Small files can run synchronously. Long packets, batch uploads, and high-volume workflows use async jobs with webhook callbacks, retry semantics, and signed payloads. Start in the API reference or go deeper in the extraction docs.

API sample: extract a document

Use your language's standard HTTP client with the REST API. Signed webhook samples show how to verify asynchronous callbacks without implying a published client library.

cURL
curl -X POST "$COGNERIS_BASE_URL/Document/extraction" \
  -H "Authorization: Bearer $COGNERIS_API_KEY" \
  -F "template=invoice" \
  -F "file=@./invoice.pdf"

In Python, the same call plus the spreadsheet step. Each cell in the response carries its value and confidence; the sample keeps the values and writes the line items to Excel:

Python
import os, pandas as pd, requests

with open("invoice.pdf", "rb") as f:
    r = requests.post(os.environ["COGNERIS_BASE_URL"] + "/Document/extraction",
                      headers={"Authorization": "Bearer " + os.environ["COGNERIS_API_KEY"]},
                      data={"template": "invoice"}, files={"file": f})
envelope = r.json()
fields = envelope["data"]["metadata"]
rows = [{col: cell["value"] for col, cell in item.items()} for item in fields["lineItems"]]
pd.DataFrame(rows).to_excel("invoice.xlsx", index=False)   # or .to_csv("invoice.csv")

Validation before data reaches your system

Cogneris validates extracted fields with totals reconciliation, date checks, regex rules, cross-document consistency, required-field checks, and tenant-specific business rules before the data is approved.

Scanned PDFs: the OCR fallback

A scanned PDF is a picture of a page with no text layer. Cogneris detects that during classification and runs OCR before extraction, so the same template and the same validation rules apply whether the file came from an ERP export or a phone camera. Rotated pages, skewed scans, and photos with shadows go through the same path; where the recognition is uncertain the confidence score says so, instead of a clean-looking value hiding a misread digit. Checkboxes, signature presence, stamps, and handwritten notes are kept as evidence so a reviewer can verify the field rather than re-read the page. For a text-first comparison of the two approaches, see the OCR API page.

How accuracy is measured

Character accuracy is the number most OCR vendors quote, and it is the least useful one for data extraction: a 99% character rate still means one wrong digit in a 100-character total. Cogneris measures accuracy per field, where a field is correct only when its normalized value matches the ground truth, and reports three figures alongside it:

  • Straight-through rate — the share of documents accepted automatically after validation and confidence checks, with no human touch.
  • Reviewer correction rate — how often a reviewer changed a value the model proposed, which is the honest measure of what the confidence score is worth.
  • Downstream defect rate — what still reached the ledger or the underwriting model wrong, which is the number the business actually pays for.

The extraction benchmark sets out how each figure is defined and how to run the same files, schema, timeout, and review threshold against every vendor. Run it on your own PDFs: an accuracy figure measured on someone else's corpus says little about your documents.

Common AI data extraction use cases

Use Cogneris for invoice extraction, bank statement extraction, contract extraction, KYC onboarding, insurance claims, payroll verification, and document-heavy workflow automation.

More on AI data extraction

Extract data from PDF

Extract fields, tables, line items, and citations from native PDFs and scanned PDFs.

Convert documents to JSON

Turn document packets into typed JSON with schemas, confidence, validation, and webhooks.

Extract tables from PDF

Return line items, transactions, rows, columns, totals, and table-level evidence.

Document extraction API pricing

Compare pricing drivers across page volume, complexity, validation, review, and audit needs.

Document extraction benchmark

Score vendors on field accuracy, citations, table fidelity, schema stability, review load, and webhook behavior.

Agentic document extraction

Classify, extract, validate, and route uncertain fields to review instead of making one brittle OCR pass.

Best OCR APIs for developers

What to compare before choosing an OCR API: JSON output, tables, confidence, webhooks, and review routing.

Python API sample

Upload documents, run async jobs, verify signed webhooks, parse JSON, and route low-confidence fields to review.

AI data extraction API FAQ

What is AI data extraction?
AI data extraction uses document AI models to read PDFs, scans, and images and return the fields, tables, and line items a system needs as typed JSON, with a confidence score and a source citation on every value, instead of a block of recognized text.
What is a document extraction API?
A document extraction API accepts documents such as PDFs, scans, and images, then returns structured fields, tables, confidence scores, and metadata that software can use directly.
Can Cogneris extract tables and line items?
Yes. Cogneris extracts line items, table rows, totals, dates, parties, clauses, identifiers, and other schema-defined fields with page evidence and confidence scores.
Can I pass my own JSON schema?
Yes. You can use shipped templates or pass an inline schema so the response matches the object your application expects.
How is this different from OCR-only APIs?
OCR returns recognized text. Cogneris turns recognized document content into typed JSON, validates it, attaches evidence, and routes uncertain fields to review.
How is document extraction API pricing calculated?
Cogneris pricing is page-based, with workflow cost affected by document volume, complexity, validation rules, review routing, and support requirements.
What file types does the document extraction API support?
Cogneris supports native PDFs, scanned PDFs, common image formats, and document packets used in workflows such as invoices, KYC, claims, contracts, and lending.
How fast is document extraction?
Small documents can run synchronously, while longer packets and batches run asynchronously. Actual latency depends on page count, document quality, schema complexity, and validation steps.
Does the API support webhooks for long documents?
Yes. Long documents, batches, and high-volume workflows can run as asynchronous jobs with signed webhook callbacks.
Can extracted fields include source citations?
Yes. Extracted fields can include source citations, page references, bounding boxes, confidence scores, and validation state for reviewable output.
Can low-confidence fields route to human review?
Yes. Confidence thresholds and business rules can route only the uncertain fields to review while high-confidence fields continue through automation.
Can I extract data from a PDF to Excel or CSV?
Yes. The API returns JSON, and every table or line-item array is a flat list of typed cells. Writing it to XLSX or CSV takes a few lines of code, as the Python sample on this page shows; there is no separate spreadsheet product.
How is extraction accuracy measured?
Per field, not per character: a field is correct when its normalized value matches the ground truth. Cogneris also reports the straight-through rate and the reviewer correction rate, and the extraction benchmark page explains how each is defined. Run the benchmark on your own files before trusting any vendor number.

Summarize this page with an AI assistant

Open this page in an assistant with the summary prompt already written. We publish the whole site as plain text at llms-full.txt, so an assistant can read what we actually wrote instead of inferring it.

Assistants summarize, and they get things wrong. Check anything that matters against this page, or ask us directly.