- Define a small extraction schema.
- Send an extraction request with Python.
- 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
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.- The property name becomes the output field name.
typedefines the expected value type.descriptionhelps 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 inresult["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
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.

