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

# Extract Input Parameters

> Set the Markdown, schema, options, and model version when calling the Extract v2 API.

export const dpt3 = 'DPT-3';

export const extractDpt3 = 'Extract';

export const parseDpt3 = 'Parse';

export const ade = 'Agentic Document Extraction';

Send input to the Extract v2 API as a POST request to `https://api.ade.landing.ai/v2/extract`. This page describes each request field.

## Sample Request

Send the Markdown and a schema to the extract endpoint with a POST request. Replace `YOUR_API_KEY` with your [API key](./agentic-api-key) and `parse-output.md` with the path to your Markdown file.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://api.ade.landing.ai/v2/extract' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -F 'markdown=@parse-output.md' \
    -F 'schema={"type":"object","properties":{"revenue":{"type":"string","description":"Q1 2024 revenue"}}}'
  ```

  ```python Python theme={null}
  from pathlib import Path
  from landingai_ade import LandingAIADE

  client = LandingAIADE()

  response = client.v2.extract(
      markdown=Path("parse-output.md").read_text(),
      schema={
          "type": "object",
          "properties": {
              "revenue": {"type": "string", "description": "Q1 2024 revenue"}
          },
      },
  )
  print(response.extraction)
  ```

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

  const client = new LandingAIADE();

  const response = await client.v2.extract({
    markdown: fs.readFileSync("parse-output.md", "utf8"),
    schema: {
      type: "object",
      properties: {
        revenue: { type: "string", description: "Q1 2024 revenue" },
      },
    },
  });
  console.log(response.extraction);
  ```
</CodeGroup>

## Parameters

| Parameter      | Required    | Description                                                                                                              |
| -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ |
| `markdown`     | Conditional | The Markdown content to extract from, sent as a string or an uploaded file. Provide either `markdown` or `markdown_url`. |
| `markdown_url` | Conditional | A public URL that the API fetches the Markdown from. Provide either `markdown` or `markdown_url`.                        |
| `schema`       | Yes         | The JSON Schema that defines the fields to extract. See [Extraction Schema (JSON)](./ade-extract-schema-json).           |
| `model`        | No          | The extraction model version. Defaults to the latest snapshot. See [Model Version](#model-version).                      |
| `options`      | No          | A JSON object of optional settings. See [Options](#options).                                                             |

## Provide the Markdown

The Extract API works on a Markdown string. That Markdown can come from any source: the [Parse v2 API](https://docs.landing.ai/api-reference/parse/ade-parse), a third-party parser, a web scraper, or a hand-authored document.

For the best results, use Markdown produced by the Parse v2 API. Parse output preserves the document's reading order and structure, which improves extraction accuracy, and it embeds a `<!-- doc_id=<id> -->` comment that Extract reads automatically and echoes back as `metadata.doc_id`. This links each extraction to the parse job it came from.

Pass the Markdown in one of two ways:

* `markdown`: the Markdown content, sent as a string or an uploaded file.
* `markdown_url`: a public URL that the API fetches the Markdown from.

Provide exactly one of these fields per request.

## Set the Extraction Schema

Set the extraction schema in the `schema` field. The schema is a JSON object with a `properties` map that names each field and describes what to extract. The schema must meet specific format and property requirements. For detailed guidance, see [Extraction Schema (JSON)](./ade-extract-schema-json).

## Options

Pass optional settings in the `options` field as a JSON object. The Extract API accepts one option:

| Option   | Type    | Default | Description                                                                                                                                                                                                                                                     |
| -------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `strict` | boolean | `false` | Controls how the API handles schema content it cannot honor. When `false` (default), fields the model cannot extract are skipped, unsupported schema keywords are ignored, and extraction continues. When `true`, the API returns a `422` error in either case. |

To enable strict mode, add it to your request. In cURL, pass the `options` form field; the client libraries expose it as the top-level `strict` parameter:

<CodeGroup>
  ```bash cURL highlight={5} theme={null}
  curl -X POST 'https://api.ade.landing.ai/v2/extract' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -F 'markdown=@parse-output.md' \
    -F 'schema={"type":"object","properties":{"revenue":{"type":"string","description":"Q1 2024 revenue"}}}' \
    -F 'options={"strict": true}'
  ```

  ```python Python highlight={14} theme={null}
  from pathlib import Path
  from landingai_ade import LandingAIADE

  client = LandingAIADE()

  response = client.v2.extract(
      markdown=Path("parse-output.md").read_text(),
      schema={
          "type": "object",
          "properties": {
              "revenue": {"type": "string", "description": "Q1 2024 revenue"}
          },
      },
      strict=True,
  )
  print(response.extraction)
  ```

  ```typescript TypeScript highlight={14} theme={null}
  import fs from "fs";
  import LandingAIADE from "landingai-ade";

  const client = new LandingAIADE();

  const response = await client.v2.extract({
    markdown: fs.readFileSync("parse-output.md", "utf8"),
    schema: {
      type: "object",
      properties: {
        revenue: { type: "string", description: "Q1 2024 revenue" },
      },
    },
    strict: true,
  });
  console.log(response.extraction);
  ```
</CodeGroup>

## Model Version

By default, requests use the latest snapshot of the extraction model. To pin to a specific snapshot, supply it in the `model` form field. The resolved version is returned in `metadata.model_version`.

Use the `-latest` alias for development or when you want continuous improvements; pin to a dated snapshot for production workloads where consistent results matter.

| Value              | Behavior                                                          |
| ------------------ | ----------------------------------------------------------------- |
| `extract-latest`   | The latest snapshot of the extraction model. This is the default. |
| `extract`          | Alias for `extract-latest`; resolves to the latest snapshot.      |
| `extract-20260710` | The snapshot generated on July 10, 2026.                          |

To set the model, add the `model` field to your request:

<CodeGroup>
  ```bash cURL highlight={5} theme={null}
  curl -X POST 'https://api.ade.landing.ai/v2/extract' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -F 'markdown=@parse-output.md' \
    -F 'schema={"type":"object","properties":{"revenue":{"type":"string","description":"Q1 2024 revenue"}}}' \
    -F 'model=extract-latest'
  ```

  ```python Python highlight={14} theme={null}
  from pathlib import Path
  from landingai_ade import LandingAIADE

  client = LandingAIADE()

  response = client.v2.extract(
      markdown=Path("parse-output.md").read_text(),
      schema={
          "type": "object",
          "properties": {
              "revenue": {"type": "string", "description": "Q1 2024 revenue"}
          },
      },
      model="extract-latest",
  )
  print(response.extraction)
  ```

  ```typescript TypeScript highlight={14} theme={null}
  import fs from "fs";
  import LandingAIADE from "landingai-ade";

  const client = new LandingAIADE();

  const response = await client.v2.extract({
    markdown: fs.readFileSync("parse-output.md", "utf8"),
    schema: {
      type: "object",
      properties: {
        revenue: { type: "string", description: "Q1 2024 revenue" },
      },
    },
    model: "extract-latest",
  });
  console.log(response.extraction);
  ```
</CodeGroup>

<Info>
  Some snapshots have been superseded: a newer snapshot replaced them, and they no longer appear in the table above. If you pin a superseded snapshot, your requests still succeed. The API resolves the name to the current snapshot and reports the current version in `metadata.model_version`. Update pinned code to a value from the table.
</Info>
