# Image to Text OCR: Text, Lines and Confidence (`praise-most-high/image-ocr-text`) Actor

Reads each image URL you list once and returns the text found in it, with per-line confidence and positions. Tesseract OCR runs inside the Actor: no outside API, no key. English, PNG, JPEG, WebP and BMP.

- **URL**: https://apify.com/praise-most-high/image-ocr-text.md
- **Developed by:** [angel nguyen](https://apify.com/praise-most-high) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 image reads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Image to Text OCR: Text, Lines and Confidence

Turn image to text with an OCR API you call like any other Apify Actor: give it a list of image URLs and it will extract text from images in bulk, one row per image. This bulk OCR runs inside the Actor with Tesseract, so no image leaves the run for an outside service and you need no key.

### What this Actor returns

Reads each image you list once, runs Tesseract OCR inside the Actor with no outside API or key, returns the text with per-line confidence and positions, charges per image with text and no run fee of its own, and gives every failed image an error row that says why.

Each image gives one row with the full text, the line and word counts, a mean confidence from 0 to 100, and up to 500 lines, each with its own confidence and pixel box. You can feed the rows straight into a spreadsheet, a search index or an AI agent.

Version 0.1 reads English only and accepts PNG, JPEG, WebP and BMP images.

Images belong to their owners, as do the words read off them, and you are responsible for using the output under those owners' terms.

The Actor keeps no copy of any image and writes no extracted text to its log.

### Input

The happy path needs one field:

```json
{ "imageUrls": ["https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png"] }
```

The full example input, which is the form's prefill:

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/bill.png"
  ],
  "maxImages": 3
}
```

| Field | Type | Required | Meaning |
|---|---|---|---|
| imageUrls | array of strings | yes | Absolute http or https image URLs, 1 to 500 per run. |
| maxImages | integer | no | Read at most this many unique URLs, in input order (1 to 500, default 50). |

A repeated URL is read once. URLs past maxImages get no request.

### Output

| Field | Type | Meaning |
|---|---|---|
| imageUrl | string | The image URL as given (error row: the URL that failed, or empty). |
| finalUrl | string | The URL after redirects. |
| httpStatus | integer or null | The final HTTP status (error row: null when none). |
| imageType | string | png, jpeg, webp or bmp, read from the first bytes of the file. |
| imageBytes | integer | Size of the image in bytes. |
| language | string | OCR language: eng. |
| text | string | The recognized text, trailing spaces and trailing blank lines removed. |
| textLength | integer | Length of text in Unicode code points. |
| lineCount | integer | Number of text lines found. |
| wordCount | integer | Number of words found. |
| meanConfidence | number | Mean recognition confidence, 0 to 100. |
| lines | array of objects | Up to 500 lines: text, confidence, x0, y0, x1, y1. |
| sourceUrl | string | The URL the image was read from. |
| checkedAt | string | UTC start time of the run. |
| error | boolean | Error rows only: true. |
| errorCode | string | Error rows only: the code below. |
| input | string | Error rows only: the input entry or field that failed. |
| errorMessage | string | Error rows only: why. |

A real row, from the simple.png example image:

```json
{"imageUrl":"https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png","finalUrl":"https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png","httpStatus":200,"imageType":"png","imageBytes":1305,"language":"eng","text":"Tesseract.js","textLength":12,"lineCount":1,"wordCount":1,"meanConfidence":91,"lines":[{"text":"Tesseract.js","confidence":91,"x0":82,"y0":76,"x1":216,"y1":99}],"sourceUrl":"https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png","checkedAt":"2026-11-23T18:20:35.885Z"}
```

Measured from our own machine on 2026-11-23: the example input gave 3 image rows and 0 error rows in a 3.3 second run (285, 12 and 709 characters of text; 8, 1 and 15 lines).

Every run also writes a SUMMARY record to its key-value store: requests, robots.txt reads, redirects, OCR seconds per image, error rows by code, duplicates and run seconds.

### Robots and pacing

- robots.txt is read once per host per run, before any image on that host, with the product token image-ocr-text.
- A path robots.txt disallows is never requested. A robots.txt that answers 5xx or does not answer blocks the whole host for that run.
- Crawl-delay is honoured up to 30 s; a host asking for more is not read.
- At least 1 s passes between two requests to one host. One request runs at a time.
- The User-Agent names this Actor: image-ocr-text/0.1.

### Errors

Every failed input or image gives one error row. Error rows are never charged.

| errorCode | When |
|---|---|
| NO_INPUT | imageUrls is empty or absent. |
| INVALID_INPUT | A URL is not absolute http or https, there are over 500, or maxImages is out of range. |
| ROBOTS_DISALLOWED | robots.txt disallows the path, or asks for a Crawl-delay over 30 s. |
| ROBOTS_UNREACHABLE | robots.txt answered 5xx or did not answer. |
| SOURCE_HTTP_ERROR | The image answered an error status, timed out, or redirected more than 5 times. |
| SOURCE_TOO_LARGE | The image is over 10 MB. |
| NOT_IMAGE | The file is not PNG, JPEG, WebP or BMP. |
| OCR_FAILED | The OCR engine could not read the file. |
| NO_TEXT | The image holds no readable text. |
| NO_RESULTS | No image row came out of the run. |

The run ends SUCCEEDED when at least one image row was delivered, and FAILED with a message naming the codes when none was.

### Pricing

- **0.0035 USD per image read** (3.50 USD per 1,000 images).
- Start charge: 0.00005 USD per started GB of run memory, at least one; at the default 1 GB that is 0.00005 USD per run.

Error rows, images with no text and duplicates are free.

### Use with the Apify MCP server and AI agents

An agent connected to the Apify MCP server can call this Actor as a tool: pass imageUrls, wait for the run, and read the dataset. Every row has the same flat fields, and errors arrive as rows with an errorCode, so an agent can tell a blank image from a broken link without parsing log text.

### Credits

- Tesseract OCR engine, used under the Apache License 2.0: https://raw.githubusercontent.com/tesseract-ocr/tesseract/main/LICENSE
- tessdata_fast English language data (eng.traineddata), used under the Apache License 2.0: https://raw.githubusercontent.com/tesseract-ocr/tessdata_fast/main/LICENSE
- tesseract.js, used under the Apache License 2.0: https://raw.githubusercontent.com/naptha/tesseract.js/master/LICENSE.md
- None of the three repositories has a NOTICE file at its root (read 2026-11-23).
- The example images come from the tesseract.js repository tests (Apache License 2.0).

### Support and feedback

Open an issue on the Issues tab. Issues are answered within 14 days.

# Actor input Schema

## `imageUrls` (type: `array`):

The images to read. Absolute http or https URLs of PNG, JPEG, WebP or BMP images, 1 to 500 per run. Each image is read once.

## `maxImages` (type: `integer`):

Read at most this many unique URLs, in input order (1 to 500). URLs past the limit get no request and are counted in the run SUMMARY as notDeliveredAfterLimit.

## Actor input object example

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/bill.png"
  ],
  "maxImages": 3
}
```

# Actor output Schema

## `rows` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/bill.png"
    ],
    "maxImages": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("praise-most-high/image-ocr-text").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "imageUrls": [
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/bill.png",
    ],
    "maxImages": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("praise-most-high/image-ocr-text").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/bill.png"
  ],
  "maxImages": 3
}' |
apify call praise-most-high/image-ocr-text --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,praise-most-high/image-ocr-text"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/36M1cI8p3IBCggHsF/builds/KNOxXtMjWwFA8O2Sk/openapi.json
