# Image to Text OCR: Screenshots, Scans & Photos in Bulk (`data-done-right/image-to-text-ocr`) Actor

Read text from images in bulk with Tesseract OCR: screenshots, scans and photos from image URLs in, text out with confidence and optional line boxes. 6 languages, no API key. Direct image links only; no PDFs or handwriting. Images with no text are free.

- **URL**: https://apify.com/data-done-right/image-to-text-ocr.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** Developer tools, Automation, Other
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.08 / 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: Screenshots, Scans & Photos in Bulk

Use this **image to text OCR** Actor to **extract text from images in bulk**: paste a list of image URLs (screenshots, scans, photos of documents or signs) and get one row per image with the recognized text, a confidence score and, if you want, every line with its pixel box. It runs the open-source Tesseract engine inside the Actor, so there is no API key and no per-call fee from a third-party OCR service.

**What it does NOT do (read this first)**

- It takes **direct links to image files** (JPEG, PNG, WebP, GIF, BMP, TIFF), not web pages and not PDFs. A page or a PDF is reported as failed or skipped with the reason. For PDFs use "Extract Text from PDF: OCR, PDF to Text & Markdown".
- **Printed text only.** It does not read handwriting, and it does not understand the content: there is no field extraction, invoice parsing or translation. You get text and positions.
- **6 languages**: English, Spanish, French, German, Portuguese, Italian (up to 3 at a time). No Chinese, Japanese, Arabic, Cyrillic or other scripts.
- Accuracy depends on the image. Clean, straight, high-contrast text is read very well; low resolution, heavy blur, strong skew, curved surfaces, stylised fonts and text over busy photos give errors. Each row carries a `confidence` (0-100) so you can find the weak ones. We did not benchmark it against Google or AWS OCR.
- It honours the host's **robots.txt** and does not log in, use proxies or work around hotlink protection. A 401, 403 or 429 is reported as failed; a URL that robots.txt disallows is skipped.
- Images above 64 megapixels and files above your size limit (15 MB by default, 50 MB at most) are refused. Images with a side above 6000 px are scaled down before OCR.

### What you get

- One dataset row per URL: `text`, `confidence` (average over words, 0-100), `charCount`, `wordCount`, `lineCount`, image size, `status` and a plain-language `note`.
- Optional `lines`: each line with its text, confidence and box (`left`, `top`, `width`, `height` in pixels of the original image).
- A `SUMMARY` record with totals and a `FAILED` record listing every URL that failed and why.
- You are **charged only for images where text was read**. Images without any text, failed, skipped and duplicate URLs are free.

### What can this OCR do

- **Read** JPEG, PNG, WebP, GIF (first frame), BMP and TIFF (first page). EXIF rotation is applied first, transparency is flattened onto white.
- **Preprocess** automatically (on by default): grayscale, speckle-noise removal, contrast stretch and a 2x enlargement for images smaller than 1000 px. Turn it off with `preprocess: none`.
- **Layout modes**: automatic (pages, articles, screenshots), one block, a single line, or sparse text (labels, signs, receipts, scattered words).
- **Languages**: pick one to three of `eng`, `spa`, `fra`, `deu`, `por`, `ita`. Mixed Spanish and English? Pick both.
- **Confidence filter**: `minConfidence` drops words Tesseract is unsure about.
- **Safe with bad input**: one bad URL never stops the run. Private, loopback and cloud-metadata addresses are refused.

### How to extract text from screenshots in bulk

1. Paste the image links in **Image URLs**, one per line.
2. Leave **Languages** on English, or choose the language(s) in the images.
3. Run it. Open the dataset and read the `text` column, or download CSV, JSON or Excel.

### How to get the position of every line of text

Turn on **Include per-line boxes**. Each row then has a `lines` array; every entry has `text`, `confidence`, `left`, `top`, `width` and `height` in pixels of the original image. Use it to highlight, redact or crop text regions.

### How to OCR a photo of a sign, label or receipt

Set **Page layout** to `sparse` (scattered words) or `line` (one cropped line), and raise **Minimum word confidence** (for example 50) to drop noise. Check `confidence` in the result: a low value means the text should be reviewed.

### How to read images in Spanish, French, German, Portuguese or Italian

Select the language(s) in **Languages**. The matching Tesseract language data is installed in the Actor image. If a language is missing in a build, the run stops with a clear message instead of returning wrong text.

### Input example

```json
{
  "urls": [
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
    "https://tesseract.projectnaptha.com/img/eng_bw.png"
  ],
  "languages": ["eng"],
  "layout": "auto",
  "preprocess": "auto",
  "includeLines": true
}
```

### Input

| Field | Default | What it does |
|---|---|---|
| `urls` | (required) | Direct image links, one per line. |
| `languages` | `["eng"]` | `eng`, `spa`, `fra`, `deu`, `por`, `ita`; at most 3. |
| `layout` | `auto` | `auto`, `block`, `line` or `sparse`. |
| `preprocess` | `auto` | `auto` (grayscale, denoise, contrast, enlarge small images) or `none`. |
| `includeLines` | `false` | Add per-line text, confidence and pixel boxes. |
| `minConfidence` | `0` | Drop words below this confidence (0-100). |
| `maxImages` | `100` | Maximum images per run (up to 5,000). Also caps cost. |
| `maxSourceSizeMb` | `15` | Refuse larger files (up to 50). |
| `concurrency` | `4` | Parallel downloads. OCR itself runs two images at a time. |

### Output

One row per URL (from a real local run, text shortened):

```json
{
  "index": 2,
  "sourceUrl": "https://tesseract.projectnaptha.com/img/eng_bw.png",
  "status": "extracted",
  "text": "Mild Splendour of the various-vested Night!\nMother of wildly-working visions! hail!\nI watch thy gliding, ...",
  "charCount": 352,
  "wordCount": 58,
  "lineCount": 8,
  "confidence": 94.6,
  "languages": "eng",
  "width": 1486,
  "height": 668,
  "error": null,
  "note": null,
  "lines": [
    { "text": "Mild Splendour of the various-vested Night!", "confidence": 94.7, "left": 38, "top": 34, "width": 1256, "height": 77 }
  ]
}
```

- `status`: `extracted` (text read, charged), `no_text` (nothing recognized, free), `skipped` (duplicate URL, `maxImages`, robots.txt, PDF, SVG, address not allowed, spending limit; free) or `failed` (download error, not an image, too many pixels, OCR timeout; free). `error` says why.
- `confidence` is the average word confidence reported by Tesseract. It is a hint, not a guarantee of correctness.
- `lines` is present only when `includeLines` is on.

### How much does it cost

Pay per event: **$0.0026 per image read** (event `image-ocr`, $2.60 per 1,000 images), plus the normal Apify platform usage of the run, which is small for typical images. Images with no text, failed and skipped URLs are free, and there is no start fee.

- 1,000 images: $2.60
- 10,000 images: $26.00
- 100,000 images: $260.00 (run it in batches of up to 5,000 images per run)

Set a maximum spending limit on the run: it stops cleanly when reached and the rest are reported as skipped.

### Use cases

- Turn a folder of screenshots (error messages, chats, dashboards) into searchable text.
- Digitise scanned letters, forms and printed pages before indexing or RAG.
- Read text from photos of signs, labels, packaging and shelf tags.
- Pre-filter an image set: keep only images that contain text (`no_text` rows are free).
- Add an OCR step to a pipeline: another Actor or an AI agent passes image URLs and reads `text` from the dataset.

### FAQ

**Does it read PDFs?**
No, only image files. A PDF link is skipped with a message. Use "Extract Text from PDF: OCR, PDF to Text & Markdown", which also OCRs scanned pages.

**Does it read handwriting?**
No. Tesseract is built for printed text. Handwriting gives mostly wrong output with a low `confidence`.

**How accurate is it?**
On clean printed text (we tested generated text images, skewed and noisy variants, and two public sample images) it reads almost every word. On blurry, tiny, curved or decorative text it makes mistakes. Always look at `confidence`. We have not compared it with paid cloud OCR services.

