API URL
POST /api/v1/ocr/parse (POST)
Headers
Code
Content-Type: application/jsonBody Parameters
Param
Type
Description
fileBase64
required
string
Base64-encoded document (max 10 MB decoded)
url
required
string
http(s) URL of document (SSRF-guarded max 10 MB 15s timeout)
filename
optional
string
Filename hint for logs and errors (detection uses magic bytes)
ocr
optional
boolean
Force OCR on PDFs with a text layer (default false)
language
optional
string
OCR language ISO 639-2/T from supported set (default eng)
Example Request
Code
POST https://datpaq.com/api/v1/ocr/parse?api_key=your-api-key | Body: {"fileBase64":"JVBERi0xLjQKMSAwIG9iaiA8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4gZW5kb2JqCjIgMCBvYmogPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4gZW5kb2JqCjMgMCBvYmogPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSAvQ29udGVudHMgNCAwIFIgL1Jlc291cmNlcyA8PCAvRm9udCA8PCAvRjEgNSAwIFIgPj4gPj4gPj4gZW5kb2JqCjQgMCBvYmogPDwgL0xlbmd0aCA2MSA+PiBzdHJlYW0KQlQgL0YxIDI0IFRmIDcyIDcwMCBUZCAoUHJvQVBJIE9DUiBzbW9rZSB0ZXN0IGRvY3VtZW50KSBUaiBFVAplbmRzdHJlYW0gZW5kb2JqCjUgMCBvYmogPDwgL1R5cGUgL0ZvbnQgL1N1YnR5cGUgL1R5cGUxIC9CYXNlRm9udCAvSGVsdmV0aWNhID4+IGVuZG9iagp4cmVmCjAgNgowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTE1IDAwMDAwIG4gCjAwMDAwMDAyNDEgMDAwMDAgbiAKMDAwMDAwMDM1MiAwMDAwMCBuIAp0cmFpbGVyIDw8IC9TaXplIDYgL1Jvb3QgMSAwIFIgPj4Kc3RhcnR4cmVmCjQyMgolJUVPRgo=","filename":"report.pdf"}Successful Response
Status
HTML
200 OKBody
Code
{
"success": true,
"format": "pdf",
"markdown": "Quarterly report…",
"text": "Quarterly report…",
"tables": [
[
[
"quarter",
"revenue"
],
[
"Q1",
"1.2M"
]
]
],
"meta": {
"pages": 4,
"hasTextLayer": true,
"ocrUsed": false,
"source": "base64",
"sizeBytes": 48211,
"language": "eng",
"durationMs": 212
},
"correlationId": "req_abc123",
"metadata": {
"correlationId": "req_abc123",
"timestamp": "2026-10-13T12:00:00.000Z",
"processingTime": "212ms",
"api_token_name": null,
"rate_limit": {
"limit": null,
"remaining": null,
"reset": null
}
},
"updatedAt": "2026-10-13T12:00:00.000Z"
}Field
Type
success
boolean
format
string
markdown
string
text
string
tables
array
meta_pages
number
meta_hasTextLayer
boolean
meta_ocrUsed
boolean
meta_ocrPages
number
meta_ocrConfidence
number
meta_source
string
meta_sizeBytes
number
meta_language
string
meta_durationMs
number
meta
object
correlationId
string
metadata
object
metadata_correlationId
string
metadata_timestamp
string
metadata_processingTime
string
metadata_api_token_name
string
metadata_rate_limit
object
status
string
service
string
version
string
error
object
reason
string
updatedAt
string
Error Response
Example
Code
HTTP 400 ValidationError: Missing/both inputs invalid base64/URL/language unsupported format empty file or SSRF-blocked URL — Request rejected before any parsing; HTTP 400 InvalidJson: Malformed JSON request body — Request body parser returns invalid-json; HTTP 401 AuthenticationError: Gateway authentication failure — Request rejected due to missing or invalid API credentials; HTTP 404 NotFound: Unknown endpoint path — Request path does not map to available ocr routes; HTTP 413 PayloadTooLarge: Decoded document over 10 MB or body over 15 MB envelope — Size caps enforced before parsing; HTTP 422 UnprocessableDocument: Allowlisted document could not be parsed or OCR timed out — Document accepted but extraction failed; HTTP 429 RateLimitError: More than 120 requests in 15 minutes — Request rejected by service rate limiter; HTTP 502 UpstreamError: Document URL fetch failed timed out or returned error status — Remote document could not be retrieved; HTTP 500 InternalError: Unexpected parsing failure — Document parse could not completeLast Updated: May 4, 2026