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

# Quickstart

export const adeTypeScriptLibrary = 'ade-typescript';

export const adePythonLibrary = 'ade-python';

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 [Playground](https://va.landing.ai/) to explore {ade} and understand basic concepts without writing code. When you're ready to scale intelligent document processing, follow the tutorial below to get started with code.

## Prerequisites

* An {ade} [account](https://va.landing.ai/)
* An [API key](./agentic-api-key)

## Tutorial: Parse and Extract a Document

This tutorial guides you through how to parse a <a href="/examples/bank-statement.pdf" download="bank-statement.pdf">sample bank statement</a> and extract these fields: **Account Holder Name** and **Number of Deposits**.

<Tabs>
  <Tab title="cURL">
    <Steps>
      <Step title="Install jq">
        Install [jq](https://jqlang.org/), a free third-party command-line tool that will help you save files later in this procedure. Some common install instructions are below; to see all installation methods, go the the [jq site](https://jqlang.org/download/).

        <CodeGroup>
          ```bash Mac  theme={null}
          brew install jq
          ```

          ```bash Windows theme={null}
          winget install jqlang.jq
          ```

          ```bash Linux theme={null}
          sudo apt-get install jq
          ```
        </CodeGroup>
      </Step>

      <Step title="Parse a document">
        Run the code below to parse a <a href="/examples/bank-statement.pdf" download="bank-statement.pdf">sample bank statement</a> with the [{parse} API](https://docs.landing.ai/api-reference/tools/ade-parse). The `>` at the end of the command saves the response to a file called `parse-output.json`.

        Replace `YOUR_API_KEY` with your API key.

        ```bash theme={null}
        curl -X POST 'https://api.va.landing.ai/v1/ade/parse' \
          -H 'Authorization: Bearer YOUR_API_KEY' \
          -F 'document_url=https://docs.landing.ai/examples/bank-statement.pdf' \
          -F 'model=dpt-2-latest' > parse-output.json
        ```
      </Step>

      <Step title="Save the Markdown content">
        To extract data from the document, you need to pass the `markdown` field from `parse-output.json` to the {extract} API.

        Run the following command to save the `markdown` field to a file called `markdown-bank-statement.md`.

        ```bash theme={null}
        jq -r .markdown parse-output.json > markdown-bank-statement.md
        ```
      </Step>

      <Step title="Extract fields from a document">
        Now that the parsed output is in a Markdown file, run the code below to extract the **Account Holder Name** and **Number of Deposits** fields using the [{extract} API](https://docs.landing.ai/api-reference/tools/ade-extract).

        Replace `YOUR_API_KEY` with your API key.

        ```bash theme={null}
        curl -X POST 'https://api.va.landing.ai/v1/ade/extract' \
          -H 'Authorization: Bearer YOUR_API_KEY' \
          -F 'schema={"type": "object", "properties": {"name": {"type": "string", "description": "Account holder name"}, "number_deposits": {"type": "integer", "description": "The number of deposits"}}}' \
          -F 'markdown=@markdown-bank-statement.md' \
          -F 'model=extract-latest'
        ```

        The API response includes the extracted fields:

        * **Account Holder Name**: Sarah J. Mitchell
        * **Number of Deposits**: 5

        ```json expandable highlight={3-4} theme={null}
            {
            "extraction":{
              "name":"Sarah J. Mitchell",
              "number_deposits":5
            },
            "extraction_metadata":{
              "name":{
                "references":[
                  "8b70276e-a3ee-4ed4-9f11-15439c50d603"
                ],
                "value":"Sarah J. Mitchell"
              },
              "number_deposits":{
                "references":[
                  "d9d59d6d-cf43-4ed2-8632-5f48d08885c5"
                ],
                "value":5
              }
            },
            "metadata":{
              "filename":"markdown-bank-statement.md",
              "org_id":"lgy5xucm9xnq",
              "duration_ms":6516,
              "credit_usage":1.5188,
              "job_id":"1bdcf9c99a614d698f3b4aca65f27935",
              "version":"extract-20260314",
              "schema_violation_error":null,
              "fallback_model_version":null,
              "warnings":[
                
              ]
            }
          }
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="Python">
    <Steps>
      <Step title="Set the API key as an environment variable">
        Get your [API key](https://va.landing.ai/settings/api-key) and set it as an environment variable. For more details, go to [API Key](./agentic-api-key).

        ```bash theme={null}
        export VISION_AGENT_API_KEY=<your-api-key>
        ```
      </Step>

      <Step title="Install the Python library">
        Install the [{adePythonLibrary}](https://github.com/landing-ai/ade-python) library.

        ```bash theme={null}
        pip install landingai-ade
        ```
      </Step>

      <Step title="Create your code">
        This example shows the complete workflow of parsing a <a href="/examples/bank-statement.pdf" download="bank-statement.pdf">sample bank statement</a> and extracting the **Account Holder Name** and **Number of Deposits** fields. If you only need to parse documents, use just the parsing section.

        Save the code block below as `quickstart.py`.

        ```python expandable theme={null}
        import json
        from landingai_ade import LandingAIADE

        # Initialize the client
        client = LandingAIADE()

        ##### Parse the document #####

        # Parse the document
        parse_response = client.parse(
            document_url="https://docs.landing.ai/examples/bank-statement.pdf",
            model="dpt-2-latest",
            save_to="./output"  # optional: saves the full response as JSON for later reference
        )

        print("Full Parse response saved to ./output/")

        ##### Extract fields from the parsed document #####

        # Define which fields to extract. Each property specifies a field name and its expected data type.
        schema_dict = {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Account holder name"
                },
                "number_deposits": {
                    "type": "integer",
                    "description": "The number of deposits"
                }
            }
        }

        # Convert schema dictionary to JSON string
        schema_json = json.dumps(schema_dict)

        # Extract fields using the parsed markdown
        extract_response = client.extract(
            schema=schema_json,
            markdown=parse_response.markdown,  # Parse converts the document to Markdown; Extract uses it to identify and pull specific fields
            model="extract-latest",
            save_to="./output"  # optional: saves the full response as JSON for later reference
        )

        print("Full Extract response saved to ./output/")

        # Print the extracted fields
        print("\nExtracted fields:")
        print(extract_response.extraction)
        ```
      </Step>

      <Step title="Run your code">
        Run the Python file you created.

        ```bash theme={null}
        python quickstart.py
        ```

        The script parses the document and saves both responses to `./output/`. The extracted fields returned are:

        * **Account Holder Name**: Sarah J. Mitchell
        * **Number of Deposits**: 5

        ```text theme={null}
        Extracted fields:
        {'name': 'Sarah J. Mitchell', 'number_deposits': 5}
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="TypeScript">
    <Steps>
      <Step title="Set the API key as an environment variable">
        Get your [API key](https://va.landing.ai/settings/api-key) and set it as an environment variable. For more details, go to [API Key](./agentic-api-key).

        ```bash theme={null}
        export VISION_AGENT_API_KEY=<your-api-key>
        ```
      </Step>

      <Step title="Install the TypeScript library">
        Install the [{adeTypeScriptLibrary}](https://github.com/landing-ai/ade-typescript) library.

        ```bash theme={null}
        npm install landingai-ade
        ```
      </Step>

      <Step title="Create your code">
        This example shows the complete workflow of parsing a <a href="/examples/bank-statement.pdf" download="bank-statement.pdf">sample bank statement</a> and extracting the **Account Holder Name** and **Number of Deposits** fields. If you only need to parse documents, use just the parsing section.

        Save the code block below as `quickstart.ts`.

        ```typescript expandable theme={null}
        import LandingAIADE from "landingai-ade";

        // Initialize the client
        const client = new LandingAIADE();

        ///// Parse the document /////

        // Parse the document
        const parseResponse = await client.parse({
          document: await fetch("https://docs.landing.ai/examples/bank-statement.pdf"),
          model: "dpt-2-latest",
          saveTo: "./output"  // optional: saves the full response as JSON for later reference
        });

        console.log("Full Parse response saved to ./output/");

        ///// Extract fields from the parsed document /////

        // Define which fields to extract. Each property specifies a field name and its expected data type.
        const schemaDict = {
          type: "object",
          properties: {
            name: {
              type: "string",
              description: "Account holder name"
            },
            number_deposits: {
              type: "integer",
              description: "The number of deposits"
            }
          }
        };

        // Convert schema object to JSON string
        const schemaJson = JSON.stringify(schemaDict);

        // Extract fields using the parsed markdown
        const extractResponse = await client.extract({
          schema: schemaJson,
          markdown: parseResponse.markdown,  // Parse converts the document to Markdown; Extract uses it to identify and pull specific fields
          model: "extract-latest",
          saveTo: "./output"  // optional: saves the full response as JSON for later reference
        });

        console.log("Full Extract response saved to ./output/");

        // Print the extracted fields
        console.log("\nExtracted fields:");
        console.log(extractResponse.extraction);
        ```
      </Step>

      <Step title="Run your code">
        Run the TypeScript file you created.

        ```bash theme={null}
        npx tsx quickstart.ts
        ```

        The script parses the document and saves both responses to `./output/`. The extracted fields returned are:

        * **Account Holder Name**: Sarah J. Mitchell
        * **Number of Deposits**: 5

        ```text theme={null}
        Extracted fields:
        { name: 'Sarah J. Mitchell', number_deposits: 5 }
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Next Steps: Develop and Scale

Choose how you want to integrate {ade} into your workflow. Call the API directly for maximum flexibility, or use our Python or TypeScript libraries for faster development.

<CardGroup cols={3}>
  <Card title="API" icon="code" href="https://docs.landing.ai/api-reference/tools/ade-parse">
    Call the API directly for language flexibility and advanced customization.
  </Card>

  <Card title="Python Library" icon="python" href="./ade-python">
    Use our Python library to build custom scripts.
  </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"
  >
    Use our TypeScript library to build custom scripts.
  </Card>
</CardGroup>

## Sample Scripts & Projects

Use these sample scripts and projects for real-world use cases as templates to develop your own custom document processing solutions.

<CardGroup cols={2}>
  <Card title="Sample Projects" icon="github" href="https://github.com/landing-ai/ade-sample-projects">
    Explore end-to-end examples for common document processing workflows.
  </Card>

  <Card title="Sample Scripts in Documentation" icon="code" href="/ade/ade-parse-directory-sample">
    Browse code samples with examples for the Python and TypeScript libraries.
  </Card>
</CardGroup>
