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
runJob method returns a job_id that you can use with client.job.get() to retrieve results.
Schema Definition
Theinstructions parameter requires a schema field with a JSON schema:
Array Extraction
For documents with repeating data (line items, transactions), enable array extraction:Citations
Enable citations to get source locations for each extracted value:Complete Example
Next Steps
- Learn about schema design best practices
- Explore array extraction for long documents
- Check out citations for source verification