import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
url = 'https://api.va.landing.ai/v1/ade/section'
# Prepare files and data
files = {'markdown': open('parsed_output.md', 'rb')}
data = {
'model': 'section-latest'
}
# Run section classification
response = requests.post(url, files=files, data=data, headers=headers)
# Return the results
print(response.json())curl -X POST 'https://api.va.landing.ai/v1/ade/section' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'markdown=@parsed_output.md' \
-F 'model=section-latest'const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('markdown', fs.createReadStream('parsed_output.md'));
form.append('model', 'section-latest');
axios.post('https://api.va.landing.ai/v1/ade/section', form, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));{
"table_of_contents": [
{
"title": "<string>",
"level": 123,
"section_number": "<string>",
"start_reference": "<string>"
}
],
"table_of_contents_md": "<string>",
"metadata": {
"filename": "<string>",
"duration_ms": 123,
"credit_usage": 123,
"org_id": "<string>",
"job_id": "",
"version": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}ADE Section
Section parsed markdown into a hierarchical table of contents.
This endpoint accepts the markdown output from /ade/parse (with reference anchors) and returns a flat, reading-order list of sections with hierarchy levels and reference ranges.
For EU users, use this endpoint:
https://api.va.eu-west-1.landing.ai/v1/ade/section.
import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
url = 'https://api.va.landing.ai/v1/ade/section'
# Prepare files and data
files = {'markdown': open('parsed_output.md', 'rb')}
data = {
'model': 'section-latest'
}
# Run section classification
response = requests.post(url, files=files, data=data, headers=headers)
# Return the results
print(response.json())curl -X POST 'https://api.va.landing.ai/v1/ade/section' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'markdown=@parsed_output.md' \
-F 'model=section-latest'const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('markdown', fs.createReadStream('parsed_output.md'));
form.append('model', 'section-latest');
axios.post('https://api.va.landing.ai/v1/ade/section', form, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));{
"table_of_contents": [
{
"title": "<string>",
"level": 123,
"section_number": "<string>",
"start_reference": "<string>"
}
],
"table_of_contents_md": "<string>",
"metadata": {
"filename": "<string>",
"duration_ms": 123,
"credit_usage": 123,
"org_id": "<string>",
"job_id": "",
"version": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
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
Request model for section endpoint.
Parsed markdown with reference anchors ( [blocked]). This is the markdown field from a parse response.
URL to fetch the markdown from.
Natural-language instructions to control hierarchy. Examples: 'Group by topic', 'Treat each numbered section as a top-level entry'.
Section model version. Defaults to latest.
Was this page helpful?