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
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| file | String | Yes | Image file to OCR. Binary upload. |
| lang | String | No | Tesseract 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.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | No | The recognized text from the image. |
| words | Object Array | No | Word-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_count | Integer | No | Total number of detected words. |