> ## Documentation Index
> Fetch the complete documentation index at: https://docs.textin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Response Format

> Understand the **Parse** response format.

Parse returns Markdown, structured document elements, and optional output fields based on the capabilities you enable in the request.

This page describes the standard synchronous response format. If you download the final result from an asynchronous `result_url`, the file contains the parse result object directly, without the outer `code`, `message`, and `data` wrapper.

## Response overview

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "schema_version": "1.3.0",
    "file_id": "doc_7f3a2b",
    "metadata": {},
    "markdown": "# Title\n\nContent...",
    "elements": [],
    "pages": [],
    "title_tree": [],
    "summary": {}
  }
}
```

## Top-level fields

| Field          | Type    | Description                     |
| -------------- | ------- | ------------------------------- |
| `code`         | integer | Application-level response code |
| `message`      | string  | Response message                |
| `data`         | object  | Parse result                    |
| `x_request_id` | string  | Request identifier              |

## `data` fields

| Field            | Type    | Description                                                             |
| ---------------- | ------- | ----------------------------------------------------------------------- |
| `schema_version` | string  | Response schema version                                                 |
| `file_id`        | string  | File identifier                                                         |
| `job_id`         | string  | Task identifier, when returned                                          |
| `success_count`  | integer | Number of pages processed successfully                                  |
| `metadata`       | object  | File-level metadata                                                     |
| `markdown`       | string  | Document content in Markdown format                                     |
| `elements`       | array   | Structured document elements                                            |
| `pages`          | array   | Page-level information, returned when the `pages` capability is enabled |
| `title_tree`     | array   | Document outline, returned when the `title_tree` capability is enabled  |
| `summary`        | object  | Processing summary                                                      |

## `metadata`

The `metadata` object contains file-level information.

Common fields include:

| Field         | Type    | Description                     |
| ------------- | ------- | ------------------------------- |
| `filename`    | string  | Original file name              |
| `filetype`    | string  | File type or extension          |
| `page_count`  | integer | Number of pages in the document |
| `data_source` | string  | Source type, when returned      |

## `elements`

The `elements` array contains structured document elements in reading order.

Each element represents a structural unit in the document, such as a heading, paragraph, table, image, formula, header, or footer.

### Basic structure

```json theme={null}
{
  "elements": [
    {
      "element_id": "el_001",
      "type": "Title",
      "text": "Annual Report 2024",
      "page_number": 1,
      "coordinates": [0.1, 0.12, 0.9, 0.12, 0.9, 0.16, 0.1, 0.16],
      "metadata": {}
    }
  ]
}
```

### Base fields

| Field             | Type    | Description                                                                                  |
| ----------------- | ------- | -------------------------------------------------------------------------------------------- |
| `element_id`      | string  | Unique identifier for the element                                                            |
| `type`            | string  | Element type                                                                                 |
| `sub_type`        | string  | Optional subtype                                                                             |
| `text`            | string  | Recognized text                                                                              |
| `page_number`     | integer | Page number, starting at 1                                                                   |
| `coordinates`     | array   | Normalized four-point bounding box                                                           |
| `metadata`        | object  | Element metadata                                                                             |
| `objects`         | array   | Inline objects, returned when `include_inline_objects` is enabled                            |
| `table_structure` | object  | Structured table data, returned for Table elements when `include_table_structure` is enabled |
| `char_details`    | array   | Character-level output, returned when `include_char_details` is enabled                      |
| `image_data`      | object  | Image output, returned for Image elements when `include_image_data` is enabled               |

### Element types

| Type                | Description         |
| ------------------- | ------------------- |
| `Title`             | Heading             |
| `NarrativeText`     | Body paragraph      |
| `ListItem`          | List item           |
| `Table`             | Table               |
| `TableCaption`      | Table caption       |
| `Image`             | Image               |
| `FigureCaption`     | Figure caption      |
| `Formula`           | Math formula        |
| `Chemical`          | Chemical formula    |
| `Header`            | Page header         |
| `Footer`            | Page footer         |
| `PageNumber`        | Printed page number |
| `PageBreak`         | Page break          |
| `CodeSnippet`       | Code block          |
| `UncategorizedText` | Uncategorized text  |

### `elements.metadata`

An element's `metadata` object can include structural and relationship fields.

Common fields include:

| Field                 | Type    | Description                                            |
| --------------------- | ------- | ------------------------------------------------------ |
| `parent_id`           | string  | Parent element identifier                              |
| `children_ids`        | array   | Child element identifiers                              |
| `category_depth`      | integer | Depth in the heading or section hierarchy              |
| `ref_element_id`      | string  | Referenced element identifier                          |
| `is_continuation`     | boolean | Whether this element continues from a previous element |
| `continuation_of`     | string  | Identifier of the earlier element this one continues   |
| `has_inline_objects`  | boolean | Whether inline objects are present                     |
| `inline_object_types` | array   | Types of inline objects included in the element        |
| `width`               | number  | Element width, when returned                           |
| `height`              | number  | Element height, when returned                          |
| `data_source`         | string  | Element source type, when returned                     |

## Coordinate system

Parse element coordinates are normalized to the page width and height.

Coordinates use eight values:

```text theme={null}
[x1, y1, x2, y2, x3, y3, x4, y4]
```

The points are ordered as:

```text theme={null}
(x1,y1) -------- (x2,y2)
   |                |
   |  Element Area  |
   |                |
