# Image to Text OCR: Bulk Images & Scanned PDFs, 38 Languages (`ai_admin/image-to-text-ocr`) Actor

Extract text from images (PNG, JPG, WebP, TIFF, HEIC) and scanned PDF pages in bulk. Returns plain text plus lines and words with confidence and bounding boxes. 38 languages incl. Ukrainian, Chinese, Arabic. Auto-rotate.

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

## Pricing

from $1.50 / 1,000 ocr'd image or pages

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: Bulk Images & Scanned PDFs, 38 Languages

Extract text from images and scanned PDFs in bulk — screenshots, photos of documents, receipts, scans — with the
confidence and position of every line and word.

- **Images and scanned PDFs.** PNG, JPG, WebP, TIFF (multi-page), GIF, BMP, iPhone HEIC/HEIF, AVIF and PDF pages;
  choose pages like `1-3,5,8-`.
- **38 languages**, several at once: English, Ukrainian, Russian, German, French, Spanish, Italian, Portuguese, Polish,
  Dutch, Czech, Turkish, Arabic, Hebrew, Hindi, Chinese, Japanese, Korean, Vietnamese and more.
- **Structured output.** Plain text with paragraphs, plus lines and (optionally) words with confidence 0–100 and
  bounding boxes in pixels of the original image — ready for highlighting, redaction or data extraction.
- **Auto-rotate** for pages scanned sideways or upside down; small images are upscaled automatically.
- **Private:** runs on Tesseract inside the Actor — your images are not sent to any third-party OCR service.

### Why this Actor

| | This Actor | Typical alternatives in the Apify Store (Oct 2026) |
|---|---|---|
| **Price** | **$1.50 per 1,000 images** | $2–6.50 per 1,000 |
| **Output** | Text **plus** every line and word with confidence and bounding box | Often plain text only |
| **Languages** | 38, several at once — incl. Ukrainian, Arabic, Chinese, Japanese, Hindi | Often English-first |
| **Scans** | Scanned PDFs and multi-page TIFFs page by page, auto-rotate | Often images only |
| **Privacy** | OCR runs inside the Actor — images are not sent to Google or other OCR APIs | Several wrap Google Lens |

### Input

```json
{
  "sources": [{ "url": "https://example.com/receipt.jpg" }, { "url": "https://example.com/scan.pdf" }],
  "languages": ["eng", "ukr"],
  "pages": "1-3",
  "layout": "auto",
  "autoRotate": false,
  "includeLines": true,
  "includeWords": false
}
```

| Field | Meaning |
|---|---|
| `sources` | URLs of images or PDFs. Files in your own Apify key-value store work too: set the store's access to "Anyone with ID can read" and use `https://api.apify.com/v2/key-value-stores/<store ID>/records/<key>` (the Actor runs with limited permissions and does not use your token). |
| `languages` | Tesseract codes: `eng`, `ukr`, `rus`, `deu`, `fra`, `spa`, `chi_sim`, `jpn`, `ara`… |
| `pages` | Pages of PDFs and multi-page TIFFs, empty = all |
| `layout` | `auto` (documents, columns), `single-block`, `single-line`, `sparse` (screenshots, receipts, signs) |
| `autoRotate` | Detect and fix page orientation before OCR |
| `includeLines` / `includeWords` | Return lines / words with confidence and bounding box |

### Output

One item per image or PDF page:

```json
{
  "url": "https://example.com/scan.pdf",
  "fileName": "scan.pdf",
  "kind": "pdf",
  "page": 1,
  "totalPages": 3,
  "languages": ["eng", "ukr"],
  "text": "Quarterly Supply Report\n\nThe warehouse in Lviv received 1,240 pallets...",
  "meanConfidence": 95.0,
  "lines": [{ "text": "Quarterly Supply Report", "confidence": 96.3, "bbox": [63, 59, 766, 55] }],
  "width": 2480,
  "height": 3508
}
```

