> ## 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.

# ADE Parse

> Parse a document or spreadsheet.

This endpoint parses documents (PDF, images)
    and spreadsheets (XLSX, CSV) into structured Markdown, chunks, and metadata.
    

 For EU users, use this endpoint:


    `https://api.va.eu-west-1.landing.ai/v1/ade/parse`.



## OpenAPI

````yaml /ade/va_openapi_ade2.json post /v1/ade/parse
openapi: 3.1.0
info:
  title: Vision Tools API
  version: 0.1.0
servers:
  - url: https://api.va.landing.ai
    description: Production vision tools API
security: []
paths:
  /v1/ade/parse:
    post:
      tags:
        - Tools
      summary: ADE Parse
      description: |-
        Parse a document or spreadsheet.

        This endpoint parses documents (PDF, images)
            and spreadsheets (XLSX, CSV) into structured Markdown, chunks, and metadata.
            

         For EU users, use this endpoint:


            `https://api.va.eu-west-1.landing.ai/v1/ade/parse`.
      operationId: tool_ade_parse_v1_ade_parse_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ParseRequestWithEncryptedPassword'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParseResponse'
        '206':
          description: There were some pages that failed to be parsed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParseResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded
      security:
        - Basic Auth: []
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            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'  # Set the model (optional)
        - lang: Python
          label: Python
          source: >-
            import requests

            import json


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


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


            # Set the model (optional)

            data = {
                'model': 'dpt-2-latest'
            }


            # Upload a document 

            document = open('document.pdf', 'rb')

            files = {'document': document}


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

            print(response.json())
        - lang: JavaScript
          label: Node.js
          source: |-
            const axios = require('axios');
            const FormData = require('form-data');
            const fs = require('fs');

            const form = new FormData();
            form.append('document', fs.createReadStream('document.pdf'));

            // Set the model (optional)
            form.append('model', 'dpt-2-latest');

            axios.post('https://api.va.landing.ai/v1/ade/parse', form, {
              headers: {
                'Authorization': 'Bearer YOUR_API_KEY',
                ...form.getHeaders()
              }
            })
            .then(response => console.log(response.data))
            .catch(error => console.error(error));
