Skip to main content
When you extract structured data with the API, the extracted data and metadata are returned in a structured JSON format.

Response Structure

The response contains the following top-level fields:
  • extraction: The extracted key-value pairs as defined by your schema.
  • extraction_metadata: Metadata showing which chunks were referenced for each extracted field.
  • metadata: Processing information including credit usage, duration, filename, job ID, version, schema validation errors, and warnings.

Extracted Data (extraction)

The extraction field contains the structured data extracted from your document, formatted according to your JSON schema. The structure matches your input schema exactly. For a simple schema:
The extraction field returns:

Extraction Metadata (extraction_metadata)

The extraction_metadata field has the same structure as your extraction schema, but each field contains a dictionary with references that lists the HTML element IDs where the data was found. The references field can contain:
  • Chunk IDs: UUID-format IDs (e.g., 72ba3cca-01e5-407b-9fc4-81f54f9f0c51) that reference entire chunks like text blocks or figures
  • Table cell IDs: Format {page_number}-{base62_sequential_number} (e.g., 0-u) when extracted data comes from table cells
  • Other HTML element IDs: Any ID attribute from HTML elements within the markdown fields from the parsed output
This metadata is useful for:
  • Tracing which parts of the document contributed to each extracted field
  • Debugging extraction issues
  • Building confidence scores or validation logic
  • Creating audit trails for extracted data

Simple Schema Metadata

For a simple extraction schema, the metadata includes the value and references for each field. When data is extracted from text chunks, references contain chunk IDs (UUIDs):
When data is extracted from table cells, references contain table cell IDs:
In this example, "0-u" is a table cell ID where 0 indicates page 0 and u is the base62-encoded sequential number for that cell.

Nested Schema Metadata

For nested extraction schemas, the metadata preserves the same nested structure:

Processing Metadata (metadata)

The metadata field provides information about the extraction process:

Example Response

Here is a complete example showing the extraction response structure: