API
Create a bearer API keyInvoice OCR API
REST endpoint for invoice OCR — digital PDFs, scans, and phone photos. Returns the same typed JSON schema as the invoice extractor. Authenticate with a bearer API key created on the developers page.
Prefer the browser? Try the free invoice extractor. API access requires a paid plan.
Quick start
# Create a key at extractfox.com/developers, then:
curl -X POST https://extractfox.com/api/v1/extractions \
-H "Authorization: Bearer efk_live_..." \
-H "Content-Type: application/json" \
-d '{"mode":"prebuilt","schema_id":"invoice","url":"https://example.com/invoice.pdf"}'Example response
{
"id": "job_9f3c1a7b2d4e8c05",
"object": "extraction",
"status": "succeeded",
"mode": "prebuilt",
"schema_id": "invoice",
"source": { "kind": "url", "name": "invoice.pdf" },
"result": {
"vendor": "Acme Supplies Ltd.",
"invoice_number": "INV-00284",
"issue_date": "2026-04-12",
"due_date": "2026-05-12",
"currency": "USD",
"line_items": [
{
"description": "A4 paper, 80gsm",
"quantity": 12,
"unit_price": 4.5,
"amount": 54.0
}
],
"subtotal": 232.0,
"tax": 46.4,
"total": 278.4
},
"empty": false,
"empty_fields": [],
"error": null,
"quota": { "used": 1, "limit": 300, "remaining": 299, "reason": "ok", "plan": "pro" }
}Request fields
| Field | Description |
|---|---|
| mode | prebuilt |
| schema_id | invoice |
| file | Object with base64 data, media_type, and name — PDF or image (PNG, JPEG, WEBP, HEIC), up to 3 MB inline. Scanned and photographed invoices supported. |
| url | Link to the invoice instead of inline data — fetched as a file (PDF up to 50 MB, image up to 20 MB). |
| async | Set true to get a 202 and poll GET /api/v1/extractions/{id} for the result. |
Errors & limits
- 400Invalid JSON body — missing source, unknown schema_id, or more than one of file/url/text.
- 401Missing or revoked API key.
- 402Monthly extraction quota exhausted — upgrade or wait for reset.
- 413Inline file over 3 MB — host the document and pass its url instead (PDF up to 50 MB, image up to 20 MB).
- 415Unsupported media_type — use PDF or image.
- 429Rate limit — max 60 extraction calls/minute per IP.
Monthly extraction quotas apply per plan. See pricing and the general developers docs.
FAQ
Is this an invoice OCR service or an API?+
Both — the web invoice extractor is the no-code interface; this page documents the same extraction as a REST call for AP pipelines and ERP ingest.
Does the invoice OCR API work on scans and photos?+
Yes. Pass the same PDF or image you would upload in the browser. Multimodal extraction reads layout semantically — no per-supplier template training.
How do I authenticate?+
Create an API key on extractfox.com/developers and send it in the Authorization header as Bearer efk_live_… Keys are shown once, can be revoked there, and work for server-to-server calls and the MCP endpoint.
What does invoice OCR AI change vs classic OCR?+
Template OCR returns flat text per coordinate. Invoice OCR AI returns structured fields and line_items[] in one response — new supplier layouts work without retraining.