Canonical & Headings Extractor API
Build table-of-contents previews, deduplicate syndicated URLs via canonical_url, and analyze outbound citation graphs without spinning up browsers.
Why engineering teams use EdgeDocAPI
- Ordered headings array [{ level, text }] up to 200 headings per page
- Automatic canonical_url resolution even for relative <link rel='canonical'> tags
- Deduplicated outbound_links with anchor text, rel attributes, and external boolean
Copy-Paste Integration (/v1/extract-metadata)
curl -X POST https://api.docopsapi.com/v1/extract-metadata \
-H "Authorization: Bearer edk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"html":"<html><head><link rel='\''canonical'\'' href='\''https://example.com/post'\''/></head><body><h1>Title</h1><h2>Details</h2></body></html>"}'import requests
resp = requests.post(
"https://api.docopsapi.com/v1/extract-metadata",
headers={"Authorization": "Bearer edk_live_YOUR_API_KEY"},
json={
"html": "<html><head><link rel='canonical' href='https://example.com/post'/></head><body><h1>Title</h1><h2>Details</h2></body></html>"
},
timeout=15,
)
resp.raise_for_status()
print(resp.json())const res = await fetch("https://api.docopsapi.com/v1/extract-metadata", {
method: "POST",
headers: {
"Authorization": "Bearer edk_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"html": "<html><head><link rel='canonical' href='https://example.com/post'/></head><body><h1>Title</h1><h2>Details</h2></body></html>"
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);