Skip to main content
The code below guides you through parsing a sample document and extracting specific fields from it. Call the APIs directly with the cURL commands, or use our Python and TypeScript libraries.

Prerequisites

Call the API

1

Parse a document

Run the code below to parse a sample bank statement with the API.Replace YOUR_API_KEY with your API key.
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'
2

Save the markdown response

After parsing the document, save the markdown response to a file named markdown-bank-statement.md.
3

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 API.Replace YOUR_API_KEY with your API key, and replace markdown-bank-statement.md with the path to your Markdown file.
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"}}, "required": ["name", "number_deposits"]}' \
  -F 'markdown=@markdown-bank-statement.md' \
  -F 'model=extract-latest'
The API response includes the extracted fields.
{
  "extraction": {
    "name": "Sarah J. Mitchell",
    "number_deposits": 5
  },
  "extraction_metadata": {
    "name": {
      "value": "Sarah J. Mitchell",
      "references": [
        "d10a90d8-4bac-4dec-b9b2-6ead7345b798"
      ]
    },
    "number_deposits": {
      "value": 5,
      "references": [
        "a0294b27-61f7-40d7-ba26-1778f3b16248"
      ]
    }
  },
  "metadata": {
    "filename": "markdown-bank-statement.md",
    "org_id": null,
    "duration_ms": 3440,
    "credit_usage": 25.147199999999998,
    "job_id": "68c00faf73cc46a6a5fcefdef565aa56",
    "version": "extract-20251024",
    "schema_violation_error": null,
    "fallback_model_version": null
  }
}

Next Steps: Develop and Scale

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

Sample Scripts & Projects

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