Skip to main content

Overview

The Extract endpoint combines document parsing with schema-based data extraction. Define a JSON schema describing the data you need, and Aifano extracts it from any document. Credits: 2 credits per page

Basic Usage

Response

Schema Design Tips

Property names guide the extraction model. invoice_number works better than id.
Line items, table rows, and lists should use array type with items schema.

Custom System Prompt

Guide the extraction model with a custom system prompt:

Reusing Parsed Results

If you’ve already parsed a document, pass the job_id to skip re-parsing:
This saves credits by reusing the parse result (you only pay extraction credits, not parse credits).

Parsing Options

Control how the document is parsed before extraction:
See Parse for all available parsing options.