Skip to content

The platform

Extract

Pull the fields you need out of a parsed document, shaped by your own JSON schema.

An extract job reads a completed parse job and returns JSON shaped by a schema you define: the invoice number, the total, the line items. Parse the document first, then extract from it.

The schema is a JSON Schema object. In Python, ExtractionSchema builds it from a class: see the Python SDK.

curl -X POST "https://byteit.ai/v1/jobs/extract-jobs/" \
-H "X-API-Key: $BYTEIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"parse_job_id": "3f9a1c2e-5b7d-4e8f-9a0b-1c2d3e4f5a6b",
"schema": {
"type": "object",
"properties": {
"invoice_number": {
"type": "string",
"description": "Invoice number"
},
"total": {
"type": "string",
"description": "Total amount due"
}
}
},
"extraction_complexity": "medium"
}'

Give every field a description: it tells the extraction what the field means.

extraction_complexity sets the tier of the extraction: low, medium (the default) or high.

When the job is completed, download its result: a JSON document with the fields of your schema.

{ "number": "HF-0418", "total": "4280.00" }

Save a schema once under a name and reuse it across jobs and in Studio: POST /v1/schemas/ with a name and the schema_json. See Schemas in the API reference.