Skip to main content

Overview

The Data Extraction API allows you to extract structured information from your documents using standard JSON Schema and natural language instructions. The extraction uses the active parsing version of the specified document.

Endpoint

Authentication

Include your API token in the Authorization header:

Request

Headers

Body Parameters

*At least one of file_ids or file_names must be provided. file_ids is preferred.

Output Schema

The output_schema parameter accepts a standard JSON Schema object. This is the same format used by the Chat API for structured outputs.

Thinking Level

The thinking_level parameter controls the model and thinking configuration used for extraction:

Example Request (using file_ids)

Example Request (using file_names - deprecated)

Example Request with Thinking Level

Example Request with Nested Objects and Arrays

Response

Success Response (200 OK)

Example Response

Response with Object and Array Types

When using object and array types in your schema:

Contract Analysis

Resume Parsing

Product Catalog

Usage Examples

Python

Python with Nested Objects and Arrays

JavaScript

JavaScript with Nested Objects and Arrays

Best Practices

  1. Use standard JSON Schema — The API accepts any valid JSON Schema, giving you full flexibility
  2. Be specific in descriptions — Detailed property descriptions improve extraction accuracy
  3. Use appropriate types — Match property types to expected data (number for amounts, string for dates)
  4. Provide clear instructions — Guide the extraction with format preferences and edge cases
  5. Use objects for structured data — Group related fields using nested objects (e.g., address with street, city, zip)
  6. Use arrays for lists — Extract repeating items using arrays with appropriate item schemas
  7. Keep nesting shallow — Avoid deeply nested structures for better extraction accuracy
  8. Define required fields — Use the required array to specify mandatory properties
  9. Use raw_json for debugging — The raw_json field contains the model’s raw output before validation

Data Extraction Guide

Learn schema design and extraction best practices

Data Ingestion

Improve parsing quality for better extraction results