components:
  schemas:
    ParseRequestWithEncryptedPassword:
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: The version of the model to use for parsing.
        document:
          anyOf:
            - type: string
              format: binary
            - type: 'null'
          title: Document
          description: >-
            A file to be parsed. The file can be a PDF or an image. See the list
            of supported file types here:
            https://docs.landing.ai/ade/ade-file-types. Either this parameter or
            the `document_url` parameter must be provided.
        document_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Url
          description: >-
            The URL to the file to be parsed. The file can be a PDF or an image.
            See the list of supported file types here:
            https://docs.landing.ai/ade/ade-file-types. Either this parameter or
            the `document` parameter must be provided.
        split:
          anyOf:
            - $ref: '#/components/schemas/SplitType'
            - type: 'null'
          description: >-
            If you want to split documents into smaller sections, include the
            split parameter. Set the parameter to page to split documents at the
            page level. The splits object in the API output will contain a set
            of data for each page.
        password:
          anyOf:
            - type: string
            - type: 'null'
          title: Password
          description: >-
            Password for encrypted document files. If the document is
            password-protected, provide the password to decrypt and process the
            document. Ignored for unencrypted documents.
        custom_prompts:
          anyOf:
            - type: string
              contentMediaType: application/json
              contentSchema:
                $ref: '#/components/schemas/CustomPrompts'
            - type: 'null'
          title: Custom Prompts
          description: >-
            Optional JSON string mapping chunk types to custom parsing prompts.
            Only the `figure` key is supported, for example '{"figure":"Describe
            axis labels in detail."}'.
      type: object
      title: ParseRequestWithEncryptedPassword
    ParseResponse:
      properties:
        markdown:
          type: string
          title: Markdown
        chunks:
          items:
            $ref: '#/components/schemas/ParseChunk'
          type: array
          title: Chunks
        splits:
          items:
            $ref: '#/components/schemas/ParseSplit'
          type: array
          title: Splits
        grounding:
          additionalProperties:
            anyOf:
              - $ref: '#/components/schemas/ParseResponseGrounding'
              - $ref: '#/components/schemas/ParseResponseTableCellGrounding'
          type: object
          title: Grounding
        metadata:
          $ref: '#/components/schemas/ParseMetadata'
      type: object
      required:
        - markdown
        - chunks
        - splits
        - metadata
      title: ParseResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SplitType:
      type: string
      enum:
        - page
      const: page
      title: SplitType
    ParseChunk:
      properties:
        markdown:
          type: string
          title: Markdown
        type:
          type: string
          title: Type
        id:
          type: string
          title: Id
        grounding:
          $ref: '#/components/schemas/ParseGrounding'
      type: object
      required:
        - markdown
        - type
        - id
        - grounding
      title: ParseChunk
    ParseSplit:
      properties:
        class:
          type: string
          title: Class
        identifier:
          type: string
          title: Identifier
        pages:
          items:
            type: integer
          type: array
          title: Pages
        markdown:
          type: string
          title: Markdown
        chunks:
          items:
            type: string
          type: array
          title: Chunks
      type: object
      required:
        - class
        - identifier
        - pages
        - markdown
        - chunks
      title: ParseSplit
    ParseResponseGrounding:
      properties:
        box:
          $ref: '#/components/schemas/ParseGroundingBox'
        page:
          type: integer
          title: Page
        type:
          $ref: '#/components/schemas/GroundingType'
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        low_confidence_spans:
          items:
            $ref: '#/components/schemas/Patch'
          type: array
          title: Low Confidence Spans
      type: object
      required:
        - box
        - page
        - type
      title: ParseResponseGrounding
    ParseResponseTableCellGrounding:
      properties:
        box:
          $ref: '#/components/schemas/ParseGroundingBox'
        page:
          type: integer
          title: Page
        type:
          $ref: '#/components/schemas/GroundingType'
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        position:
          anyOf:
            - $ref: '#/components/schemas/ParseResponseTableCellGroundingPosition'
            - type: 'null'
      type: object
      required:
        - box
        - page
        - type
      title: ParseResponseTableCellGrounding
    ParseMetadata:
      properties:
        filename:
          type: string
          title: Filename
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
        page_count:
          type: integer
          title: Page Count
        duration_ms:
          type: integer
          title: Duration Ms
        credit_usage:
          type: number
          title: Credit Usage
        job_id:
          type: string
          title: Job Id
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        failed_pages:
          items:
            type: integer
          type: array
          title: Failed Pages
      type: object
      required:
        - filename
        - org_id
        - page_count
        - duration_ms
        - credit_usage
        - job_id
        - version
      title: ParseMetadata
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ParseGrounding:
      properties:
        box:
          $ref: '#/components/schemas/ParseGroundingBox'
        page:
          type: integer
          title: Page
      type: object
      required:
        - box
        - page
      title: ParseGrounding
    ParseGroundingBox:
      properties:
        left:
          type: number
          title: Left
        top:
          type: number
          title: Top
        right:
          type: number
          title: Right
        bottom:
          type: number
          title: Bottom
      type: object
      required:
        - left
        - top
        - right
        - bottom
      title: ParseGroundingBox
    GroundingType:
      type: string
      enum:
        - chunkLogo
        - chunkCard
        - chunkAttestation
        - chunkScanCode
        - chunkForm
        - chunkTable
        - chunkFigure
        - chunkText
        - chunkMarginalia
        - chunkTitle
        - chunkPageHeader
        - chunkPageFooter
        - chunkPageNumber
        - chunkKeyValue
        - table
        - tableCell
      title: GroundingType
    Patch:
      properties:
        text:
          type: string
          title: Text
        span:
          prefixItems:
            - type: integer
            - type: integer
          type: array
          maxItems: 2
          minItems: 2
          title: Span
        confidence:
          type: number
          title: Confidence
      type: object
      required:
        - text
        - span
        - confidence
      title: Patch
    ParseResponseTableCellGroundingPosition:
      properties:
        row:
          type: integer
          title: Row
        col:
          type: integer
          title: Col
        rowspan:
          type: integer
          title: Rowspan
        colspan:
          type: integer
          title: Colspan
        chunk_id:
          type: string
          title: Chunk Id
      type: object
      required:
        - row
        - col
        - rowspan
        - colspan
        - chunk_id
      title: ParseResponseTableCellGroundingPosition
  securitySchemes:
    Basic Auth:
      type: http
      description: >-
        Your unique API key for authentication.


        Get your API key here: https://va.landing.ai/settings/api-key.


        If using the EU endpoint, get your API key here:
        https://va.eu-west-1.landing.ai/settings/api-key.
      scheme: bearer
      bearerFormat: Basic

````