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

# Parse

export const splitJSON = 'split rules';

export const split = 'ADE Split';

export const adePythonLibrary = 'ade-python';

export const dpt2mini = 'DPT-2 mini';

export const dpt2 = 'DPT-2';

export const dpt1 = 'DPT-1';

export const dpt = 'Document Pre-Trained Transformer';

export const companyName = 'LandingAI';

export const extract = 'ADE Extract';

export const parse = 'ADE Parse';

export const ade = 'Agentic Document Extraction';

Use the [{parse} API](https://docs.landing.ai/api-reference/tools/ade-parse) to convert documents into structured Markdown, chunks, and metadata. The API identifies elements like text, tables, and form fields with exact page and coordinate references.

After parsing, you can:

* Use the Markdown output directly in your applications
* Run [field extraction](./ade-extract) on the parsed content
* [Generate a hierarchical table of contents](./ade-section) for navigation and retrieval
* [Classify and split](./ade-split) multi-document files into separate documents

## Use ADE Parse to Parse Documents

Use the {parse} API to parse data from documents.

See the full {parse} API reference [here](https://docs.landing.ai/api-reference/tools/ade-parse).

To get detailed information about the API response, go to [JSON Response for Parsing](./ade-json-response).

### Specify Documents to Parse

The {parse} API offers two parameters for specifying the document you want to parse:

* `document`: Specify the actual file you want to parse.
* `document_url`: Include the URL to the file that you want to parse.

### Set Up Splits for Parsing

<Warning>The `split` parameter is different from the [{split} API](./ade-split). If your goal is to separate a document into sub-documents after parsing, use the {split} API, not the `split` parameter.</Warning>

The {parse} API includes an optional `split` parameter that controls how the parsed content is organized in the response.

This is how to include the `split` parameter when calling the {parse} API.

```bash theme={null}
curl -X POST 'https://api.va.landing.ai/v1/ade/parse' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'document=@document.pdf' \
  -F 'model=dpt-2-latest'\
 - F 'split=page' # Optional split parameter
```

#### Omit the Split Parameter

When you omit the `split` parameter, the API returns the entire document as a single split. All chunks from all pages are grouped together in one split object with `class: "full"` and `identifier: "full"`.

Omit the `split` parameter when you need to:

* Process the entire document as a single unit
* Maintain document context across pages
* Extract data that spans multiple pages

#### Use Page-Level Splits

When you use page-level splits (When you set `split=page`), the API organizes chunks by page. For multi-page documents, this creates one split per page. Each split has `class: "page"` and an identifier like `page_0`, `page_1`, etc.

Use page-level splits (set the `split` parameter to `page`) when you need to:

* Process pages independently
* Extract data from specific pages
* Build page-by-page workflows
* Reduce content size for downstream processing

## Add Custom Prompts for Figure Descriptions

Use the optional `custom_prompts` parameter to customize how {ade} describes figures during parsing. For more information, see [Custom Prompts for Figure Descriptions](./ade-parse-custom-prompts).

## Example: Parse a Document with the API

This example shows how to parse a document with the {parse} API and save the Markdown output to a file.

Materials:

* Sample PDF: <a href="/examples/wire-transfer.pdf" download="wire-transfer.pdf">Wire Transfer Form</a>

```python [expandable] theme={null}
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_KEY'
}

url = 'https://api.va.landing.ai/v1/ade/parse'

# Upload a document
document = open('wire-transfer.pdf', 'rb')
files = {'document': document}
data = {'model': 'dpt-2-latest'}

response = requests.post(url, files=files, data=data, headers=headers)
response_data = response.json()

# Print the full response
print(response_data)

# Extract and save the markdown content
if 'markdown' in response_data:
    markdown_content = response_data['markdown']

    # Save markdown content to file
    with open('markdown-wire-transfer.md', 'w', encoding='utf-8') as f:
        f.write(markdown_content)

    print("\nMarkdown content saved to a Markdown file.")
else:
    print("No 'markdown' field found in the response")

# Close the file
document.close()
```

The full response will be similar to the JSON below.

Notice that each chunk has an `id`. For example, the first chunk is the text "# WIRE TRANSFER FORM". The `id` for that chunk is `33335548-e7c3-40bd-898e-4f23d6c99d34`.

```json [expandable] theme={null}
{
   'markdown':"<a id='33335548-e7c3-40bd-898e-4f23d6c99d34'></a>\n\n# WIRE TRANSFER FORM\n\n<a id='0777dc07-855b-4b83-b422-5e8063405249'></a>\n\nInvoice Information\n\nInvoice Description: Professional consulting services - Q3 2025\n\nTotal Invoice Amount: $15,750.00 USD\n\n<a id='7c56b114-cc66-4fe4-99cb-9425a5210747'></a>\n\nBeneficiary Bank Information\n\nBank Name: JPMorgan Chase Bank, N.A.\n\nBank Address: 270 Park Avenue, New York, NY 10017, USA\n\nBank Account Number: 4578923456789012\n\nSWIFT Code: CHASUS33\n\nABA Routing Number: 021000021\n\nACH Routing Number: 021000021\n\n<a id='b95955a2-3f1d-4b96-be12-d5af677efd60'></a>\n\nInvoice Line Items\n<table><thead><tr><th>Description</th><th>Amount</th></tr></thead><tbody><tr><td>Strategic planning consultation (40 hours @ $150/hr)</td><td>$6,000.00</td></tr><tr><td>Market analysis report preparation</td><td>$3,500.00</td></tr><tr><td>Implementation roadmap development</td><td>$2,250.00</td></tr><tr><td>Executive presentation materials</td><td>$1,500.00</td></tr><tr><td>Follow-up consultation sessions (15 hours @ $150/hr)</td><td>$2,250.00</td></tr><tr><td>Travel expenses (reimbursable)</td><td>$250.00</td></tr><tr><td>TOTAL</td><td>$15,750.00</td></tr></tbody></table>\n\n<a id='d9296cc1-f804-43e2-9f0f-99e7c62eec48'></a>\n\nWire Transfer Instructions\n\nPayment Method: International Wire Transfer\nCurrency: USD (United States Dollars)\nBeneficiary Name: ABC Consulting Services LLC\n\n<a id='f2b8a1d4-4436-4e05-9467-bdaf5ca4bd3b'></a>\n\nBeneficiary Address: 1234 Business Park Drive, Suite 500, Los Angeles, CA 90210, USA\n\nPurpose of Payment: Payment for professional consulting services as per Invoice #INV-2025-0847\n\n<a id='1d536fff-e204-48d4-a53a-8e524665aec5'></a>\n\n- Special Instructions:\n  - Please include invoice number INV-2025-0847 in the payment reference\n  - All bank charges to be borne by the sender\n  - Payment should be received within 3-5 business days\n  - Please send wire confirmation receipt to accounting@abcconsulting.com\n  - For any questions regarding this transfer, contact: +1 (555) 123-4567\n\n<a id='fb34e8c2-0aa6-4866-895d-060c07b717ea'></a>\n\n**Urgency:** Standard processing (3-5 business days acceptable)\n\n<a id='7c686aab-8142-4da2-a7e7-dae4495aade5'></a>\n\nForm completed on: September 3, 2025\n\nReference Number: WT-2025-0847",
   'chunks':[
      {
         'markdown':'# WIRE TRANSFER FORM',
         'type':'text',
         'id':'33335548-e7c3-40bd-898e-4f23d6c99d34',
         'grounding':{
            'box':{
               'left':0.2622728943824768,
               'top':0.07604080438613892,
               'right':0.7369285821914673,
               'bottom':0.10924206674098969
            },
            'page':0
         }
      },
      {
         'markdown':'Invoice Information\n\nInvoice Description: Professional consulting services - Q3 2025\n\nTotal Invoice Amount: $15,750.00 USD',
         'type':'text',
         'id':'0777dc07-855b-4b83-b422-5e8063405249',
         'grounding':{
            'box':{
               'left':0.10331332683563232,
               'top':0.13015401363372803,
               'right':0.8966385126113892,
               'bottom':0.2544138431549072
            },
            'page':0
         }
      },
      {
         'markdown':'Beneficiary Bank Information\n\nBank Name: JPMorgan Chase Bank, N.A.\n\nBank Address: 270 Park Avenue, New York, NY 10017, USA\n\nBank Account Number: 4578923456789012\n\nSWIFT Code: CHASUS33\n\nABA Routing Number: 021000021\n\nACH Routing Number: 021000021',
         'type':'text',
         'id':'7c56b114-cc66-4fe4-99cb-9425a5210747',
         'grounding':{
            'box':{
               'left':0.10399597883224487,
               'top':0.2693082094192505,
               'right':0.895996630191803,
               'bottom':0.5048781633377075
            },
            'page':0
         }
      },
      {
         'markdown':'Invoice Line Items\n<table><thead><tr><th>Description</th><th>Amount</th></tr></thead><tbody><tr><td>Strategic planning consultation (40 hours @ $150/hr)</td><td>$6,000.00</td></tr><tr><td>Market analysis report preparation</td><td>$3,500.00</td></tr><tr><td>Implementation roadmap development</td><td>$2,250.00</td></tr><tr><td>Executive presentation materials</td><td>$1,500.00</td></tr><tr><td>Follow-up consultation sessions (15 hours @ $150/hr)</td><td>$2,250.00</td></tr><tr><td>Travel expenses (reimbursable)</td><td>$250.00</td></tr><tr><td>TOTAL</td><td>$15,750.00</td></tr></tbody></table>',
         'type':'table',
         'id':'b95955a2-3f1d-4b96-be12-d5af677efd60',
         'grounding':{
            'box':{
               'left':0.10457819700241089,
               'top':0.5198298096656799,
               'right':0.8970209956169128,
               'bottom':0.8072096705436707
            },
            'page':0
         }
      },
      {
         'markdown':'Wire Transfer Instructions\n\nPayment Method: International Wire Transfer\nCurrency: USD (United States Dollars)\nBeneficiary Name: ABC Consulting Services LLC',
         'type':'text',
         'id':'d9296cc1-f804-43e2-9f0f-99e7c62eec48',
         'grounding':{
            'box':{
               'left':0.10443270206451416,
               'top':0.8223555088043213,
               'right':0.8968669176101685,
               'bottom':0.974624514579773
            },
            'page':0
         }
      },
      {
         'markdown':'Beneficiary Address: 1234 Business Park Drive, Suite 500, Los Angeles, CA 90210, USA\n\nPurpose of Payment: Payment for professional consulting services as per Invoice #INV-2025-0847',
         'type':'text',
         'id':'f2b8a1d4-4436-4e05-9467-bdaf5ca4bd3b',
         'grounding':{
            'box':{
               'left':0.11186572909355164,
               'top':0.022329870611429214,
               'right':0.8772550821304321,
               'bottom':0.09824278950691223
            },
            'page':1
         }
      },
      {
         'markdown':'- Special Instructions:\n  - Please include invoice number INV-2025-0847 in the payment reference\n  - All bank charges to be borne by the sender\n  - Payment should be received within 3-5 business days\n  - Please send wire confirmation receipt to accounting@abcconsulting.com\n  - For any questions regarding this transfer, contact: +1 (555) 123-4567',
         'type':'text',
         'id':'1d536fff-e204-48d4-a53a-8e524665aec5',
         'grounding':{
            'box':{
               'left':0.11558690667152405,
               'top':0.10176733136177063,
               'right':0.8238765001296997,
               'bottom':0.20318034291267395
            },
            'page':1
         }
      },
      {
         'markdown':'**Urgency:** Standard processing (3-5 business days acceptable)',
         'type':'text',
         'id':'fb34e8c2-0aa6-4866-895d-060c07b717ea',
         'grounding':{
            'box':{
               'left':0.11588779091835022,
               'top':0.204525887966156,
               'right':0.6877880096435547,
               'bottom':0.23076602816581726
            },
            'page':1
         }
      },
      {
         'markdown':'Form completed on: September 3, 2025\n\nReference Number: WT-2025-0847',
         'type':'text',
         'id':'7c686aab-8142-4da2-a7e7-dae4495aade5',
         'grounding':{
            'box':{
               'left':0.35991770029067993,
               'top':0.26450976729393005,
               'right':0.641823947429657,
               'bottom':0.3033582866191864
            },
            'page':1
         }
      }
   ],
   'splits':[
      {
         'class':'full',
         'identifier':'full',
         'pages':[
            0,
            1
         ],
         'markdown':"<a id='33335548-e7c3-40bd-898e-4f23d6c99d34'></a>\n\n# WIRE TRANSFER FORM\n\n<a id='0777dc07-855b-4b83-b422-5e8063405249'></a>\n\nInvoice Information\n\nInvoice Description: Professional consulting services - Q3 2025\n\nTotal Invoice Amount: $15,750.00 USD\n\n<a id='7c56b114-cc66-4fe4-99cb-9425a5210747'></a>\n\nBeneficiary Bank Information\n\nBank Name: JPMorgan Chase Bank, N.A.\n\nBank Address: 270 Park Avenue, New York, NY 10017, USA\n\nBank Account Number: 4578923456789012\n\nSWIFT Code: CHASUS33\n\nABA Routing Number: 021000021\n\nACH Routing Number: 021000021\n\n<a id='b95955a2-3f1d-4b96-be12-d5af677efd60'></a>\n\nInvoice Line Items\n<table><thead><tr><th>Description</th><th>Amount</th></tr></thead><tbody><tr><td>Strategic planning consultation (40 hours @ $150/hr)</td><td>$6,000.00</td></tr><tr><td>Market analysis report preparation</td><td>$3,500.00</td></tr><tr><td>Implementation roadmap development</td><td>$2,250.00</td></tr><tr><td>Executive presentation materials</td><td>$1,500.00</td></tr><tr><td>Follow-up consultation sessions (15 hours @ $150/hr)</td><td>$2,250.00</td></tr><tr><td>Travel expenses (reimbursable)</td><td>$250.00</td></tr><tr><td>TOTAL</td><td>$15,750.00</td></tr></tbody></table>\n\n<a id='d9296cc1-f804-43e2-9f0f-99e7c62eec48'></a>\n\nWire Transfer Instructions\n\nPayment Method: International Wire Transfer\nCurrency: USD (United States Dollars)\nBeneficiary Name: ABC Consulting Services LLC\n\n<a id='f2b8a1d4-4436-4e05-9467-bdaf5ca4bd3b'></a>\n\nBeneficiary Address: 1234 Business Park Drive, Suite 500, Los Angeles, CA 90210, USA\n\nPurpose of Payment: Payment for professional consulting services as per Invoice #INV-2025-0847\n\n<a id='1d536fff-e204-48d4-a53a-8e524665aec5'></a>\n\n- Special Instructions:\n  - Please include invoice number INV-2025-0847 in the payment reference\n  - All bank charges to be borne by the sender\n  - Payment should be received within 3-5 business days\n  - Please send wire confirmation receipt to accounting@abcconsulting.com\n  - For any questions regarding this transfer, contact: +1 (555) 123-4567\n\n<a id='fb34e8c2-0aa6-4866-895d-060c07b717ea'></a>\n\n**Urgency:** Standard processing (3-5 business days acceptable)\n\n<a id='7c686aab-8142-4da2-a7e7-dae4495aade5'></a>\n\nForm completed on: September 3, 2025\n\nReference Number: WT-2025-0847",
         'chunks':[
            '33335548-e7c3-40bd-898e-4f23d6c99d34',
            '0777dc07-855b-4b83-b422-5e8063405249',
            '7c56b114-cc66-4fe4-99cb-9425a5210747',
            'b95955a2-3f1d-4b96-be12-d5af677efd60',
            'd9296cc1-f804-43e2-9f0f-99e7c62eec48',
            'f2b8a1d4-4436-4e05-9467-bdaf5ca4bd3b',
            '1d536fff-e204-48d4-a53a-8e524665aec5',
            'fb34e8c2-0aa6-4866-895d-060c07b717ea',
            '7c686aab-8142-4da2-a7e7-dae4495aade5'
         ]
      }
   ],
   'metadata':{
      'filename':'wire-transfer.pdf',
      'org_id':None,
      'page_count':2,
      'duration_ms':7861,
      'credit_usage':6.0,
      'version':'latest'
   }
}
```

<Info>To extract specific fields from the parsed Markdown, see [Extract Data](./ade-extract).</Info>

## Run Parse with Our Libraries

Click one of the tiles below to learn how to run the [{parse} API](https://docs.landing.ai/api-reference/tools/ade-parse) with our libraries.

<CardGroup cols={2}>
  <Card title="Python Library" icon="python" href="./ade-python#parse-getting-started">
    Run Parse with our Python library.
  </Card>

  <Card
    title="TypeScript Library"
    icon={
  <>
    <img className="block dark:hidden" src="/images/ts-logo-512-03221Dxcf.png" alt="TypeScript" style={{ width: "1.5rem", height: "1.5rem", margin: 0 }} />
    <img className="hidden dark:block" src="/images/ts-logo-512-DBFF9B.png" alt="TypeScript" style={{ width: "1.5rem", height: "1.5rem", margin: 0 }} />
  </>
}
    href="./ade-typescript#parse-getting-started"
  >
    Run Parse with our TypeScript library.
  </Card>
</CardGroup>
