Skip to main content
The extract.run() method pulls specific fields from documents as structured JSON. You define a JSON schema with the fields you need, and Extract returns values matching that schema.

Basic Usage


Method Signatures

Synchronous Extract

Asynchronous Extract

The runJob method returns a job_id that you can use with client.job.retrieve() to retrieve results.

Schema Definition

The instructions parameter requires a schema field with a JSON schema:

Deep Extract

For documents with repeating data (line items, transactions) or complex/long extractions, enable Deep Extract (higher cost and latency). It supersedes the deprecated array_extract:

Citations

Enable citations to get source locations for each extracted value:

Complete Example


Next Steps