**Which languages are supported?**
English, Spanish, French, German, Portuguese and Italian, up to three per run. Other scripts are not installed.

**What happens to a URL that robots.txt disallows?**
It is skipped with the reason and not charged. If a host's robots.txt cannot be read because of a server error, its images are skipped too rather than guessed.

**Am I charged when no text is found?**
No. Only images with recognized text (`status: extracted`) are charged.

**Can it take a web page and find the images?**
No. Only direct links to image files.

### Use with the Apify API, MCP, n8n and Make

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("<username>/image-to-text-ocr").call(run_input={
    "urls": ["https://example.com/screenshot.png"],
    "languages": ["eng"],
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["status"], row["confidence"], row["text"])
```

JavaScript:

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

const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('<username>/image-to-text-ocr').call({
  urls: ['https://example.com/screenshot.png'],
  languages: ['eng'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((r) => [r.status, r.text]));
```

The same input works from the Apify MCP server (an AI agent calls the Actor with a list of image URLs), from n8n and from Make through their Apify modules.

### Related tools

- **Extract Text from PDF: OCR, PDF to Text & Markdown** : the same OCR engine for PDFs, DOCX and other documents.
- **Download Images from URLs: Bulk Image & File Downloader** : collect the images from pages first, then read them here.
- **Image Compressor & Resizer: Compress Images in Bulk** : shrink large images before or after OCR.
- **Image Metadata & EXIF Extractor: GPS, Camera, Dates (Bulk)** : read camera, date and GPS data from the same images.

# Actor input Schema

## `urls` (type: `array`):

Direct links to the image files to read, one per line. JPEG, PNG, WebP, GIF, BMP and TIFF work. Example: https://example.com/screenshot.png. Web pages, PDFs and SVG are not supported. Use only images you have the right to process.

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

Language(s) of the text. Pick every language that appears, at most 3 (more makes OCR slower and less accurate). Example: eng, or spa and eng for mixed Spanish and English.

## `layout` (type: `string`):

How Tesseract should expect the text to be arranged. Example: auto. Use line for a cropped single line, sparse for photos with scattered words.

## `preprocess` (type: `string`):

Auto converts to grayscale, removes speckle noise, stretches the contrast and enlarges images smaller than 1000 px 2x, which helps on screenshots, small crops and noisy scans. Example: auto. Choose none if you already cleaned the images.

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

Add a lines array to each row with the text, confidence (0-100) and pixel box (left, top, width, height) of every recognized line. Example: true. Makes the output larger.

## `minConfidence` (type: `integer`):

Drop words that Tesseract is less sure about than this value (0 keeps everything). Example: 40 removes most noise from photos but can also remove real words.

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

Upper limit of images read in this run. It also caps your cost. Example: 100. URLs beyond it are skipped and listed as skipped.

## `maxSourceSizeMb` (type: `integer`):

Images larger than this are refused without being read. Example: 15 (MB).

## `concurrency` (type: `integer`):

How many images are downloaded at the same time (OCR itself runs two at a time). Example: 4.

## Actor input object example

```json
{
  "urls": [
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
    "https://tesseract.projectnaptha.com/img/eng_bw.png"
  ],
  "languages": [
    "eng"
  ],
  "layout": "auto",
  "preprocess": "auto",
  "includeLines": false,
  "minConfidence": 0,
  "maxImages": 100,
  "maxSourceSizeMb": 15,
  "concurrency": 4
}
```

# Actor output Schema

## `results` (type: `string`):

All result items of this run (the default dataset), as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the run summary and notes on any problems.

# 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 = {
    "urls": [
        "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
        "https://tesseract.projectnaptha.com/img/eng_bw.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/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 = { "urls": [
        "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
        "https://tesseract.projectnaptha.com/img/eng_bw.png",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/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 '{
  "urls": [
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
    "https://tesseract.projectnaptha.com/img/eng_bw.png"
  ]
}' |
apify call data-done-right/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/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/3U84R6skxhMkAvnk5/builds/I6BBoKrr5uGdapc7T/openapi.json
