Skip to main content
Extract returns selected fields from a document as structured JSON that matches your schema. In this quickstart, you will:
  1. Define a small extraction schema.
  2. Send an extraction request with Python.
  3. Read the structured JSON returned by Extract.

Before you start

You need:
  • TextIn API credentials. See Authentication.
  • Python 3.8 or later.
  • A document that contains the fields you want to extract.
For supported formats, file size limits, page limits, and concurrency limits, see Supported Files & Limits.

Install dependencies

Set your credentials

On Windows PowerShell:

Define the fields to extract

Create a schema that describes the fields you need. The examples in this page use the schema JSON format accepted by Extract.
In a schema:
  • The property name becomes the output field name.
  • type defines the expected value type.
  • description helps the extraction model identify the correct value in the document.
See Schema Guide for field types, nested objects, arrays, and schema limits.

Send an extraction request

Read the extracted data

Extract returns structured JSON in result["extracted_schema"]:
In current Extract responses, missing string fields will be returned as empty strings, and missing array fields may be returned as empty arrays.

Use cURL

For a lightweight cURL example, use a hosted file URL:

Get source citations

Enable citations when you need to show where an extracted value came from. Citations can include:
  • Page number
  • Source text
  • Bounding box coordinates
When enabled, citations are returned in result["citations"]. See Response Format for the citation structure.

Improve extraction quality

  • Use field names that match the wording in the source document.
  • Add clear field descriptions.
  • Use enums when the possible values are known.
  • Keep schemas as simple as possible.
  • Avoid asking the schema to calculate values that can be computed downstream.
See Best Practices for more guidance.

Next steps

Schema Guide

Create and export extraction schemas.

Response Format

Understand extracted data, citations, page-level fields, and usage fields.

Best Practices

Improve schema quality and extraction accuracy.