`bbox` is `[x, y, width, height]` in pixels. A file that cannot be downloaded or opened gets an `error` field instead
and is **not charged**.

### Pricing

| Event | Price | What counts |
|---|---|---|
| `image` | **$1.50 per 1,000** | one OCR'd image, TIFF frame or PDF page |

Plus Apify's standard start fee of $0.05 per 1,000 runs. The run stops before it would exceed your maximum charge per run.

### Related Actors

- [Document to Markdown for AI](https://apify.com/ai_admin/document-to-markdown) — PDFs, scans and Office files → Markdown, tables, RAG chunks
- [PDF to Image & Image Converter](https://apify.com/ai_admin/pdf-image-converter) — PDF ↔ PNG/JPG/WebP, HEIC → JPG
- [Office to PDF & PDF/A](https://apify.com/ai_admin/office-to-pdf) — Word, Excel, PowerPoint, HTML → PDF/PDF-A
- [Audio & Video Transcriber](https://apify.com/ai_admin/audio-transcriber) — speech to text, SRT and VTT subtitles

Open source: [github.com/AndriyVK/-apify-document-tools](https://github.com/AndriyVK/-apify-document-tools)

### Use with AI agents and code

- **MCP (Claude, Cursor, VS Code, any MCP client):** add `https://mcp.apify.com?tools=ai_admin/image-to-text-ocr` as an MCP server —
  the agent gets one tool with this Actor's input schema and pays per use through your Apify account.
- **One HTTP call that returns the results:**

```bash
curl -X POST "https://api.apify.com/v2/acts/ai_admin~image-to-text-ocr/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sources": [{"url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/image-en.png"}], "languages": ["eng"], "includeLines": true}'
```

- **Agentic payments:** the Actor is enabled for Apify's agentic payments (x402), so autonomous agents can pay per run.

### Limits

- Handwriting is recognised poorly; printed text works best. Photos should be in focus, at least ~20 px letter height.
- Password-protected PDFs are not supported. Maximum download size is 200 MB per file.
- For PDFs with a text layer (not scans) use Document to Markdown — it is faster and exact.

# Actor input Schema

## `sources` (type: `array`):

Public URLs of images (PNG, JPG, WebP, TIFF incl. multi-page, GIF, BMP, HEIC/HEIF, AVIF) or scanned PDFs. Each image or PDF page is one result. Files in your own Apify key-value store work too: set the store's access to "Anyone with ID can read" and use https://api.apify.com/v2/key-value-stores/<store ID>/records/<key>.

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

Languages in the images. Pick one or a few (e.g. English + Ukrainian); more languages = slower and slightly less accurate.

## `pages` (type: `string`):

For PDFs and multi-page TIFFs: pages to OCR, e.g. "1-3,5,8-". Empty = all.

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

auto = documents, columns; single-block = one uniform block of text; single-line = one line (captions, labels); sparse = scattered text (screenshots, signs, receipts).

## `autoRotate` (type: `boolean`):

Detect pages scanned sideways or upside down and rotate them before OCR (a bit slower).

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

Return every line with confidence (0-100) and bounding box \[x, y, width, height] in pixels of the original image.

## `includeWords` (type: `boolean`):

Also return every word with confidence and bounding box.

## Actor input object example

```json
{
  "sources": [
    {
      "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/image-en.png"
    }
  ],
  "languages": [
    "eng"
  ],
  "pages": "",
  "layout": "auto",
  "autoRotate": false,
  "includeLines": true,
  "includeWords": false
}
```

# Actor output Schema

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

Dataset items: url, page, text, meanConfidence, lines, words or 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 = {
    "sources": [
        {
            "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/image-en.png"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ai_admin/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 = { "sources": [{ "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/image-en.png" }] }

# Run the Actor and wait for it to finish
run = client.actor("ai_admin/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 '{
  "sources": [
    {
      "url": "https://api.apify.com/v2/key-value-stores/FloomuI2DrQCJazY8/records/image-en.png"
    }
  ]
}' |
apify call ai_admin/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

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