> For the complete documentation index, see [/llms.txt](/llms.txt).

> Source: /api/parse/document-parsing

# Document parsing API

OpenAPI spec: `./openapi/openapi-document-digitization-dp.yaml`

- `POST /document-digitization`

<br />

## Response

### Response

<table><tbody><tr><td><strong>api</strong> string<br />
A string representing the version of the API being used. A bump in the major version indicates a backward-incompatible update, while a minor version increase signifies a backward-compatible update.</td></tr><tr><td><strong>model</strong> string<br />
A string representing the version of the model being used.</td></tr><tr><td><strong>elements</strong> list<br />
A list of element objects, each containing information about the elements's text, confidence score, and bounding box.</td></tr><tr><td><strong>elements\[].id</strong> integer<br />
The unique identifier for an element.</td></tr><tr><td><strong>elements\[].category</strong> string<br />
The category of a given element. Categories are in {paragraph, table, figure, chart, header, footer, caption, equation, heading1, list, index, footnote, code}.</td></tr><tr><td><strong>elements\[].sub\_category</strong> string<br />
An optional finer classification within the element's category. For example, a `figure` may be a `signature`, `stamp`, `qr_code`, or `bar_code`; a `chart` may be a `line`, `bar`, or `pie`; and a `code` block reports its programming language (such as `python`). The value set is open and grows over time, so treat this as an arbitrary string rather than a fixed set of values. Omitted when the model does not provide a sub-classification.</td></tr><tr><td><strong>elements\[].page</strong> integer<br />
The page number for an element. Starts from 1.</td></tr><tr><td><strong>elements\[].content.text</strong> string<br />
A string representing the text within an element. It usually provides an OCR result for elements.</td></tr><tr><td><strong>elements\[].content.html</strong> string<br />
A string representing the text within an element, in HTML format. See the <a href="/docs/capabilities/parse/understanding-output#layout-categories-and-html-tags">Layout categories and HTML tags</a> section for more information.</td></tr><tr><td><strong>elements\[].content.markdown</strong> string<br />
A markdown representing the text within an element. For others than `heading1`, `table`, `list` are the same with `text` field.</td></tr><tr><td><strong>elements\[].coordinates</strong> list<br />
A list with four (x, y) coordinates defining the corners of an element's bounding box.
Each value is 4 digit decimal value between 0 and 1 which is the relative position of input document.
In order to get the absolute position in pixel value, users can simply multiply the `x` and `y` with the width and height
of the image document respectively.</td></tr><tr><td><strong>elements\[].base64\_encoding</strong> string<br />
A base64 encoded string value of image cropped with the coordinates of the layout element.</td></tr><tr><td><strong>content.text</strong> string<br />
A string representing the text of the entire document, typically created by concatenating the pages' serialized texts.</td></tr><tr><td><strong>content.html</strong> string<br />
A string representing the text of the entire document in HTML format, typically created by concatenating the pages' serialized HTML snippets.</td></tr><tr><td><strong>content.markdown</strong> string<br />
A mardown representing the text of the entire document, typically created by concatenating the pages' serialized markdown texts.</td></tr><tr><td><strong>usage.pages</strong> integer<br />
The total count of pages in the input file that have been processed and are chargeable.</td></tr><tr><td><strong>usage.standard</strong> list<br />
A list of 1-based page numbers that were processed in <code>standard</code> mode. Pages are reported per processing mode (<code>standard</code>, <code>enhanced</code>) so you can see how each page was parsed — useful when <code>mode</code> is set to <code>auto</code> — and because each mode is billed at a different rate. Omitted when empty.</td></tr><tr><td><strong>usage.enhanced</strong> list<br />
A list of 1-based page numbers that were processed in <code>enhanced</code> mode. Omitted when empty.</td></tr></tbody></table>

### Functionality overview

- **Unknown characters**: Characters are not recognized by the OCR model are considered "unknown characters" and are marked by the character `�`.
- **Response time**: Standard documents containing up to 200 words take approximately three seconds. Longer documents can take up to tens of seconds.
- **Timeout**: There is a server-side 5 minutes timeout for all requests.

<br />

## Example

**Request**

_Request/response examples: document-parsing / request_

**Response**

_Example: document-parsing / response-200 / default_