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

> Parse and extract fields from a sample document in minutes using cURL, Python, or TypeScript.

Use the [Playground](https://ade.landing.ai/) to explore Agentic Document Extraction 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 Agentic Document Extraction [account](https://ade.landing.ai/)
* An [API key](https://docs.landing.ai/ade/agentic-api-key.md)

## Tutorial: Parse and Extract a Document

This tutorial guides you through how to parse a [sample bank statement](https://docs.landing.ai/examples/bank-statement.pdf) and extract these fields: **Account Holder Name** and **Number of Deposits**.

> [tab] cURL
>
> **1. 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/).
>
> ```bash Mac  theme={null}
> brew install jq
> ```
>
> ```bash Windows theme={null}
> winget install jqlang.jq
> ```
>
> ```bash Linux theme={null}
> sudo apt-get install jq
> ```
>
> **2. Parse a document**
>
> Run the code below to parse a [sample bank statement](https://docs.landing.ai/examples/bank-statement.pdf) with the [ADE Parse API](https://docs.landing.ai/api-reference/tools/ade-parse.md). 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
> ```
>
> **3. Save the Markdown content**
>
> To extract data from the document, you need to pass the `markdown` field from `parse-output.json` to the ADE 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
> ```
>
> **4. 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 [ADE Extract API](https://docs.landing.ai/api-reference/tools/ade-extract.md).
>
> 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":"a1b2c3d4e5f6",
>       "duration_ms":6516,
>       "credit_usage":1.5188,
>       "job_id":"1bdcf9c99a614d698f3b4aca65f27935",
>       "version":"extract-20260314",
>       "schema_violation_error":null,
>       "fallback_model_version":null,
>       "warnings":[
>
>       ]
>     }
>   }
> ```

> [tab] Python
>
> **1. Set the API key as an environment variable**
>
> Get your [API key](https://ade.landing.ai/settings/api-key) and set it as an environment variable. For more details, go to [API Key](https://docs.landing.ai/ade/agentic-api-key.md).
>
> ```bash theme={null}
> export VISION_AGENT_API_KEY="<your-api-key>"
> ```
>
> **2. Install the Python library**
>
> Install the [ade-python](https://github.com/landing-ai/ade-python) library.
>
> ```bash theme={null}
> pip install landingai-ade
> ```
>
> **3. Create your code**
>
> This example shows the complete workflow of parsing a [sample bank statement](https://docs.landing.ai/examples/bank-statement.pdf) 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)
> ```
>
> **4. 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}
> ```

> [tab] TypeScript
>
> **1. Set the API key as an environment variable**
>
> Get your [API key](https://ade.landing.ai/settings/api-key) and set it as an environment variable. For more details, go to [API Key](https://docs.landing.ai/ade/agentic-api-key.md).
>
> ```bash theme={null}
> export VISION_AGENT_API_KEY="<your-api-key>"
> ```
>
> **2. Install the TypeScript library**
>
> Install the [ade-typescript](https://github.com/landing-ai/ade-typescript) library.
>
> ```bash theme={null}
> npm install landingai-ade
> ```
>
> **3. Create your code**
>
> This example shows the complete workflow of parsing a [sample bank statement](https://docs.landing.ai/examples/bank-statement.pdf) 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);
> ```
>
> **4. 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 }
> ```

## Next Steps: Develop and Scale

Choose how you want to integrate Agentic Document Extraction into your workflow. Build with AI agents, call the API directly, or use our Python and TypeScript libraries.

> [card] [Build with AI Agents](https://docs.landing.ai/ade/build-with-ai-agents.md)
>
> Use ADE skills, an MCP server, and llms.txt with your AI agents and coding tools.

> [card] [API](https://docs.landing.ai/api-reference/tools/ade-parse.md)
>
> Call the API directly for language flexibility and advanced customization.

> [card] [Python Library](https://docs.landing.ai/ade/ade-python.md)
>
> Use our Python library to build custom scripts.

> [card] [TypeScript Library](https://docs.landing.ai/ade/ade-typescript.md)
>
> Use our TypeScript library to build custom scripts.

## Sample Scripts & Projects

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

> [card] [Sample Projects](https://github.com/landing-ai/ade-sample-projects)
>
> Explore end-to-end examples for common document processing workflows.

> [card] [Sample Scripts in Documentation](https://docs.landing.ai/ade/ade-parse-directory-sample.md)
>
> Browse code samples with examples for the Python and TypeScript libraries.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.