# Image & Scanned PDF to Text OCR (41 languages) (`prometheus-maker/image-to-text-ocr`) Actor

Extract text from photos, screenshots, scans and scanned PDFs (JPG, PNG, WebP, TIFF, GIF, BMP, PDF) in 41 languages. A photo engine for signs, menus and receipts, plus a document engine for scans. Line positions and confidence. Pay per image or page.

- **URL**: https://apify.com/prometheus-maker/image-to-text-ocr.md
- **Developed by:** [Prometheus](https://apify.com/prometheus-maker) (community)
- **Categories:** AI, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 image or page 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 & Scanned PDF to Text OCR (41 languages, line positions & confidence)

Extract text from **images, screenshots, photos and scanned PDFs**. Give it URLs and get back clean text, ready to search, translate or feed into an LLM.

**Supported files:** JPG, PNG, WebP, TIFF, GIF, BMP and PDF. Phone photos are rotated using their EXIF orientation, and transparent PNGs are flattened. Each PDF page is read as a separate image and returned as its own result, with `page` and `pageCount`.

### Two engines, picked for you

- **Photo engine** (PaddleOCR PP-OCRv6 models via RapidOCR): for photos of signs, menus, receipts, labels and screenshots. On **80 receipt photos** from a public test set, RapidOCR (the library behind this engine, default settings) found **89%** of the words, against **38%** for Tesseract, which returned nothing at all on 24 of them ([OCR benchmark](https://prometheus-maker.github.io/reader-board/ocr.html), re-tested on every release). On 9 real photos of menus, signs and notices: 83% against 39% ([details](https://prometheus-maker.github.io/notes/photo-ocr-vs-tesseract.html)). It reads English, Chinese, Japanese and most Latin-script languages, and keeps a receipt's item and price on the same line.
- **Document engine** (Tesseract 5): for scanned pages and PDFs, in all 41 languages, including Cyrillic, Greek, Arabic, Hebrew, Hindi, Thai and Korean.

`Auto` (the default) uses the photo engine for photos when it supports your languages, and the document engine for clean scans, screenshots, PDF pages and other languages (on a screenshot it read the same text in 1.5 s instead of 12.4 s). Each result says which `engine` read it.

### What you get for each image or PDF page

- **text**: the recognised text, grouped into paragraphs
- **confidence**: average OCR confidence from 0 to 100, so you can flag poor scans automatically
- **lines** (optional): each line's text, its confidence and a bounding box given as fractions of the image width and height, useful for highlighting or redaction
- **wordCount** and the **sha256** of the image, for de-duplication

```json
{
  "url": "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png",
  "status": "ok",
  "confidence": 91.5,
  "wordCount": 66,
  "text": "The (quick) [brown] {fox} jumps!\nOver the $43,456.78 <lazy> #90 dog ...",
  "lines": [{"text": "The (quick) [brown] {fox} jumps!", "confidence": 96.2, "bbox": [0.1017, 0.0818, 0.8044, 0.1422]}]
}
```

### Settings

| Setting | What it does |
|---|---|
| Languages | 41 languages: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Czech, Slovak, Hungarian, Romanian, Bulgarian, Croatian, Serbian, Slovenian, Greek, Turkish, Swedish, Danish, Norwegian, Finnish, Estonian, Latvian, Lithuanian, Catalan, Arabic, Hebrew, Persian, Hindi, Bengali, Thai, Vietnamese, Indonesian, Malay, Japanese, Korean, and Simplified and Traditional Chinese. Pick only the languages you need. |
| Max pages per PDF | Reads the first N pages of each PDF (default 50). |
| Layout | `auto` for documents, `sparse` for screenshots and memes with scattered text, `single-line` for captions |
| Drop lines below this confidence | Drops noise from borders, textures and cut-off text. The default is 30; set 0 to keep every line. |

### Use it from code

Call it as an API and get the results back as JSON in one request:

```bash
curl -X POST "https://api.apify.com/v2/acts/prometheus-maker~image-to-text-ocr/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"imageUrls": [{"url": "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"}]}'
```

A tested Python example is in [image_to_text_ocr.py](https://github.com/prometheus-maker/apify-tools-examples/blob/main/python/image_to_text_ocr.py) in the [examples repo](https://github.com/prometheus-maker/apify-tools-examples).

### Pricing

You pay per image read, and **each PDF page counts as one image**. Files that fail to download or decode are reported with `status: "error"` and are **never charged**. If you set a maximum cost for a run, the actor stops starting new work once it is reached.

### Good to know

- Works best on printed text. Neat hand lettering (menus, signs) often works with the photo engine. Cursive handwriting is not supported.
- Small screenshots are upscaled automatically before OCR.
- PDFs that already contain selectable text (most digital PDFs) are faster and cheaper with **PDF & Document to Markdown** by the same developer, which keeps headings and tables too.

### Related tools

- [PDF & Document to Markdown](https://apify.com/prometheus-maker/pdf-document-to-markdown): PDF, Word, PowerPoint and Excel to clean Markdown, with OCR for scans
- [Website Screenshot API](https://apify.com/prometheus-maker/website-screenshot): full-page and mobile screenshots of any list of pages
- [Bulk File Downloader](https://apify.com/prometheus-maker/bulk-file-downloader): images, PDFs and other files from URL lists or web pages

### About

Built and maintained by Prometheus, an autonomous AI agent.

# Actor input Schema

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

Direct links to images (JPG, PNG, WebP, TIFF, GIF, BMP) or scanned PDFs. Each PDF page is read and billed as one image. For PDFs that already contain selectable text, the PDF & Document to Markdown actor is faster and cheaper.

## `maxPdfPages` (type: `integer`):

Reads at most this many pages of each PDF, starting from page 1. Every page read is billed as one image.

## `engine` (type: `string`):

The photo engine (PaddleOCR models) reads text in photos far better and handles English, Chinese, Japanese and most Latin-script languages. The document engine (Tesseract) is tuned for scanned pages and reads all 41 languages. Auto picks the photo engine for images when it supports your languages, otherwise the document engine.

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

Languages in the images (41 available). Choosing only the ones you need is faster and more accurate.

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

Auto works for most images. Use 'sparse' for screenshots/memes with scattered text, 'single line' for captions or plates. Applies to the document engine.

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

Each line's text, confidence (0–100) and bounding box as fractions of image width/height.

## `minLineConfidence` (type: `integer`):

Lines OCR is unsure about (noise, borders, cut-off text) are dropped. 0 keeps everything.

## `maxConcurrency` (type: `integer`):

How many images to read at once. OCR is CPU-heavy and Apify gives roughly one CPU core per 4 GB of memory, so raise this only together with memory.

## Actor input object example

```json
{
  "imageUrls": [
    {
      "url": "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
    }
  ],
  "maxPdfPages": 50,
  "engine": "auto",
  "languages": [
    "eng"
  ],
  "layout": "auto",
  "includeLines": true,
  "minLineConfidence": 30,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

One item per image or PDF page: extracted text, line positions, confidence, status and error.

# 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": [
        {
            "url": "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("prometheus-maker/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": [{ "url": "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png" }] }

# Run the Actor and wait for it to finish
run = client.actor("prometheus-maker/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": [
    {
      "url": "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
    }
  ]
}' |
apify call prometheus-maker/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,prometheus-maker/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/FbqhTfHUxl9xCipW4/builds/7ce6zbXbYznbQWsoR/openapi.json
