Guides
Extract a document
Extract structured data from PDFs, images, and DOCX files.
The POST /api/v1/extract endpoint accepts a single file and returns structured
data. dOCR automatically picks the right pipeline for the file you send.
PDFs
Digital PDFs (with a text layer) are parsed directly — fast and exact.
curl https://app.docr.dev/api/v1/extract \
-H "Authorization: Bearer $DOCR_API_KEY" \
-F "file=@invoice.pdf" \
-F "documentType=Invoice"Scanned PDFs (no text layer) are detected automatically and read with a vision model — no extra parameters needed.
Images
JPG, PNG, BMP, and WebP images are read with a vision model. This is ideal for photos of receipts, IDs, and other documents.
curl https://app.docr.dev/api/v1/extract \
-H "Authorization: Bearer $DOCR_API_KEY" \
-F "file=@drivers-license.jpg" \
-F "documentType=Driver's License"DOCX
Word documents are converted to text and extracted.
curl https://app.docr.dev/api/v1/extract \
-H "Authorization: Bearer $DOCR_API_KEY" \
-F "file=@statement.docx" \
-F "documentType=Bank Statement"The response
Every extraction returns the same shape regardless of input format:
{
"extraction": {
"status": "completed",
"documentTypeName": "Invoice",
"confidence": 0.98,
"pagesProcessed": 1,
"outputJson": {
"documentType": "Invoice",
"fields": { "vendorName": "…", "total": 729.61 }
}
}
}Limits: 10 MB and 15 pages per document. Larger files return 422.