Extract text from an image (upload, URL or base64)

Extracts the text from an image, line by line (or word by word with positions), with a confidence score.

Request

POSThttps://ocr-image-to-text.p.apihiver.com/v1/extract

Upload the image in the file field (max 25 MB). Instead of a file you can send JSON: {"url": "https://…"} for a public image URL, or {"base64": "…"} — the options below then go in the same JSON object.

*
No file chosen
File. The image file (JPG, PNG, WebP, GIF, BMP or TIFF).
String. OCR language(s): eng, hin, mar; combine with +, e.g. eng+hin.
String. lines (default) or words (with each word's position and confidence).

Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.

Language
Client
1curl --request POST \
2  --url https://ocr-image-to-text.p.apihiver.com/v1/extract \
3  --header 'Accept: application/json' \
4  --header 'X-API-Key: YOUR_API_KEY' \
5  --header 'content-type: multipart/form-data' \
6  --form file=@file.bin \
7  --form lang=eng \
8  --form layout=lines

Extract text from an image (upload, URL or base64): OCR API — Image to Text reference

Extracts the text from an image, line by line (or word by word with positions), with a confidence score. This endpoint is part of the OCR API — Image to Text: Extract text from images and scans in English, Hindi and Marathi, and pull out emails, phone numbers, URLs, PAN and GSTIN.

Example response (200, application/json)

Success.

1{
2  "text": "Invoice from APIHiver\nEmail: [email protected]\n\nPhone: +91 98765 43210",
3  "image": {
4    "width": 900,
5    "height": 300
6  },
7  "language": "eng",
8  "word_count": 9,
9  "average_confidence": 92.4
10}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "Provide a file upload, 'url', or 'base64'."
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.