Parsed document output can be retrieved using the /parse/{parse_id} endpoint, or using the get_parsed_result SDK function.
result = doc_ai.get_parsed_result(parse_id)
The response is a JSON object if you are using the REST API, and a ParseResult object if you are using the Python SDK.
class ParseResult(BaseModel):
    # Parsed document specific fields
    chunks: Optional[List[Chunk]] = Field(
        default=None,
        description="Chunks of layout text extracted from the document. This is a vector of `Chunk` objects, each containing a piece of text extracted from the document. The chunks are typically used for further processing, such as indexing or searching. The value will vary depending on the chunking strategy used during parsing.",
    )
    document_layout: Optional[Document] = Field(
        default=None,
        description="The layout of the document. This is a JSON object that contains the layout information of the document. It can be used to understand the structure of the document, such as the position of text, tables, figures, etc.",
    )
    page_classes: Optional[Dict[str, PageClass]] = Field(
        default=None,
        description="Page classes extracted from the document. This is a map where the keys are page class names provided in the parse request under the `page_classification_options` field, and the values are PageClass objects containing the class name and page numbers where each page class appears.",
    )
    structured_data: Optional[
        Dict[str, Union[StructuredData, List[StructuredData]]]
    ] = Field(
        default=None,
        description="Structured data extracted from the document. The structured data is a map where the keys are the names of the json schema provided in the parse request, and the values are `StructuredData` objects containing the structured data extracted from the document; formatted according to the schema. When the `structured_extraction` option uses a `chunking_strategy` of `None`, the structured data will be extracted from the entire document, and it will be represented as a single entry in the map with the schema name as the key. When the `structured_extraction` option uses a `chunking_strategy`, the structured data will be extracted from each chunk of text, and it will be represented as multiple entries in the map, with the schema name as the key and a vector of `StructuredData` objects as the value. This is used to extract structured information from the document, such as tables, forms, or other structured content.",
    )

    # ParseResult specific fields
    parse_id: str = Field(description="The unique identifier for the parse job")
    parsed_pages_count: int = Field(
        description="The number of pages that were parsed successfully.", ge=0
    )
    status: ParseStatus = Field(description="The status of the parse job.")
    created_at: str = Field(
        description="The date and time when the parse job was created in RFC 3339 format."
    )
    options: ParseRequestOptions = Field(
        description="The options used for scheduling the parse job."
    )

    # Optional fields
    errors: Optional[dict] = Field(
        None, description="Error occurred during any part of the parse execution."
    )
    finished_at: Optional[str] = Field(
        None,
        description="The date and time when the parse job was finished in RFC 3339 format.",
    )
    labels: Optional[dict] = Field(
        None, description="Labels associated with the parse job."
    )
    tasks_completed_count: Optional[int] = Field(
        None,
        description="The number of tasks that have been completed for the parse job.",
        ge=0,
    )
    tasks_total_count: Optional[int] = Field(
        None,
        description="The total number of tasks that are expected to be completed for the parse job.",
        ge=0,
    )

Output Response Fields

The response contains the following fields which returns the parsed document:
  • parse_id: The unique identifier for the parse job.
  • parsed_pages_count: An integer representing the number of pages that were parsed successfully.
  • status: The status of the parse job.
  • created_at: The date and time when the parse job was created in RFC 3339 format.
  • finished_at: The date and time when the parse job was finished in RFC 3339 format.
  • error: Any errors encountered while parsing the document.
  • labels: Labels associated with the parse job.
  • chunks: An array of objects that contain the markdown content for each chunk. The number of chunks depends on the chunking strategy you chose. See more below.
  • document_layout: A comprehensive JSON representation of the document’s visual structure, including page dimensions, bounding boxes for each element, and reading order. See more below.
  • page_classes: A map where the keys are page class names provided in the parse request, and the values are PageClass objects containing class names and page numbers where each page class appears. See more below.
  • structured_data: A map where the keys are the names of the JSON schema provided in the parse request, and the values are StructuredData objects containing the extracted structured data. See more below.
The Outputs class has been documented in the Python SDK and in the REST API.

Markdown Chunks

The markdown content of the document is available in the chunks attribute of the JSON response. The number of chunks depends on the chunking strategy you chose. Chunking Strategy Options
  • None - The whole document is returned as a single chunk. This allows you to use your own chunking logic.
  • Page - Each page is returned as a separate chunk. You should receive as many chunks as the number of pages in the document.
  • Section - The document is split into chunks based on the section headers detected in the document.
  • Fragment - Every page fragment (e.g. table, figure, paragraph) is returned as a separate chunk. You will most likely have to merge these chunks based on your use-case.

Document Layout and Bounding Boxes

The entire document layout is available in the outputs.document attribute of the JSON response. This object has a list of Pages, each encoded as a JSON object. Each outputs.document.pages[x] contains the following attributes:
  • page_number - The page number of the page.
  • dimensions - The width and height of the page in pixels.
  • page_fragments - The list of objects on the page. Each page fragment has the following attributes:
    • fragment_type - The type of the object: section_header, title, text, table, figure, formula, form, key_value_region, document_index, list_item, table_caption, figure_caption, formula_caption, page_footer, page_header, page_number, signature, strikethrough
    • reading_order - The reading order of the page fragments. This is the order in which the fragment would be read by a human.
    • bbox - The bounding box of the page fragment, in the format [x1, y1, x2, y2].
    • content - The actual content that is found on that fragment of the page.

Page Classifications

Page classifications are also returned as a list of Page Class objects, which contain the following attributes:
  • page_class: The classification name you provided. This will match the name field in your PageClassConfig.
  • page_numbers: An array of page numbers (1-indexed) that match this classification.
See Page Classification for more details.

Structured Extraction

Structured Data is returned as a list depending on partition strategy (e.g. one Structured Data object for each partition of the document). Each object contains
  • data: The JSON object representing the data extracted that matches the input schema.
  • page_numbers: A list of page numbers where the structured data was searched for.
  • schema_name: The name of the schema provided by the user.
See Structured Extraction for more details.