Documentation

API URL


POST /api/v1/ocr/parse (POST)

Headers
Code
Content-Type: application/json
Body Parameters


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 OK
Body
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"
}

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 complete

Last Updated:  May 4, 2026