What file types can I send?
PDF, DOCX, PNG, JPEG, WebP, BMP, and GIF. Format is detected from magic bytes, not the filename. TIFF and XLSX are out of scope for v1.
Parse PDFs, DOCX, and images into markdown, plain text, and tables. Scans OCR automatically. Nothing leaves Datpaq infrastructure.
This posts a tiny canned PNG (a few hundred bytes) to POST /parse. Click to run; OCR can take a few seconds. Huge markdown is truncated in the preview.
A 220x37 pixel bitmap that reads DATPAQ OCR DEMO. The proxy injects the base64 so the browser never uploads a freeform file.
Run the request to OCR a tiny canned PNG (DATPAQ OCR DEMO).
Why OCR API
Automatic scan OCR
Born-digital PDFs use the text layer. Empty layers rasterize and OCR the first 10 pages.
DOCX to GFM markdown
Headings and tables survive conversion so RAG pipelines get structured markdown, not a blob.
Images with confidence
PNG, JPEG, WebP, BMP, and GIF run through tesseract.js with a mean confidence score.
Tables as arrays
PDF tables are best-effort; DOCX tables are exact row/cell arrays.
20 OCR languages
Pass language as an ISO 639-2/T code. Default is eng.
Self-hosted bytes
Documents are not stored or forwarded. URL fetches are SSRF-guarded and capped at 10 MB.
/api/v1/ocr
Parse document
Exactly one of fileBase64 or url. Returns markdown, text, tables, and parse metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
| fileBase64 | string | one of | Base64-encoded document, max 10 MB decoded. |
| url | string | one of | http(s) URL, SSRF-guarded, 10 MB and 15 second fetch cap. |
| filename | string | no | Hint for logs. Detection uses magic bytes, not the name. |
| ocr | boolean | no | Force OCR on PDFs that already have a text layer. Default false. |
| language | string | no | OCR language ISO 639-2/T from the supported set. Default eng. |
Error reference
Missing or both inputs, invalid base64 or URL, unsupported format, or SSRF-blocked URL.
Missing or invalid gateway API key. Send x-api-key or api_key with every request.
Decoded document over 10 MB, or JSON envelope over 15 MB.
Allowlisted document could not be parsed, or OCR timed out.
More than 120 requests in a 15-minute window.
Document URL fetch failed, timed out, or returned an error status.
Example error response
{
"success": false,
"error": { "code": "VALIDATION_ERROR", "message": "Invalid input parameters" },
"reason": "unsupported-format",
"correlationId": "req_abc123"
}FAQ
PDF, DOCX, PNG, JPEG, WebP, BMP, and GIF. Format is detected from magic bytes, not the filename. TIFF and XLSX are out of scope for v1.
Images always OCR. PDFs OCR when there is no usable text layer, or when you set ocr=true to force it. Scanned PDFs are capped at the first 10 pages.
No. Parsing is self-hosted. Bytes and extracted text are not logged, stored, or sent to a third-party OCR vendor.
Yes. Send url for an SSRF-guarded fetch with a 10 MB and 15 second cap. Exactly one of fileBase64 or url is required.
Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.
Self-hosted PDF, DOCX, and image parsing with tables preserved and OCR that stays on Datpaq infrastructure.