(x4,y4) -------- (x3,y3)
```

Each value is in the range `0` to `1`.

To convert normalized coordinates to pixel coordinates, multiply x values by the page width and y values by the page height.

```python theme={null}
page_width = 1576
page_height = 1683

x1_px = coordinates[0] * page_width
y1_px = coordinates[1] * page_height
```

## `table_structure`

When `include_table_structure` is enabled, Table elements can include structured row, column, and cell data.

```json theme={null}
{
  "type": "Table",
  "text": "<table>...</table>",
  "table_structure": {
    "rows": 3,
    "cols": 2,
    "cells": [
      {
        "cell_id": "cell_1_1",
        "row": 1,
        "col": 1,
        "row_span": 1,
        "col_span": 1,
        "text": "Product"
      }
    ]
  }
}
```

### Cell fields

| Field          | Type    | Description                                        |
| -------------- | ------- | -------------------------------------------------- |
| `cell_id`      | string  | Cell identifier                                    |
| `row`          | integer | Row index                                          |
| `col`          | integer | Column index                                       |
| `row_span`     | integer | Number of rows spanned                             |
| `col_span`     | integer | Number of columns spanned                          |
| `text`         | string  | Cell text                                          |
| `coordinates`  | array   | Cell coordinates, when returned                    |
| `content_type` | string  | Cell content type, when returned                   |
| `image_datas`  | array   | Image content in the cell, when returned           |
| `objects`      | array   | Inline objects in the cell, when returned          |
| `char_details` | array   | Character-level output for the cell, when returned |

Use `table_view: "html"` when Markdown does not preserve the table structure well.

## `image_data`

When `include_image_data` is enabled, `Image` elements can include extracted image data.

Common fields include:

| Field       | Type   | Description                              |
| ----------- | ------ | ---------------------------------------- |
| `image_url` | string | URL for the extracted image              |
| `mime_type` | string | MIME type                                |
| `base64`    | string | Base64-encoded image data, when returned |

## `char_details`

When `include_char_details` is enabled, elements can include character-level details.

Common fields include:

| Field                    | Type    | Description                                  |
| ------------------------ | ------- | -------------------------------------------- |
| `index`                  | integer | Character index in the element               |
| `text`                   | string  | Character text                               |
| `coordinates`            | array   | Character coordinates                        |
| `recognition.confidence` | number  | Character confidence score                   |
| `recognition.candidates` | array   | Candidate recognition results, when returned |

## `objects`

When `include_inline_objects` is enabled, elements can include inline objects such as formulas, checkboxes, handwriting, or inline images.

Common fields include:

| Field                   | Type   | Description                                |
| ----------------------- | ------ | ------------------------------------------ |
| `object_id`             | string | Object identifier                          |
| `type`                  | string | Object type                                |
| `text_range`            | object | Start and end positions in the parent text |
| `image_data`            | object | Object image payload, when returned        |
| `metadata.display_mode` | string | Display mode metadata, when returned       |

## `title_tree`

The `title_tree` field is returned when the `title_tree` capability is enabled.

Use it to build:

* Table of contents
* Section navigation
* Structure-aware chunks

## `pages`

The `pages` field is returned when the `pages` capability is enabled.

Each item in `pages` can include:

| Field            | Type    | Description                     |
| ---------------- | ------- | ------------------------------- |
| `page_number`    | integer | Page number, starting at 1      |
| `page_width`     | integer | Page width                      |
| `page_height`    | integer | Page height                     |
| `angle`          | integer | Page rotation angle             |
| `element_ids`    | array   | Element identifiers on the page |
| `page_image_url` | string  | Page image URL, when returned   |
| `dpi`            | integer | Page DPI value, when available  |
| `status`         | string  | Page processing status          |

## `summary`

The `summary` object contains processing metrics.

Common metrics include:

| Field         | Type    | Description                           |
| ------------- | ------- | ------------------------------------- |
| `duration_ms` | integer | Total processing time in milliseconds |

## Parse-specific errors

Most authentication, file, and request validation errors are shared across Parse and Extract. See [Errors](/xparse/errors) for the full common error reference.

The following error is specific to Parse:

| Code    | Description           | Solution                                                                        |
| ------- | --------------------- | ------------------------------------------------------------------------------- |
| `40427` | Unsupported DPI value | Use a supported DPI setting, or remove the DPI parameter if it is not required. |

## Related resources

<CardGroup cols={2}>
  <Card title="Parse Quickstart" icon="rocket" href="/xparse/parse/quickstart">
    Parse your first document.
  </Card>

  <Card title="Configuration" icon="sliders" href="/xparse/parse/configuration">
    Customize parsing behavior.
  </Card>

  <Card title="Async Processing" icon="clock" href="/xparse/parse/async-processing">
    Process large documents asynchronously.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/xparse/errors">
    Review common error codes.
  </Card>
</CardGroup>
