---
title: "KYC document extraction: Build a pipeline in Python"
canonical_url: "https://www.nutrient.io/blog/kyc-document-extraction/"
md_url: "https://www.nutrient.io/blog/kyc-document-extraction.md"
last_updated: "2026-11-18T18:22:58.077Z"
description: "Build a KYC document extraction pipeline in Python: Define a JSON Schema, then gate every field on match type and confidence before it reaches review."
---

When a user uploads their passport during onboarding, several things need to happen in quick succession: The document gets read, specific fields get pulled out, confidence levels get checked, and the application either continues automatically or lands in a human review queue, depending on what the extraction found. If any of those steps are slow, opaque, or error-prone, the whole onboarding funnel suffers.

This tutorial walks through building that pipeline with the [Nutrient Data Extraction API](https://www.nutrient.io/api/data-extraction-api/kyc/). You’ll send a real identity document, define a typed schema for the fields you care about, parse the source-grounded response, and wire up a review queue gated on both confidence and match type. By the end, you’ll have a working Python implementation you can adapt directly to your stack.

**TL;DR**

Identity documents can be extracted into typed JSON with a JSON Schema that names each field, and every value comes back with a page number, a bounding box, a confidence score, and a match type describing how it was found. The match type is what makes automation safe: A fuzzy match at high confidence on a passport number is a confident read of something similar, and confidence alone can’t distinguish it from an exact read. Gate on both, route identifier fields on exact matches only, and send everything else to a reviewer with the coordinates needed to check it in seconds.

## What you’re building

The finished pipeline does four things.

1. Accepts an identity document (passport, driver’s license, or national ID)

2. Sends it to the extraction API with a JSON Schema that specifies exactly which fields to extract

3. Parses the source-grounded response — every field comes back with a value, a match type, a confidence score, and a bounding box locating that value on the original page

4. Routes the result: Fields that matched exactly and clear the confidence threshold pass through automatically; everything else joins a review queue with enough context for a human reviewer to act without rereading the whole document

Nothing is silently accepted. Low-confidence and approximate reads are escalated with provenance intact, not dropped.

## Prerequisites

- A Nutrient API key — [Get one free here](https://www.nutrient.io/api/data-extraction-api/)

- Python 3.10+

- `requests` (`pip install requests`)

- A sample identity document — The [nutrient-extraction-samples](https://github.com/PSPDFKit/nutrient-extraction-samples) repository has test documents you can use, or use any synthetic or redacted ID for development

## Step 1: Your first extraction request

The API takes a multipart POST with exactly two parts: `file`, the document bytes; and `instructions`, a JSON string describing what to do with it. Authentication is a bearer token.

```python

import json
import requests

API_KEY = "your_api_key_here"
EXTRACT_URL = "https://api.nutrient.io/extraction/extract"

def extract(file_path: str, schema: dict, mode: str = "understand") -> dict:
    instructions = {
        "mode": mode,
        "schema": schema,
        "citationsEnabled": True,
    }
    with open(file_path, "rb") as f:
        response = requests.post(
            EXTRACT_URL,
            headers={"Authorization": f"Bearer {API_KEY}"},
            files={
                "file": (file_path, f, "application/pdf"),
                "instructions": (None, json.dumps(instructions), "application/json"),
            },
            timeout=300,
        )
    response.raise_for_status()
    return response.json()

```

Three details in that call are easy to get wrong.

**`citationsEnabled: True` is what produces the bounding boxes.** Citations are opt-in. Leave this out and the response still contains values, but no source coordinates — which removes the entire basis for the review queue built in Step 4.

**`instructions` is a JSON string, not a nested form body.** It goes over the wire as its own multipart part with content type `application/json`. Passing `files=` and `json=` to `requests` in the same call doesn’t do this. `requests` builds the body from `json` and then silently overwrites it with the multipart encoding, so the schema never reaches the server. The response comes back as if no schema had been supplied, and no error is raised.

**The 300-second timeout is deliberate.** A photographed ID in `understand` mode takes tens of seconds; a sample response for a one-page form reports `metrics.processingTimeMs: 18411`.

### Choosing a mode

There are four modes, priced per page. The prices below include extraction:

| Mode         | Price per page                                                                                                | What it does                                                                              |
| ------------ | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `text`       | $0.007       | Reads existing text. Born-digital documents only, no optical character recognition (OCR). |
| `structure`  | $0.0075  | Runs OCR before producing output. Scans and images.                                       |
| `understand` | $0.015 | Adds form semantics and key-value relationships.                                          |
| `agentic`    | $0.024    | Vision-language analysis for visual or ambiguous content.                                 |

Identity documents in the real world are scanned at varying resolutions, photographed at angles, and sometimes laminated in ways that create glare. For anything that might come from a phone camera, `understand` mode is the right default: It applies OCR correction and reads the field semantics that `structure` doesn’t. Only where a document needs multistep reasoning to resolve is `agentic` mode worth the higher price.

The gap between `structure` at $0.0075 and `understand` at $0.015 is worth planning around, but the choice is made per channel, not per document. A mode that skips form semantics on a passport photo returns something, and what it returns isn’t reliable enough to gate on.

The [processing modes](https://www.nutrient.io/guides/dws-data-extraction/parsing/processing-modes.md) guide states one caveat directly, and the rest of this tutorial follows from it:

Even in `agentic` mode, recognition of an ambiguous word can be confident but wrong — the model may settle on a plausible word that differs from what was actually written. For high-stakes fields, check the per-element `confidence` scores and add a human review step where accuracy is critical.

No mode removes the need for gating. A higher mode narrows the gap; it doesn’t close it.

## Step 2: Define your extraction schema

The API takes plain JSON Schema. A schema tells the extraction exactly which fields to pull and what types they should be, such as the expiry date as a date, the document number as a string, and the document type constrained to three known values.

```python

kyc_schema = {
    "type": "object",
    "properties": {
        "full_name": {
            "type": "string",
            "description": "Full legal name as printed on the document.",
        },
        "date_of_birth": {
            "type": "string",
            "format": "date",
            "description": "The holder's date of birth.",
        },
        "document_number": {
            "type": "string",
            "description": "Passport number, driver's license number, or national ID number.",
        },
        "expiry_date": {
            "type": "string",
            "format": "date",
            "description": "Document expiration date.",
        },
        "issuing_country": {
            "type": "string",
            "description": "Country, state, or province that issued the document.",
        },
        "document_type": {
            "type": "string",
            "enum": ["passport", "driver_license", "national_id"],
            "description": "Type of identity document.",
        },
        "nationality": {
            "type": "string",
            "description": "Nationality as printed on the document. Passports only.",
        },
    },
    "required": [
        "full_name",
        "date_of_birth",
        "document_number",
        "expiry_date",
        "document_type",
    ],
}

```

Two notes apply to the schema.

**`description` does real work.** It guides the extraction toward the right region when a document has several date fields (issue date, birth date, expiry date) or several name fields (given name, surname, full name). The sample repository’s CMS-1500 schema goes as far as naming the box number on the form (`"The insured's ID number found in Box 1a."`). Being that specific measurably improves accuracy. If a form has numbered fields, put the numbers in.

**`enum` constrains a string; it isn’t a type of its own.** `document_type` above is `"type": "string"` with an `enum` array. The same applies to dates: there is no `"date"` type; it’s `"type": "string"` with `"format": "date"`.

Nested objects and arrays work as they do anywhere in JSON Schema, using `properties` and `items`. That matters for the response shape in the next step.

## Step 3: Parse the source-grounded response

The response separates the values from the evidence:

```json

{
  "status": 200,
  "requestId": "…",
  "configuration": {
    "apiVersion": "2026-05-25",
    "mode": "understand",
    "engine": { "requestedEngineVersion": "stable" }
  },
  "metrics": {
    "pagesProcessed": 1,
    "processingTimeMs": 18411
  },
  "output": {
    "data": { "…": "values, shaped exactly like your schema" },
    "metadata": { "…": "evidence, shaped exactly like your schema" },
    "pages": [{ "width": 1700, "height": 2200 }]
  }
}

```

`output.data` holds the values. `output.metadata` holds the evidence and mirrors the shape of the schema, which determines how you write the parser. A nested object in the schema produces nested metadata; an array produces a list of metadata nodes. It isn’t a flat list of fields.

Every leaf in `output.metadata` looks like this:

```json

{
  "bbox": { "x": 1030, "y": 302, "width": 127, "height": 22 },
  "confidence": 0.95,
  "confidenceComponents": {
    "groundingScore": 0.95,
    "source": "no-logprobs"
  },
  "match": "id_match",
  "pageIndex": 0,
  "pageNumber": 1,
  "source_bboxes": [
    {
      "bbox": { "x": 1029.7, "y": 302, "width": 127.6, "height": 22 },
      "block_id": "b87",
      "pageIndex": 0,
      "pageNumber": 1
    }
  ]
}

```

Note that `pageIndex` is zero-based and `pageNumber` is one-based. Both are provided so you don’t have to guess which convention a viewer expects. `bbox` is the region to highlight. `source_bboxes` lists the individual document blocks the value was assembled from, which is how a value can legitimately have more than one source region.

### The match field makes gating correct

Alongside the confidence score, each field reports _how_ it was found:

| `match`               | Meaning                                                |
| --------------------- | ------------------------------------------------------ |
| `id_match`            | Matched exactly, within a single block of the document |
| `id_match_multiblock` | Matched exactly, assembled across several blocks       |
| `id_match_partial`    | Part of the value matched                              |
| `fuzzy_match`         | Matched approximately                                  |
| `not_found`           | The field genuinely isn’t present in the document      |

A confidence of 0.96 on an exact match and 0.96 on a fuzzy match aren’t the same claim. For a document number used downstream as a unique identifier, an approximate match at high confidence is exactly the failure to prevent, and confidence alone won’t catch it.

### Walking both trees together

Because `metadata` mirrors the schema, the parser recurses. A leaf is any `dict` carrying a `match` key:

```python

from typing import Any, Iterator

def walk_fields(
    data: Any,
    metadata: Any,
    path: str = "",
) -> Iterator[tuple[str, Any, dict]]:
    """Yield (json_path, value, metadata_node) for every extracted leaf field.

    output.metadata mirrors the schema, so nested objects recurse and arrays
    produce one entry per element — e.g. "service_lines[0].procedure_code".
    """
    if isinstance(metadata, dict) and "match" in metadata:
        yield path, data, metadata

    elif isinstance(metadata, dict):
        for key, child_meta in metadata.items():
            child_value = data.get(key) if isinstance(data, dict) else None
            child_path = f"{path}.{key}" if path else key
            yield from walk_fields(child_value, child_meta, child_path)

    elif isinstance(metadata, list):
        for index, child_meta in enumerate(metadata):
            child_value = (
                data[index] if isinstance(data, list) and index < len(data) else None
            )
            yield from walk_fields(child_value, child_meta, f"{path}[{index}]")

def parse_kyc_result(response: dict) -> dict[str, dict]:
    """Return {json_path: {value, match, confidence, page, bbox}}."""
    output = response["output"]
    fields = {}
    for path, value, meta in walk_fields(output["data"], output["metadata"]):
        fields[path] = {
            "value": value,
            "match": meta.get("match"),
            "confidence": meta.get("confidence", 0.0),
            "page": meta.get("pageNumber"),
            "bbox": meta.get("bbox"),
            "source_bboxes": meta.get("source_bboxes", []),
        }
    return fields

```

For the flat know-your-customer (KYC) schema in Step 2, the paths are just field names. The same walker handles a schema with nested objects or repeating rows without modification, which is what you’ll need the moment the pipeline grows past identity documents.

## Step 4: A review queue gated on match type and confidence

This step is the compliance control in the pipeline. A high-accuracy API with no gating is still a liability: You’re silently accepting every read, and the rare misread causes a downstream problem that’s hard to trace.

```python

# Fields required on every document type. Type-specific requirements

# (`nationality` for passports, `issuing_country` for driver's licenses) are

# validated separately in Step 5, once `document_type` is known — a bare

# `not_found` on one of those here isn't escalated on its own.

REQUIRED_FIELDS = {"full_name", "date_of_birth", "document_number", "expiry_date"}

# Match types considered safe to accept without review, per field.

# Anything not listed uses `DEFAULT_ACCEPTABLE_MATCHES`. Start conservative

# and add entries here once you've seen how a field behaves on your own

# documents.

DEFAULT_ACCEPTABLE_MATCHES = {"id_match"}

ACCEPTABLE_MATCHES = {
    "full_name": {"id_match", "id_match_multiblock"},
    "document_type": {"id_match", "fuzzy_match"},
    "issuing_country": {"id_match", "fuzzy_match"},
}

DEFAULT_THRESHOLD = 0.90

# Per-field thresholds. Anything not listed uses `DEFAULT_THRESHOLD`.

THRESHOLDS = {
    "full_name": 0.92,
    "date_of_birth": 0.95,
    "document_number": 0.95,
    "expiry_date": 0.90,
    "document_type": 0.85,
}

def gate_fields(parsed: dict[str, dict]) -> dict:
    auto_approved: dict[str, Any] = {}
    needs_review: dict[str, dict] = {}

    for path, field in parsed.items():
        match = field["match"]
        confidence = field["confidence"]
        threshold = THRESHOLDS.get(path, DEFAULT_THRESHOLD)
        acceptable = ACCEPTABLE_MATCHES.get(path, DEFAULT_ACCEPTABLE_MATCHES)

        if match == "not_found" or field["value"] is None:
            if path in REQUIRED_FIELDS:
                needs_review[path] = {**field, "reason": "not_found"}
        elif match not in acceptable:
            needs_review[path] = {**field, "reason": f"match_{match}"}
        elif confidence < threshold:
            needs_review[path] = {**field, "reason": "low_confidence"}
        else:
            auto_approved[path] = field["value"]

    return {
        "status": "approved" if not needs_review else "review_required",
        "auto_approved": auto_approved,
        "review_queue": needs_review,
        "document_type": (
            auto_approved.get("document_type")
            or needs_review.get("document_type", {}).get("value")
        ),
    }

```

Three cases, three different reasons, and the reviewer sees which one applied. `not_found` on a required field is a different problem from a `fuzzy_match` at 0.97 — the first means the document is incomplete; the second means the read needs a human eye. Collapsing both into “low confidence” throws away the distinction.

The `bbox` and `page` data in `needs_review` is what makes the reviewer’s job tractable. Instead of asking a human to reread a whole passport scan, the review UI opens the document, jumps to `field["page"]`, and draws a highlight at `field["bbox"]`. The reviewer sees exactly the region in question and either confirms or corrects it.

## Step 5: Document-type validation

Different ID types have different required fields. Once `document_type` is known, type-specific validation can run before anything passes downstream:

```python

from datetime import date, datetime

def validate_by_document_type(parsed: dict[str, dict]) -> tuple[bool, list[str]]:
    doc_type = parsed.get("document_type", {}).get("value")
    errors: list[str] = []

    universal_required = [
        "full_name",
        "date_of_birth",
        "document_number",
        "expiry_date",
    ]
    for field in universal_required:
        if not parsed.get(field, {}).get("value"):
            errors.append(f"Missing required field: {field}")

    expiry = parsed.get("expiry_date", {}).get("value")
    if expiry:
        try:
            if datetime.fromisoformat(expiry).date() < date.today():
                errors.append(f"Document expired on {expiry}")
        except ValueError:
            errors.append(f"Could not parse expiry date: {expiry}")

    if doc_type == "passport" and not parsed.get("nationality", {}).get("value"):
        errors.append("Nationality required for passports")

    if doc_type == "driver_license" and not parsed.get("issuing_country", {}).get("value"):
        errors.append("Issuing state or country required for driver's licenses")

    return not errors, errors

```

## Step 6: Error handling and retry logic

Production KYC pipelines process high volumes and need to handle transient failures. The common failure modes are rate limiting (429), unprocessable documents (422 — usually a corrupted file or unsupported format), and timeouts on large scans.

```python

import time
from requests.exceptions import HTTPError, Timeout

class ExtractionError(Exception):
    pass

class DocumentUnprocessableError(ExtractionError):
    pass

def safe_extract(file_path: str, schema: dict, max_retries: int = 3) -> dict:
    for attempt in range(max_retries):
        try:
            return extract(file_path, schema)

        except HTTPError as e:
            status = e.response.status_code

            if status == 429:
                wait = 2**attempt  # 1s, 2s, 4s.

                print(f"Rate limited — waiting {wait}s before retry {attempt + 1}/{max_retries}")
                time.sleep(wait)

            elif status == 422:
                raise DocumentUnprocessableError(
                    f"Document could not be processed: {file_path}. "
                    f"Check that the file is a supported format and is not password-protected."
                ) from None

            elif status == 401:
                raise ExtractionError("Invalid API key — check your credentials") from None

            else:
                raise

        except Timeout:
            if attempt < max_retries - 1:
                print(f"Request timed out — retrying ({attempt + 1}/{max_retries})")
                time.sleep(1)
            else:
                raise ExtractionError("Extraction timed out after max retries") from None

    raise ExtractionError(f"Extraction failed after {max_retries} attempts")

```

Don’t retry a 422. If the API can’t process a document, retrying won’t help — the document needs human inspection. Surface these separately so an operations team can look at them.

Two things are worth logging on every call, both straight off the response body: `requestId`, which is what Support will ask for, and `metrics.pagesProcessed`, which is what gets billed.

## Putting it together

The full pipeline, with exactly one API call per document:

```python

def kyc_pipeline(file_path: str) -> dict:
    """Run a KYC document through extraction, gating, and validation.

    Returns:
        {
            "status": "approved" | "review_required" | "validation_failed" | "unprocessable",
            "auto_approved": {path: value,...},
            "review_queue": {path: {value, match, confidence, page, bbox, reason},...},
            "validation_errors": [...],   # only when `status == "validation_failed"`.

            "document_type": str | None,
            "request_id": str,
            "pages_processed": int,
        }
    """
    try:
        response = safe_extract(file_path, kyc_schema)
    except DocumentUnprocessableError as e:
        return {"status": "unprocessable", "error": str(e)}

    parsed = parse_kyc_result(response)
    result = gate_fields(parsed)

    if result["status"] == "approved":
        valid, errors = validate_by_document_type(parsed)
        if not valid:
            result["status"] = "validation_failed"
            result["validation_errors"] = errors

    result["request_id"] = response.get("requestId")
    result["pages_processed"] = response.get("metrics", {}).get("pagesProcessed")
    return result

result = kyc_pipeline("passport_sample.pdf")

if result["status"] == "approved":
    print("Auto-approved:", result["auto_approved"])
else:
    print(f"{result['status']} — {len(result.get('review_queue', {}))} field(s):")
    for path, field in result.get("review_queue", {}).items():
        print(
            f"  {path}: {field['value']!r} "
            f"(match: {field['match']}, confidence: {field['confidence']:.2f}, "
            f"reason: {field['reason']})"
        )

```

The document is extracted once. A pipeline that calls the extraction from both the gating function and the wrapper doubles latency and cost without changing the result, so it’s worth checking for in your own version.

## Choosing thresholds

A common question: Is a 0.94 confidence score good enough? It depends on the risk attached to the field, and on the match type it arrives with. Practical starting points:

| Field             | Threshold | Acceptable matches                | Notes                                                                      |
| ----------------- | --------- | --------------------------------- | -------------------------------------------------------------------------- |
| `full_name`       | 0.92      | `id_match`, `id_match_multiblock` | Names legitimately span blocks                                             |
| `date_of_birth`   | 0.95      | `id_match`                        | Misreads have compliance consequences                                      |
| `document_number` | 0.95      | `id_match`                        | Used as a unique identifier — must be exact                                |
| `expiry_date`     | 0.90      | `id_match`                        | Validated again in Step 5 anyway                                           |
| `document_type`   | 0.85      | `id_match`, `fuzzy_match`         | Constrained by `enum`, so a fuzzy match is still one of three known values |
| `issuing_country` | 0.90      | `id_match`, `fuzzy_match`         | Often abbreviated or in a second script                                    |

The pattern that matters: Fields used as identifiers take exact matches only, while fields constrained by an `enum` can tolerate a fuzzy match, because the `enum` bounds the damage. A fuzzy match on a document number can be any string. A fuzzy match on `document_type` is still one of `passport`, `driver_license`, or `national_id`.

A reasonable rollout is to leave every field on `DEFAULT_ACCEPTABLE_MATCHES = {"id_match"}`, log what lands in review for two weeks, and add entries to `ACCEPTABLE_MATCHES` per field once you can see how they behave on your own document mix.

## Two-sided documents

Driver’s licenses in many jurisdictions carry data on both sides. If the upload flow accepts images, collect both sides as separate files and extract each independently, merging the parsed results before gating. Note that this is two API calls, so it bills as two documents — worth knowing before it shows up on an invoice.

```python

def kyc_pipeline_two_sided(front_path: str, back_path: str) -> dict:
    merged: dict[str, dict] = {}
    for path in (front_path, back_path):
        response = safe_extract(path, kyc_schema)
        for field_path, field in parse_kyc_result(response).items():
            existing = merged.get(field_path)
            # Keep whichever side produced the better-grounded read. Confidence

            # only breaks a tie within the same match type — a higher-confidence

            # `fuzzy_match` must never outrank an `id_match`.

            if (
                existing is None
                or (field["match"] == "id_match" and existing["match"]!= "id_match")
                or (
                    field["match"] == existing["match"]
                    and field["confidence"] > existing["confidence"]
                )
            ):
                merged[field_path] = field
    return gate_fields(merged)

```

## A note on document storage

Identity documents are sensitive, and the API’s storage behavior is documented rather than implied. Processing runs — both the input document and the extracted output — are stored as a product feature so run history can be viewed and managed. Runs can be deleted, and they expire automatically after a retention period that depends on the plan.

Whether anything is kept beyond that depends on the plan. Data retention is set per subscription plan, not per request, so nothing in the code above changes it. On plans where retention is enabled, a copy is also kept internally and used to operate, improve, and develop the service, including to train and evaluate models; that copy is separate from run history and isn’t removed by deleting a run. On plans where retention isn’t enabled, documents aren’t retained for those purposes.

For identity documents, the policy is explicit. The [API privacy policy](https://www.nutrient.io/legal/privacy/#nutrient-api) states that Nutrient doesn’t seek special-category or sensitive personal data, naming government-identification data specifically, for retention or training, and that such data shouldn’t be submitted for those purposes.

Taken together, those two points mean a KYC pipeline belongs on a plan without data retention. Confirm the account’s configuration before the first real customer document. The [privacy](https://www.nutrient.io/guides/dws-data-extraction/privacy.md) guide and the [API privacy policy](https://www.nutrient.io/legal/privacy/#nutrient-api) are authoritative.

If a document has already gone through on the wrong plan, deletion is available: The policy commits to removing a file from storage, backups, and any training dataset on request to `legal@nutrient.io`.

Logging `requestId` on every call is worth doing regardless: It ties an onboarding decision back to a specific extraction run without storing the document a second time.

## Schema keyword limits

The API accepts only these JSON Schema keywords: `type` (one of `object`, `array`, `string`, `number`, `integer`, `boolean`), `properties`, `required`, `items`, `description`, `enum` on string fields, and `format: "date"` on string fields.

Everything else is rejected — `$ref`, `$defs`, `allOf`/`anyOf`/`oneOf`, validation ranges such as `minimum` and `maxLength`, conditional schemas, and any `format` value other than `date`. Schemas are also closed: The response contains only declared properties, as though `additionalProperties: false` were set, and sending `additionalProperties` explicitly causes a rejection.

The practical consequence is that format rules live in the validator, not the schema. A passport number can’t be constrained by `pattern` in the schema; it gets checked in Python after extraction.

Full details are in the guide on [defining a schema](https://www.nutrient.io/guides/dws-data-extraction/extract/define-a-schema.md).

## What’s next

- **Try it now** — The [KYC extraction API page](https://www.nutrient.io/api/data-extraction-api/kyc/) has a live Studio demo for testing your own documents in a browser before writing code

- **Runnable samples** — The [nutrient-extraction-samples](https://github.com/PSPDFKit/nutrient-extraction-samples) repository has self-contained Python demos, including the `common/api.py` transport this tutorial’s request code follows, as well as cached live responses you can inspect without paying for new requests

- **Accuracy benchmarks** — [WholeDoc Bench](https://www.nutrient.io/benchmarks/parse/), Nutrient’s own benchmark of 480 documents with human-approved answer keys, updated each season

- **Other document types** — The same API and the same pipeline handle the rest of an onboarding document stack, such as utility bills, bank statements, and income verification. See the [Data Extraction API overview](https://www.nutrient.io/api/data-extraction-api/)

## Related reading

- [What should a document extraction confidence score actually tell you?](https://www.nutrient.io/blog/document-extraction-confidence-scores.md) — Why a source-grounded score behaves differently from a model-decisiveness score

- [PDF data extraction developer guide](https://www.nutrient.io/blog/pdf-data-extraction-developer-guide.md) — Parse modes, schema design, and how citations fit the wider pipeline

- [Citations and confidence](https://www.nutrient.io/guides/dws-data-extraction/extract/citations-and-confidence.md) — The full citation object, match labels, and coordinate space
---

## Related pages

- [The business case for accessibility: Five ways it drives enterprise value](/blog/5-ways-accessibility-drives-enterprise-value.md)
- [Accessibility Untangled Why It Matters Guide](/blog/accessibility-untangled-why-it-matters-guide.md)
- [Adobe Pdf Embed Api Alternatives](/blog/adobe-pdf-embed-api-alternatives.md)
- [Adobe Pdf Services Api Alternatives](/blog/adobe-pdf-services-api-alternatives.md)
- [Advanced Techniques For React Native Ui Components](/blog/advanced-techniques-for-react-native-ui-components.md)
- [`vector_store` holds your indexed documents (see the multimodal RAG post](/blog/agentic-rag.md)
- [Ai Assistant Agent Governance](/blog/ai-assistant-agent-governance.md)
- [How to build an AI agent for contract redlining against a compliance playbook](/blog/ai-contract-redlining-compliance-playbook.md)
- [Ai Document Automation Extraction To Action](/blog/ai-document-automation-extraction-to-action.md)
- [Ai Document Workflows Ocr Compliance Heavy Teams](/blog/ai-document-workflows-ocr-compliance-heavy-teams.md)
- [Ai Legal Assistant Document Authoring](/blog/ai-legal-assistant-document-authoring.md)
- [Ai Schema Generator Document Extraction](/blog/ai-schema-generator-document-extraction.md)
- [Amazon Textract Alternatives](/blog/amazon-textract-alternatives.md)
- [Start (clears any prior buffer), navigate the document, then stop into a file.](/blog/android-faster-pdf-rendering.md)
- [Android Pdf Out Of Memory Handling](/blog/android-pdf-out-of-memory-handling.md)
- [Angular File Viewer Pdf Image Office Files](/blog/angular-file-viewer-pdf-image-office-files.md)
- [Approval Workflow Software](/blog/approval-workflow-software.md)
- [Approvals Matrix](/blog/approvals-matrix.md)
- [Apryse To Nutrient Migration](/blog/apryse-to-nutrient-migration.md)
- [Auto Tagging And Document Accessibility In Dotnet Sdk](/blog/auto-tagging-and-document-accessibility-in-dotnet-sdk.md)
- [Simple PII redaction.](/blog/automated-pii-removal.md)
- [Automation Platform](/blog/automation-platform.md)
- [Azure Document Intelligence Alternatives](/blog/azure-document-intelligence-alternatives.md)
- [schema.py.](/blog/bank-statement-to-excel.md)
- [Barcode Ocr](/blog/barcode-ocr.md)
- [Best Ai Document Workflow Platforms](/blog/best-ai-document-workflow-platforms.md)
- [Best Csharp Pdf Library](/blog/best-csharp-pdf-library.md)
- [Best Document Ai Platforms](/blog/best-document-ai-platforms.md)
- [Best Document Classification Platforms](/blog/best-document-classification-platforms.md)
- [Best document parser for RAG: LlamaParse vs. Unstructured vs. Reducto vs. Nutrient](/blog/best-document-parser-llamaparse-unstructured-reducto.md)
- [Best Document Parsing Apis](/blog/best-document-parsing-apis.md)
- [Best Document Viewers](/blog/best-document-viewers.md)
- [Best Healthcare Workflow Software Compared](/blog/best-healthcare-workflow-software-compared.md)
- [Best Invoice Data Extraction Apis](/blog/best-invoice-data-extraction-apis.md)
- [Best Llm Document Understanding Platforms](/blog/best-llm-document-understanding-platforms.md)
- [Best Multilingual Ocr Software](/blog/best-multilingual-ocr-software.md)
- [Best Pdf Accessibility Apis](/blog/best-pdf-accessibility-apis.md)
- [Best Pdf Parsers For Rag](/blog/best-pdf-parsers-for-rag.md)
- [Best Pdf Processing Apis](/blog/best-pdf-processing-apis.md)
- [Best Pdf Viewer Apis](/blog/best-pdf-viewer-apis.md)
- [Best Salesforce Document Generation Apps](/blog/best-salesforce-document-generation-apps.md)
- [Best Secure Document Collaboration Platforms](/blog/best-secure-document-collaboration-platforms.md)
- [or](/blog/best-vue-pdf-viewers.md)
- [Bpm Guide](/blog/bpm-guide.md)
- [Bpm Tools](/blog/bpm-tools.md)
- [Build Vs Buy Document Extraction](/blog/build-vs-buy-document-extraction.md)
- [Business Automation](/blog/business-automation.md)
- [Business Process Reengineering Bpr Definition](/blog/business-process-reengineering-bpr-definition.md)
- [Capex Vs Opex](/blog/capex-vs-opex.md)
- [Capital Expenditure Request Form](/blog/capital-expenditure-request-form.md)
- [The CEO’s AI playbook: Why decision architecture beats model selection](/blog/ceo-ai-playbook-decision-architecture.md)
- [1. Extract and chunk the PDF.](/blog/chat-with-pdf.md)
- [Complete Guide To Pdfjs](/blog/complete-guide-to-pdfjs.md)
- [Construction Document Data Extraction](/blog/construction-document-data-extraction.md)
- [Convert One Drive Files To Pdf In Sharepoint](/blog/convert-one-drive-files-to-pdf-in-sharepoint.md)
- [Create And Edit Pdfs In Flutter](/blog/create-and-edit-pdfs-in-flutter.md)
- [Create Pdfs With React](/blog/create-pdfs-with-react.md)
- [Creating A Document Scanner With Ocr In Python](/blog/creating-a-document-scanner-with-ocr-in-python.md)
- [Creating And Filling Pdf Forms Programmatically In Javascript](/blog/creating-and-filling-pdf-forms-programmatically-in-javascript.md)
- [The CTO’s AI playbook: Why accountability architecture beats orchestration](/blog/cto-ai-playbook-accountability-architecture.md)
- [Nutrient document decision: Why we built a decision model for documents](/blog/decision-model-for-documents.md)
- [Digital Signatures](/blog/digital-signatures.md)
- [Digital Workflow Automation](/blog/digital-workflow-automation.md)
- [Docling Alternatives](/blog/docling-alternatives.md)
- [Document Ai Vs Ocr](/blog/document-ai-vs-ocr.md)
- [Document Authoring Audit Trail](/blog/document-authoring-audit-trail.md)
- [Document Authoring Spreadsheet Editor](/blog/document-authoring-spreadsheet-editor.md)
- [Document Extraction Confidence Scores](/blog/document-extraction-confidence-scores.md)
- [Document Extraction For Underwriting](/blog/document-extraction-for-underwriting.md)
- [Document Viewer](/blog/document-viewer.md)
- [Document Watermarking](/blog/document-watermarking.md)
- [Debian/Ubuntu.](/blog/easyocr-vs-tesseract-python.md)
- [Electronic signature API: How to sign PDFs programmatically](/blog/electronic-signature-api.md)
- [Emerging threats: Your logging system may be an agentic threat vector](/blog/emerging-threats-your-logging-system.md)
- [Q3 sales](/blog/excel-to-markdown-for-llms.md)
- [Extend Alternatives](/blog/extend-alternatives.md)
- [Extract Patient Data On Premises](/blog/extract-patient-data-on-premises.md)
- [Extract Tables From Complex Pdfs](/blog/extract-tables-from-complex-pdfs.md)
- [Create and activate a virtual environment (recommended).](/blog/extract-text-from-pdf-pymupdf.md)
- [app.py](/blog/extract-text-from-pdf-using-python.md)
- [Stricter thresholds for fields that move money. Calibrate on your own sample.](/blog/extraction-hallucination-detection.md)
- [Fillable Pdf](/blog/fillable-pdf.md)
- [Google Document Ai Alternatives](/blog/google-document-ai-alternatives.md)
- [Handwriting Recognition Ocr Vlm](/blog/handwriting-recognition-ocr-vlm.md)
- [How To Add Digital Signature To Pdf Using React](/blog/how-to-add-digital-signature-to-pdf-using-react.md)
- [How To Build A Dotnet Maui Pdf Viewer](/blog/how-to-build-a-dotnet-maui-pdf-viewer.md)
- [How To Build A Flutter Pdf Viewer](/blog/how-to-build-a-flutter-pdf-viewer.md)
- [or](/blog/how-to-build-a-javascript-pdf-viewer-with-pdfjs.md)
- [or](/blog/how-to-build-a-javascript-pdf-viewer.md)
- [How To Build A Nextjs Pdf Viewer](/blog/how-to-build-a-nextjs-pdf-viewer.md)
- [How To Build A Powerpoint Viewer Using Javascript](/blog/how-to-build-a-powerpoint-viewer-using-javascript.md)
- [Using Yarn](/blog/how-to-build-a-react-excel-viewer.md)
- [How To Build A React Native Pdf Viewer](/blog/how-to-build-a-react-native-pdf-viewer.md)
- [How To Build A React Powerpoint Viewer](/blog/how-to-build-a-react-powerpoint-viewer.md)
- [Using Yarn](/blog/how-to-build-a-react-word-viewer.md)
- [How To Build A Reactjs File Viewer](/blog/how-to-build-a-reactjs-file-viewer.md)
- [How To Build A Reactjs Pdf Viewer With React Pdf](/blog/how-to-build-a-reactjs-pdf-viewer-with-react-pdf.md)
- [or](/blog/how-to-build-a-reactjs-pdf-viewer.md)
- [How To Build A Reactjs Viewer With Pdfjs](/blog/how-to-build-a-reactjs-viewer-with-pdfjs.md)
- [How To Build A Vuejs Pdf Viewer With Pdfjs](/blog/how-to-build-a-vuejs-pdf-viewer-with-pdfjs.md)
- [How To Build A Vuejs Pdf Viewer](/blog/how-to-build-a-vuejs-pdf-viewer.md)
- [How To Build An Android Pdf Viewer](/blog/how-to-build-an-android-pdf-viewer.md)
- [How To Build An Angular Pdf Viewer With Ng2 Pdf Viewer](/blog/how-to-build-an-angular-pdf-viewer-with-ng2-pdf-viewer.md)
- [How To Build An Angular Pdf Viewer With Pdfjs](/blog/how-to-build-an-angular-pdf-viewer-with-pdfjs.md)
- [How To Convert Docx To Pdf Using Javascript](/blog/how-to-convert-docx-to-pdf-using-javascript.md)
- [How To Convert Docx To Pdf Using Python](/blog/how-to-convert-docx-to-pdf-using-python.md)
- [How To Convert Html To Pdf Using Html2pdf](/blog/how-to-convert-html-to-pdf-using-html2pdf.md)
- [How To Convert Html To Pdf Using React](/blog/how-to-convert-html-to-pdf-using-react.md)
- [How To Convert Html To Pdf Using Wkhtmltopdf And Csharp](/blog/how-to-convert-html-to-pdf-using-wkhtmltopdf-and-csharp.md)
- [or](/blog/how-to-convert-html-to-pdf-using-wkhtmltopdf-and-python.md)
- [How To Convert Html To Pptx](/blog/how-to-convert-html-to-pptx.md)
- [How To Convert Pdf To Json](/blog/how-to-convert-pdf-to-json.md)
- [Quarterly report](/blog/how-to-convert-pdf-to-markdown-using-python.md)
- [How To Convert Word To Pdf In Nodejs](/blog/how-to-convert-word-to-pdf-in-nodejs.md)
- [How To Convert Word To Pdf Using Javascript](/blog/how-to-convert-word-to-pdf-using-javascript.md)
- [or](/blog/how-to-create-a-react-js-signature-pad.md)
- [How To Create Pdfs With React To Pdf](/blog/how-to-create-pdfs-with-react-to-pdf.md)
- [How to digitally sign PDFs in C# with Nutrient .NET SDK](/blog/how-to-digitally-sign-pdf-in-csharp.md)
- [How To Edit Pdfs Using Ios Pdf Library](/blog/how-to-edit-pdfs-using-ios-pdf-library.md)
- [How To Embed A Pdf Viewer In Your Website](/blog/how-to-embed-a-pdf-viewer-in-your-website.md)
- [How To Extract Tables From Pdf And Images](/blog/how-to-extract-tables-from-pdf-and-images.md)
- [How To Generate A Pdf With Vuejs](/blog/how-to-generate-a-pdf-with-vuejs.md)
- [How To Generate Pdf From Html With Nodejs](/blog/how-to-generate-pdf-from-html-with-nodejs.md)
- [How to generate PDFs in C# with Nutrient .NET SDK](/blog/how-to-generate-pdf-in-csharp.md)
- [base_url tells WeasyPrint where to resolve relative asset paths](/blog/how-to-generate-pdf-reports-from-html-in-python.md)
- [How To Merge Pdfs Using Javascript](/blog/how-to-merge-pdfs-using-javascript.md)
- [How To Ocr Pdf Api](/blog/how-to-ocr-pdf-api.md)
- [How To Ocr Pdfs In Linux](/blog/how-to-ocr-pdfs-in-linux.md)
- [How To Print Pdf In Csharp](/blog/how-to-print-pdf-in-csharp.md)
- [How To Programmatically Create And Fill Pdf Form In Angular](/blog/how-to-programmatically-create-and-fill-pdf-form-in-angular.md)
- [C# barcode scanner: How to scan and read 1D barcodes and QR codes](/blog/how-to-scan-barcodes-in-csharp.md)
- [Open an image.](/blog/how-to-use-tesseract-ocr-in-python.md)
- [From an HTML string.](/blog/html-in-pdf-format.md)
- [Html To Pdf In Javascript](/blog/html-to-pdf-in-javascript.md)
- [Ide Text Editors Cpp Large Scale](/blog/ide-text-editors-cpp-large-scale.md)
- [Numeric and identifier fields: exact single-block matches only.](/blog/insurance-document-extraction.md)
- [Intelligent Data Extraction](/blog/intelligent-data-extraction.md)
- [Introducing Nutrient Data Extraction API: Turn complex documents into structured, reliable data for AI](/blog/introducing-nutrient-data-extraction-api.md)
- [Invoice Approval Software](/blog/invoice-approval-software.md)
- [Invoice Data Extraction Python](/blog/invoice-data-extraction-python.md)
- [Javascript Document Editor](/blog/javascript-document-editor.md)
- [Javascript Pdf Editors](/blog/javascript-pdf-editors.md)
- [Javascript Pdf Libraries](/blog/javascript-pdf-libraries.md)
- [Keep Document Ai Private](/blog/keep-document-ai-private.md)
- [Kyc Onboarding Salesforce](/blog/kyc-onboarding-salesforce.md)
- [Landing Ai Alternatives](/blog/landing-ai-alternatives.md)
- [Langextract Vs Llamaindex Extraction Comparison](/blog/langextract-vs-llamaindex-extraction-comparison.md)
- [Linearized Pdf](/blog/linearized-pdf.md)
- [Uses OpenAI by default — set OPENAI_API_KEY.](/blog/llamaindex-vs-langchain-rag.md)
- [Llamaindex Vs Langchain Vs Haystack](/blog/llamaindex-vs-langchain-vs-haystack.md)
- [Llamaindex Workflows Vs Langgraph](/blog/llamaindex-workflows-vs-langgraph.md)
- [Llamaparse Alternatives](/blog/llamaparse-alternatives.md)
- [Llm Vs Document Parsing Api](/blog/llm-vs-document-parsing-api.md)
- [Low Code No Code Document Integrations](/blog/low-code-no-code-document-integrations.md)
- [One segment per document found, in page order:](/blog/mailroom-automation-api.md)
- [Material Requisition](/blog/material-requisition.md)
- [ICD-10-CM: letter, digit, then digit OR letter (C4A, D3A, M1A are all valid),](/blog/medical-record-extraction.md)
- [or](/blog/merge-pdfs.md)
- [Migrating Observability Hyperdx To Dash0](/blog/migrating-observability-hyperdx-to-dash0.md)
- [Swift Package Manager](/blog/mobile-pdf-sdk.md)
- [Numeric and identifier fields: exact single-block matches only.](/blog/mortgage-document-processing.md)
- [`elements` come from your document parser — each has a type and content.](/blog/multimodal-rag.md)
- [Multipage Extraction Page Boundaries](/blog/multipage-extraction-page-boundaries.md)
- [Nutrient Flutter 6 Bindings Api](/blog/nutrient-flutter-6-bindings-api.md)
- [Nutrient Flutter Bindings Architecture](/blog/nutrient-flutter-bindings-architecture.md)
- [Nutrient Vs Conga Composer](/blog/nutrient-vs-conga-composer.md)
- [Ocr Api Comparison](/blog/ocr-api-comparison.md)
- [Online Document Viewer](/blog/online-document-viewer.md)
- [Open Pdf In Your Web App](/blog/open-pdf-in-your-web-app.md)
- [Operations Management Software](/blog/operations-management-software.md)
- [Optical Character Recognition In Scanned Pdfs](/blog/optical-character-recognition-in-scanned-pdfs.md)
- [CPU](/blog/paddleocr-python-guide.md)
- [Pdf Accessibility Checker](/blog/pdf-accessibility-checker.md)
- [PDF accessibility for developers: Meeting WCAG 2.2, Section 508, and PDF/UA with an SDK](/blog/pdf-accessibility.md)
- [Extract data from PDF files: A developer guide to structured data from PDFs and scans](/blog/pdf-data-extraction-developer-guide.md)
- [Pdf Extraction Benchmark Opendataloader Bench](/blog/pdf-extraction-benchmark-opendataloader-bench.md)
- [Pdf Extraction Document Case Studies](/blog/pdf-extraction-document-case-studies.md)
- [Pdf Page Labels](/blog/pdf-page-labels.md)
- [Pdf Remediation](/blog/pdf-remediation.md)
- [Pdf Sdk Compliance Security Checklist](/blog/pdf-sdk-compliance-security-checklist.md)
- [Pdf Sdk Performance Benchmark](/blog/pdf-sdk-performance-benchmark.md)
- [Pdf Text Extraction](/blog/pdf-text-extraction.md)
- [Pdf Ua Compliance Guide](/blog/pdf-ua-compliance-guide.md)
- [Pdf Ua Validation](/blog/pdf-ua-validation.md)
- [Pdfjs Accessibility Structtree Printing](/blog/pdfjs-accessibility-structtree-printing.md)
- [Pdfjs Advanced Loading Streaming Workers](/blog/pdfjs-advanced-loading-streaming-workers.md)
- [Pdfjs Annotation Editor Layer](/blog/pdfjs-annotation-editor-layer.md)
- [Pdfjs Area Annotations Canvas Capture](/blog/pdfjs-area-annotations-canvas-capture.md)
- [Pdfjs Coordinate Systems Pdf To Screen](/blog/pdfjs-coordinate-systems-pdf-to-screen.md)
- [Pdfjs Document Outline Bookmarks Metadata](/blog/pdfjs-document-outline-bookmarks-metadata.md)
- [Pdfjs Eventbus Guide](/blog/pdfjs-eventbus-guide.md)
- [macOS](/blog/pdfjs-file-format-conversion-to-pdf.md)
- [macOS](/blog/pdfjs-generating-pdf-thumbnails-pdf2pic.md)
- [Pdfjs Limitations Commercial Upgrade](/blog/pdfjs-limitations-commercial-upgrade.md)
- [Pdfjs Native Annotation Layer Forms](/blog/pdfjs-native-annotation-layer-forms.md)
- [Pdfjs Navigation Zoom Rotation](/blog/pdfjs-navigation-zoom-rotation.md)
- [Pdfjs Pdf Page Manipulation Pdf Lib](/blog/pdfjs-pdf-page-manipulation-pdf-lib.md)
- [Pdfjs React Viewer Setup](/blog/pdfjs-react-viewer-setup.md)
- [Pdfjs Rendering Overlays React Portals](/blog/pdfjs-rendering-overlays-react-portals.md)
- [Pdfjs Server Side Text Extraction](/blog/pdfjs-server-side-text-extraction.md)
- [Pdfjs Sticky Note Annotations](/blog/pdfjs-sticky-note-annotations.md)
- [Pdfjs Text Highlight Annotations](/blog/pdfjs-text-highlight-annotations.md)
- [Pdfjs Text Search Pdffindcontroller](/blog/pdfjs-text-search-pdffindcontroller.md)
- [Pdfjs Thumbnail Sidebar](/blog/pdfjs-thumbnail-sidebar.md)
- [Pdfplumber Python Guide](/blog/pdfplumber-python-guide.md)
- [People Process Tools](/blog/people-process-tools.md)
- [Process Flows](/blog/process-flows.md)
- [React Docx Editor](/blog/react-docx-editor.md)
- [React Native Pdf Annotation](/blog/react-native-pdf-annotation.md)
- [React Pdf Annotation Layer Forms](/blog/react-pdf-annotation-layer-forms.md)
- [React Pdf Custom Rendering Hooks](/blog/react-pdf-custom-rendering-hooks.md)
- [Using Yarn.](/blog/react-pdf-editor.md)
- [React Pdf Loading States Errors Passwords](/blog/react-pdf-loading-states-errors-passwords.md)
- [React Pdf Non Latin Fonts Special Pdfs](/blog/react-pdf-non-latin-fonts-special-pdfs.md)
- [React Pdf Outline Table Of Contents](/blog/react-pdf-outline-table-of-contents.md)
- [React Pdf Performance Optimization](/blog/react-pdf-performance-optimization.md)
- [React Pdf Setup Basic Rendering](/blog/react-pdf-setup-basic-rendering.md)
- [React Pdf Text Layer Custom Renderer](/blog/react-pdf-text-layer-custom-renderer.md)
- [React Pdf Thumbnails Page Navigation](/blog/react-pdf-thumbnails-page-navigation.md)
- [Reducto Alternatives](/blog/reducto-alternatives.md)
- [Requisition System](/blog/requisition-system.md)
- [labels.py](/blog/route-documents-automatically-classify-api.md)
- [or](/blog/sample-blog-updated.md)
- [Sdk Product Updates Q2 2026](/blog/sdk-product-updates-q2-2026.md)
- [System Of Record Vs Source Of Truth](/blog/system-of-record-vs-source-of-truth.md)
- [Add DWS MCP Server to your Claude Code project.](/blog/teaching-llms-to-read-pdfs.md)
- [Open an image file.](/blog/tesseract-python-guide.md)
- [The Six Best Pdf Generator Apis](/blog/the-six-best-pdf-generator-apis.md)
- [Define the HTML part of the document.](/blog/top-10-ways-to-generate-pdfs-in-python.md)
- [Top 5 Javascript Pdf Viewers](/blog/top-5-javascript-pdf-viewers.md)
- [Top Js Pdf Libraries](/blog/top-js-pdf-libraries.md)
- [Top Ten Ways To Convert Html To Pdf](/blog/top-ten-ways-to-convert-html-to-pdf.md)
- [Unstructured Alternatives](/blog/unstructured-alternatives.md)
- [Using Javascript In Pdf Form Fields](/blog/using-javascript-in-pdf-form-fields.md)
- [Vector Pdf](/blog/vector-pdf.md)
- [Wcag2 Accessibility Requirements Documents](/blog/wcag2-accessibility-requirements-documents.md)
- [Web Pdf Sdk Legal Review](/blog/web-pdf-sdk-legal-review.md)
- [Web Sdk Is Now Headless](/blog/web-sdk-is-now-headless.md)
- [What Are Annotations](/blog/what-are-annotations.md)
- [What Is A Tagged Pdf](/blog/what-is-a-tagged-pdf.md)
- [What Is A Vpat](/blog/what-is-a-vpat.md)
- [What Is Bpms](/blog/what-is-bpms.md)
- [What Is Business Logic](/blog/what-is-business-logic.md)
- [What Is Document Processing](/blog/what-is-document-processing.md)
- [What Is Intelligent Document Processing](/blog/what-is-intelligent-document-processing.md)
- [What Is Ocr Invoice Processing](/blog/what-is-ocr-invoice-processing.md)
- [What Is Pdf Ua](/blog/what-is-pdf-ua.md)
- [Introducing WholeDoc Bench: A benchmark for parsing whole documents](/blog/wholedoc-bench-parsing-benchmark.md)
- [Why Pdfium Is A Trusted Platform For Pdf Rendering](/blog/why-pdfium-is-a-trusted-platform-for-pdf-rendering.md)
- [Why Your Ai Agent Hallucinates Pdf Table Data](/blog/why-your-ai-agent-hallucinates-pdf-table-data.md)
- [Workflow Analysis](/blog/workflow-analysis.md)

