---
title: "Read the text from an image (OCR)"
method: POST
path: "/image-ocr"
tags: ["Images"]
---

# Read the text from an image (OCR)

`POST /image-ocr`

## Request

- Base URL: `https://api.cofferdock.com`
- URL: `https://api.cofferdock.com/image-ocr`
- Auth: API key in header `x-api-key`

Extracts text from a photo or screenshot using Tesseract, hosted by us (no third-party AI provider). Works best on clean printed text; handwriting or blurry photos give worse results. Only eng and spa are supported today.

Costs 1 credit per call.

## Request body

- object
  - `file` string, byte, required: The image to read the text from, base64-encoded (e.g. PNG or JPEG).
  - `language` 'eng' | 'spa': Language of the text in the image: "eng" (English, default) or "spa" (Spanish). Pick the one that matches the text.

## Response `200`

Result.

- object
  - `success` boolean
  - `text` string
  - `confidence` integer
  - `meta` object
    - `language` string
    - `used` integer: Credits used this month, after this call.
    - `remaining` integer, nullable: Credits left this month (null = unlimited).
    - `unlimited` boolean

## Other responses

- `400`: Invalid input (nothing is charged).
- `401`: Missing or invalid API key.
- `403`: Email not verified.
- `429`: Monthly credit limit reached, or too many requests per minute for this key (see Retry-After).
- `503`: Server busy (queue full). Retry after the seconds in the Retry-After header.

---

[API](https://skmtc.dev/cofferdock/apis/cofferdock-api.md) · [All operations](https://skmtc.dev/cofferdock/apis/cofferdock-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cofferdock/apis/cofferdock-api/revisions/b57aa000d33a?raw)
