v2
API Reference
Complete documentation for the DocDigitizer Document Extraction API v2.
Authentication
All API requests require a Bearer token in the Authorization header. Get your key from customerportal.docdigitizer.com — no credit card required.
Tip Keep your API key secret. Never expose it in client-side code or commit it to version control. Use environment variables.
header
Authorization: Bearer dd-YOUR_API_KEY
Base URL
Requests must use HTTPS. HTTP requests are rejected. All responses are JSON.
POST /extract
Extract structured data from a document. Send a file via multipart form data and receive a JSON object with all extracted fields. Supports 371+ document types.
Parameters
| Parameter | Type | Description |
|---|---|---|
file required | file | The document to extract. Accepted formats: PDF, PNG, JPG, JPEG, TIFF, BMP, WEBP. Max size: 50 MB. |
schema optional | string | A JSON Schema string defining the fields to extract. When omitted, DocDigitizer auto-detects the document type and extracts all known fields. |
Code Examples
curl
$ curl -X POST https://api.docdigitizer.com/v2/extract \
-H "Authorization: Bearer dd-YOUR_API_KEY" \
-F "file=@invoice.pdf"Response — 200 OK
200 OK · application/json
{
"id": "ext_01HVX8M3K2P5Q7N9R4T6W0Y",
"type": "invoice",
"credits_used": 1,
"processing_time_ms": 2318,
"data": {
"vendor": "Acme Corp",
"vendor_vat": "PT123456789",
"invoice_number": "INV-2026-0847",
"date": "2026-02-15",
"due_date": "2026-03-15",
"subtotal": 1033.06,
"tax": 216.94,
"total": 1250.00,
"currency": "EUR",
"line_items": [
{ "description": "API credits", "quantity": 5000, "unit_price": 0.25, "total": 1250.00 }
]
}
}Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | invalid_file | File format not supported, corrupted, or missing. |
| 401 | unauthorized | Missing or invalid API key. |
| 413 | file_too_large | File exceeds the 50 MB limit. |
| 429 | rate_limit_exceeded | You've exceeded your plan's rate limit. Retry after the Retry-After header value. |
| 500 | extraction_failed | Internal extraction error. Failed extractions are never charged. |
Rate Limits
Rate limits apply per API key. When exceeded, the API returns 429 with a Retry-After header.
| Plan | Requests / min | Concurrent | Monthly credits |
|---|---|---|---|
| Free | 10 / min | 2 | 50 (one-time) |
| Hobby | 60 / min | 5 | 500 / month |
| Standard | 60 / min | 20 | 5,000 / month |
| Enterprise | Custom | Custom | Custom |
Tip Failed extractions (HTTP 5xx) are never charged and do not count towards your rate limit.
SDKs
Official SDKs with full TypeScript support, automatic retries, and progress callbacks.
| SDK | Install | Version |
|---|---|---|
| Python | pip install docdigitizer | 2.1.0 |
| Node.js | npm install docdigitizer | 1.2.0 |
| CLI | pip install docdigitizer | 2.1.0 |