Skip to main content
POST
/
v1
/
ade
/
extract
/
jobs
cURL
curl -X POST 'https://api.va.landing.ai/v1/ade/extract/jobs' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'schema={"type": "object", "properties": {"field1": {"type": "string"}, "field2": {"type": "string"}}}' \
  -F 'markdown=@markdown.md' \
  -F 'model=extract-latest'
import requests

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

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

# Read the schema file as a string
with open('schema.json', 'r') as f:
schema_content = f.read()

# Prepare files and data
files = {'markdown': open('markdown.md', 'rb')}
data = {
'schema': schema_content,
'model': 'extract-latest'
}

response = requests.post(url, files=files, data=data, headers=headers)
print(response.json())
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');

const form = new FormData();
form.append('markdown', fs.createReadStream('markdown.md'));
form.append('schema', fs.readFileSync('schema.json', 'utf8'));
form.append('model', 'extract-latest');

axios.post('https://api.va.landing.ai/v1/ade/extract/jobs', form, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
{
  "job_id": "12345678-1234-1234-1234-123456789012"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

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.

Body

multipart/form-data

Request model for async extract endpoint.

Extends ExtractRequest with output_save_url for ZDR support.

schema
string
required

JSON schema for field extraction. This schema determines what key-values pairs are extracted from the Markdown. The schema must be a valid JSON object and will be validated before processing the document.

model
string | null

The version of the model to use for extraction. Use extract-latest to use the latest version.

markdown

The Markdown file or Markdown content to extract data from.

markdown_url
string | null

The URL to the Markdown file to extract data from.

strict
boolean
default:false

If True, reject schemas with unsupported fields (HTTP 422). If False, prune unsupported fields and continue. Only applies to extract versions that support schema validation.

output_save_url
string | null

If zero data retention (ZDR) is enabled, you must enter a URL for the extracted output to be saved to. When ZDR is enabled, the extracted content will not be in the API response.

Response

Job queued successfully

job_id
string
required