Getting Started
Quickstart
Make your first extraction in under five minutes.
This guide takes you from zero to a structured-data response.
1. Create an API key
Sign in to the dOCR dashboard, open Developers → API Credentials, and click Create API Key. Copy the key — it's shown only once and looks like:
docr_sk_xxxxxxxxxxxxxxxxxxxxxxxxStore the key as a secret (environment variable). Anyone with your key can use your account's quota. If a key leaks, revoke it from the dashboard.
2. Extract a document
Send a document to POST /api/v1/extract with your key in the Authorization
header. Pass documentType if you know it, or omit it to let dOCR auto-detect.
curl https://app.docr.dev/api/v1/extract \
-H "Authorization: Bearer $DOCR_API_KEY" \
-F "file=@invoice.pdf" \
-F "documentType=Invoice" \
-F "processingMode=highest_quality"const form = new FormData();
form.set("file", fileBlob, "invoice.pdf");
form.set("documentType", "Invoice");
const res = await fetch("https://app.docr.dev/api/v1/extract", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.DOCR_API_KEY}` },
body: form,
});
const { extraction } = await res.json();
console.log(extraction.outputJson.fields);import os, requests
with open("invoice.pdf", "rb") as f:
res = requests.post(
"https://app.docr.dev/api/v1/extract",
headers={"Authorization": f"Bearer {os.environ['DOCR_API_KEY']}"},
files={"file": f},
data={"documentType": "Invoice", "processingMode": "highest_quality"},
)
print(res.json()["extraction"]["outputJson"]["fields"])3. Read the response
{
"extraction": {
"id": "6a382443304f240b189f228a",
"status": "completed",
"documentTypeName": "Invoice",
"confidence": 0.98,
"pagesProcessed": 1,
"modelUsed": "anthropic/claude-opus-4-8",
"outputJson": {
"documentType": "Invoice",
"fields": {
"vendorName": "Northwind Traders LLC",
"invoiceNumber": "INV-2026-00842",
"invoiceDate": "June 14, 2026",
"total": 729.61
},
"confidence": 0.98,
"pagesProcessed": 1
}
}
}The fields object contains the values for the document type's fields. That's
it — you've extracted structured data from a document.