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"}}}'import json
import requests
url = 'https://api.ade.landing.ai/v2/extract'
headers = {'Authorization': 'Bearer YOUR_API_KEY'}
files = {'markdown': open('parse-output.md', 'rb')}
data = {
'schema': json.dumps({
'type': 'object',
'properties': {
'revenue': {'type': 'string', 'description': 'Q1 2024 revenue'}
}
})
}
response = requests.post(url, headers=headers, files=files, data=data)
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('parse-output.md'));
form.append('schema', JSON.stringify({
type: 'object',
properties: {
revenue: { type: 'string', description: 'Q1 2024 revenue' }
}
}));
axios.post('https://api.ade.landing.ai/v2/extract', form, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY', ...form.getHeaders() }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));{
"extraction": {},
"extraction_metadata": {},
"markdown": "<string>",
"metadata": {
"job_id": "<string>",
"version": "<string>",
"duration_ms": 123,
"doc_id": "<string>",
"credit_usage": 0,
"billing": {
"total_credits": 123
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}ADE Extract
Extract structured data from a Markdown document according to a JSON schema, with character-span grounding into the source Markdown. Runs synchronously and returns the result inline.
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"}}}'import json
import requests
url = 'https://api.ade.landing.ai/v2/extract'
headers = {'Authorization': 'Bearer YOUR_API_KEY'}
files = {'markdown': open('parse-output.md', 'rb')}
data = {
'schema': json.dumps({
'type': 'object',
'properties': {
'revenue': {'type': 'string', 'description': 'Q1 2024 revenue'}
}
})
}
response = requests.post(url, headers=headers, files=files, data=data)
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('parse-output.md'));
form.append('schema', JSON.stringify({
type: 'object',
properties: {
revenue: { type: 'string', description: 'Q1 2024 revenue' }
}
}));
axios.post('https://api.ade.landing.ai/v2/extract', form, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY', ...form.getHeaders() }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));{
"extraction": {},
"extraction_metadata": {},
"markdown": "<string>",
"metadata": {
"job_id": "<string>",
"version": "<string>",
"duration_ms": 123,
"doc_id": "<string>",
"credit_usage": 0,
"billing": {
"total_credits": 123
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Input to V2ExtractOperationWorkflow.
Provide the markdown as an inline markdown string, as a multipart file
part named markdown (for large inputs — the gateway stages the upload
internally), or via a public markdown_url. Exactly one source must be
supplied.
JSON Schema describing the fields to extract. The schema must be an object type with a properties map of field names to their types and descriptions.
{
"properties": {
"revenue": {
"description": "Q1 revenue figure",
"type": "string"
},
"summary": {
"description": "Executive summary",
"type": "string"
}
},
"type": "object"
}Markdown string to extract from, or a multipart FILE part carrying the markdown (large inputs — uploads are staged by the gateway). Can come from any source — LandingAI parse output, a third-party parser, or hand-authored text. When the markdown was produced by POST /v2/parse, it ends with a <!-- doc_id=<id> --> comment that the service reads automatically and echoes as metadata.doc_id.
URL to fetch the markdown from. Must be a public http(s) URL; private/loopback IPs are rejected at submit time.
The version of the model to use for extraction. Use extract-latest to use the latest version.
Extraction options (strict). Omit for defaults.
Show child attributes
Show child attributes
Response
v2-extract result
Result returned by V2ExtractOperationWorkflow — the /v2/extract
response body (docs/extract-v2-proposal.md → Response).
extraction and extraction_metadata mirror each other structurally:
leaf values in extraction are replaced by ExtractionFieldMetadata
objects in extraction_metadata.
Extracted values conforming to the request schema.
Per-field metadata, mirroring extraction with leaf values replaced by {value, spans} objects.
Echoed input markdown.
Request metadata (job_id, version, duration_ms, doc_id, credit_usage).
Show child attributes
Show child attributes
Was this page helpful?