1. OCR
OCR API
  • Valitract Public API v1
    • OCR
      • Extract text/content from an image
        POST
      • Extract tables from an image
        POST
      • Check remaining credits
        GET
    • Schemas
      • ExtractionSuccess
      • ApiError
  1. OCR

Extract text/content from an image

POST
/v1/extract-generic
Runs generic OCR on an uploaded image and returns the generated files (html / markdown / json by default). Consumes 1 credit on success.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params multipart/form-dataRequired

Responses

🟢200
application/json
Extraction succeeded
Bodyapplication/json

🟠401Unauthorized
🟠402InsufficientCredits
🟠422ValidationError
🔴500ExtractionError
Request Request Example
Shell
JavaScript
Java
Swift
curl --location '/v1/extract-generic' \
--header 'Authorization: Bearer <token>' \
--form 'file=@""' \
--form 'formats="html,markdown,json"'
Response Response Example
200 - Success
{
    "success": true,
    "data": {
        "files": {
            "html": "https://d36og1p9lvqwg0.cloudfront.net/ocr/results/abc123.html",
            "markdown": "https://d36og1p9lvqwg0.cloudfront.net/ocr/results/abc123.md",
            "json": "https://d36og1p9lvqwg0.cloudfront.net/ocr/results/abc123.json"
        },
        "confidence": 0.97
    },
    "credits_remaining": 41,
    "processing_time": 3.512
}
Modified at 2026-07-18 10:58:45
Next
Extract tables from an image
Built with