POST/v1/extract
Read a PDF: text per page, markdown for LLMs, form fields with their options, and document facts
Pick what to read with include. Pages with no text layer (scans) are listed in ocr_needed instead of coming back as silent empty strings; OCR is not offered yet. Use include fields before POST /v1/fill to learn a form's field names. Nothing is stored.
REQUEST BODY · APPLICATION/JSON · REQUIRED
{
"file": "https://example.com/contracts/acme-msa.pdf",
"include": [
"markdown",
"meta"
]
}
REQUEST
curl -X POST "https://api.pdfedge.com/v1/extract" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": "https://example.com/contracts/acme-msa.pdf",
"include": [
"markdown",
"meta"
]
}'
import requests
r = requests.post("https://api.pdfedge.com/v1/extract", headers={"X-API-Key": "YOUR_KEY"}, json={
"file": "https://example.com/contracts/acme-msa.pdf",
"include": [
"markdown",
"meta"
]
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.pdfedge.com/v1/extract", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"file": "https://example.com/contracts/acme-msa.pdf",
"include": [
"markdown",
"meta"
]
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200OK
{
"object": "extraction",
"source": "fil_8kq2wzm4tnb7hdc3vrex",
"pages": 2,
"text": [
{
"page": 1,
"text": "Master Services Agreement\nBetween Acme Inc. and …"
},
{
"page": 2,
"text": ""
}
],
"ocr_needed": [
2
],
"meta": {
"title": "Master Services Agreement",
"author": "Acme Legal",
"pages": 2,
"page_sizes": [
{
"page": 1,
"width": 612,
"height": 792,
"rotation": 0
}
],
"pdf_version": "1.7",
"encrypted": false,
"form": false,
"xfa": false,
"tagged": true
},
"units": 1
}
404No such file on this account, or it has expired
{
"error": "string",
"message": "string",
"param": "string"
}