# Image to Text OCR - Extract Text From Images & Screenshots (`appdata-labs/image-to-text-ocr`) Actor

Extract the text from any list of image URLs: screenshots, scans, receipts, signs, slides. Returns the full text, a confidence score and word count per image, optionally every line with its position. 20 languages, long text split into agent-sized rows. Pay only for images with text.

- **URL**: https://apify.com/appdata-labs/image-to-text-ocr.md
- **Developed by:** [Kobkoon Janngam](https://apify.com/appdata-labs) (community)
- **Categories:** Agents, MCP servers, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 — extract text from images and screenshots

**Read the text in any list of images.** Paste image URLs (screenshots, scanned pages, receipts, slides, signs) and get one row per image: the full text, a confidence score and a word count. Optionally, every line comes with its position. Built for data pipelines and AI agents.

**Quick start:** press **Start** with no configuration. It reads eleven sample images in six formats, from a one-word logo to a newspaper column, so you can see every kind of row. Then paste your own links.

### Sample output

| fileName | format | status | confidence | wordCount | text |
|---|---|---|---|---|---|
| testocr.png | png | ok | 94 | 60 | This is a lot of 12 point text to test the ocr code… |
| bill.png | png | ok | 83 | 97 | FIRST CHEQUING · Line of Credit 100,000.00 Rate 4.2… |
| cosmic.png | png | ok | 88 | 7 | HellO World from beyond the Cosmic Void |
| eurotext.tif | tiff | ok | 92 | 66 | The (quick) \[brown] {fox} jumps! Over the $43,456.78… |
| simple.webp | webp | ok | 91 | 1 | Tesseract.js |

These rows come from the default run on 30 October 2026. They are real output, including the mistakes: "HellO" is how OCR read a decorative font.

Every row also carries `url`, `lineCount`, `chunk`/`chunkCount`, and a plain-English `note` when something went wrong. With **Include each line with its position**, each row also gets `lines`, a list of `{ text, confidence, box: { x, y, width, height } }` entries.

### What you can do with it

- **Feed screenshots to an AI agent.** It gets text instead of pixels, and each row fits in its context.
- **Digitise scans and receipts.** Turn a folder of image links into searchable text.
- **Read text on product photos, menus and slides** for search, translation or moderation.
- **Find where text sits.** Line boxes let you highlight it, redact it or crop around it.

### Input

| Field | Default | Notes |
|---|---|---|
| `imageUrls` | 11 samples | PNG, JPEG, WebP, GIF, BMP, TIFF or PNM. Up to 25 MB each and 500 per run. Each link must open without signing in. |
| `languages` | `eng` | 20 languages, including Spanish, German, French, Japanese, Chinese, Arabic, Hindi and Thai. Combine them for mixed text. |
| `maxTextBytesPerRow` | `3000` | Long text is split across rows at paragraph breaks, which suits agents and RAG pipelines. `0` keeps each image's text in one row. |
| `includeLines` | `false` | Adds each line with its confidence and bounding box. |

### Every image gets a row that says what happened

| status | Meaning | Charged |
|---|---|---|
| `ok` | Text was found | Yes, once per image |
| `no-text` | The image was read but contains no readable text | No |
| `not-an-image` | The link is a PDF or a web page. Use [pdf-text-extractor](https://apify.com/appdata-labs/pdf-text-extractor) for PDFs | No |
| `download-failed` | The link is dead or private, with the HTTP reason | No |
| `unreadable` | The file could not be decoded | No |

One bad link never fails the run. The run fails only when none of the images could be read at all.

### How it works

OCR is done by Tesseract, compiled to WebAssembly, and it runs inside the Actor. There is no browser, no API key and no third-party OCR service, and nothing leaves the run except the download of your own files. A slightly skewed scan is straightened before reading. A page that is turned on its side is not.

Accuracy depends on the image. Clean printed text at a normal size reads at 90%+ confidence. Handwriting, very small text and stylised fonts read poorly, and the `confidence` field tells you which rows to trust.

### Pricing

You pay per image in which text was found. Images with no text and links that fail cost nothing.

### Works well with

Same publisher, same output conventions, same honest-failure rules:

- [**pdf-text-extractor**](https://apify.com/appdata-labs/pdf-text-extractor) — Page-by-page text from any PDF, with OCR for scanned pages.

### Disclaimer

This Actor reads only the files you link to: it scrapes no website and calls no third-party API — the OCR engine runs inside the Actor. Make sure you have the right to process the files you submit.

# Actor input Schema

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

Links to the images to read: PNG, JPEG, WebP, GIF, BMP, TIFF or PNM, up to 25 MB each and 500 per run. The link must open without signing in. A bad entry is skipped with a reason; the rest still run.

## `languages` (type: `array`):

The language(s) of the text, as Tesseract codes. English is built in and fastest; other languages load on first use. Pick more than one only for mixed-language documents — each extra language slows reading.

## `maxTextBytesPerRow` (type: `integer`):

Long text is split across several rows of at most this many bytes, at paragraph and line breaks, so each row fits an AI agent's context and drops straight into a RAG pipeline. The image is still charged once. 0 keeps each image whole in one row.

## `includeLines` (type: `boolean`):

Off by default: one row per image with its full text. On: each row also lists every line with its confidence and bounding box (x, y, width, height in pixels) — useful for receipts, forms and highlighting.

## Actor input object example

```json
{
  "imageUrls": [
    "https://example.com/receipt.jpg",
    "https://example.com/screenshot.png"
  ],
  "languages": [
    "eng",
    "deu"
  ],
  "maxTextBytesPerRow": 3000,
  "includeLines": true
}
```

# Actor output Schema

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

Extract the text from any list of image URLs: screenshots, scans, receipts, signs, slides

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

What was requested, what was read, what was skipped and why.

# 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/bill.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/cosmic.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/escape_chars.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.jpg",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.webp",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.gif",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple-90.jpg",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/eurotext.tif",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/8071_093.3B.tif"
    ],
    "languages": [
        "eng"
    ],
    "maxTextBytesPerRow": 3000,
    "includeLines": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("appdata-labs/image-to-text-ocr").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/bill.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/cosmic.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/escape_chars.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.jpg",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.webp",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.gif",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple-90.jpg",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/eurotext.tif",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/8071_093.3B.tif",
    ],
    "languages": ["eng"],
    "maxTextBytesPerRow": 3000,
    "includeLines": False,
}

# Run the Actor and wait for it to finish
run = client.actor("appdata-labs/image-to-text-ocr").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/bill.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/cosmic.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/escape_chars.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.jpg",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.webp",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.gif",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple-90.jpg",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/eurotext.tif",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/8071_093.3B.tif"
  ],
  "languages": [
    "eng"
  ],
  "maxTextBytesPerRow": 3000,
  "includeLines": false
}' |
apify call appdata-labs/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

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

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/oFnGIH6k19G7Bx2h3/builds/d1pFwz5vJEKhbi8jd/openapi.json
