apyhub
DATA EXTRACTION · IMAGE PROCESSING

Advanced Image OCR API

What it does

Image OCR extracts text from an image and returns both the plain text and word-level OCR details. Send a binary image file, optionally set lang to a Tesseract language code such as eng, fra, deu, or spa, and get structured text extraction back.

Use Image OCR when you need to turn screenshots, scans, photos of documents, or labels into machine-readable text. The response includes text, word_count, and a words array with each word's text, bounding box coordinates (x, y, w, h), and confidence score from 0 to 100. That makes it useful for indexing documents, highlighting detected words on an image, or feeding OCR output into downstream parsing and validation.

Because the output is word-level, you can keep the extracted text for search or storage while also preserving layout hints for UI overlays and quality checks. If you need multilingual OCR, switch the language code to match the image content and keep the same response shape.

POST
Extract text from an image with word-level bounding boxes and confidence scores
https://api.eu.apyhub.com/dosvak/ocr-image

QUICKSTART

GUIDE

Quickstart

Upload an image file to extract its text using the default OCR language.

curl -X POST "https://api.eu.apyhub.com/dosvak/ocr-image" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.png" \
  -F "lang=eng"

What you'll get back

Returns a JSON object with text as a string, words as an array of word objects, and word_count as an integer.

Each word object can include h, w, x, y, conf, and text.

{
  "text": "Hello world",
  "words": [
    {
      "h": 18,
      "w": 52,
      "x": 120,
      "y": 84,
      "conf": 98,
      "text": "Hello"
    }
  ],
  "word_count": 2
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Tesseract language code (e.g. eng, fra, deu, spa)

About this endpoint

What it does

Extracts text from an uploaded image and returns the recognized full text, plus word-level bounding boxes and confidence scores for each detected word.

Request Body

ParameterTypeMandatoryDescription
fileStringYesImage file to OCR. Binary upload.
langStringNoTesseract language code. Default: eng. Examples mentioned in the schema: eng, fra, deu, spa.

Response

Returns a JSON object with text as a string, words as an array of objects, and word_count as an integer. text contains the recognized text, words contains the per-word OCR results with position and confidence data, and word_count is the number of detected words.

ParameterTypeMandatoryDescription
textStringNoThe recognized text from the image.
wordsObject ArrayNoWord-level OCR results. Each item includes: x, y, w, h as integers for the bounding box, conf as an integer confidence score from 0 to 100, and text as the recognized word text.
word_countIntegerNoTotal number of detected words.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.