# Image to Text OCR – 100+ Languages, Scanned PDFs, Word Boxes (`kris_fili/image-to-text-ocr`) Actor

Extract text from photos, scans, screenshots and scanned PDFs with Tesseract OCR in 100+ languages. Bulk URLs or uploads, confidence scores, auto-rotation, optional line and word bounding boxes.

- **URL**: https://apify.com/kris_fili/image-to-text-ocr.md
- **Developed by:** [Krzysztof Filipiak](https://apify.com/kris_fili) (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 $2.00 / 1,000 image or page reads

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 – 100+ Languages, Scanned PDFs, Word Boxes

Extract text from **photos, scans, screenshots, receipts, invoices and scanned PDFs** – in bulk, in **100+ languages**, with a confidence score for every result.

- 🌍 **100+ languages** (Tesseract OCR) – English, German, French, Spanish, Polish, Russian, Arabic, Chinese, Japanese, Korean, Hindi… and mixes like `eng+deu`.
- 📑 **Scanned PDFs and multi-page TIFFs** – every page becomes one result.
- 🔄 **Auto-rotation** of pages scanned sideways or upside down.
- 📍 Optional **line and word bounding boxes** (x, y, width, height) – for highlighting, redaction or reading form fields.
- 🔗 Google Drive, Dropbox and GitHub share links work; you can also upload files.
- 💸 **$0.002 per image or page**. Failed files are free.

### Use cases

- Read **receipts and invoices** before sending them to an LLM or accounting system.
- Make **scanned contracts, letters and archives** searchable.
- Pull text from **screenshots, memes, slides and social media images** for analysis or moderation.
- Extract **product labels, signs and posters** from photos.
- Give an **AI agent** eyes for text in images (works over MCP).

### How to use

1. Paste image or PDF URLs (or upload files).
2. Set **Languages** (default `eng`).
3. Click **Start** – one dataset item per image / page.

#### Input example

```json
{
  "urls": [
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
    "https://example.com/scanned-invoice.pdf"
  ],
  "languages": "eng",
  "includeLines": true
}
```

#### Output example

```json
{
  "url": "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
  "fileName": "phototest.tif",
  "fileType": "image",
  "status": "ok",
  "text": "This is a lot of 12 point text to test the\nocr code and see if it works on all types\nof file format.\n\nThe quick brown dog jumped over the\nlazy fox. ...",
  "confidence": 95.5,
  "words": 60,
  "characters": 285,
  "width": 640,
  "height": 480,
  "rotation": 0,
  "languages": "eng",
  "lines": [
    {"text": "This is a lot of 12 point text to test the", "confidence": 95.5, "x": 36, "y": 92, "width": 544, "height": 30}
  ]
}
```

For PDFs each page is a separate item with `page` and `pages`. Coordinates are in pixels of the original image (PDF pages: rendered at 300 DPI; rotated images: after rotation).

### Tips for best results

- **Resolution matters**: text should be at least ~20 px tall. Small images are upscaled automatically.
- **Pick the right language** – wrong language = garbled accents.
- **Layout mode**: *Single column* for receipts, *Sparse* for screenshots, forms and signs, *Single line* for cropped labels.
- Handwriting is not supported (printed text only).

### Pricing

| Event | Price |
|---|---|
| Image or PDF page read | **$0.002** |

1,000 images cost **$2**. Apify platform usage is included. Set a maximum cost per run in the run options if you like.

### Use it from code and AI agents

```bash
curl -X POST "https://api.apify.com/v2/acts/kris_fili~image-to-text-ocr/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.com/receipt.jpg"], "languages": "eng", "pageSegmentation": "single-column"}'
```

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("kris_fili/image-to-text-ocr").call(run_input={"urls": ["https://example.com/receipt.jpg"]})
print(next(client.dataset(run["defaultDatasetId"]).iterate_items())["text"])
```

**MCP:** `https://mcp.apify.com?tools=kris_fili/image-to-text-ocr` – lets Claude, Cursor and other AI agents read text from images.

Need Word, PowerPoint or Excel files as Markdown? Use **[Document to Markdown](https://apify.com/kris_fili/document-to-markdown)**. Need screenshots of web pages? Use **[Website Screenshot & PDF](https://apify.com/kris_fili/website-screenshot-pdf)**.

### FAQ

**Is my data private?** Images are processed only inside your run and results stay in your Apify storage.

**What about tables?** OCR returns text line by line. For PDFs that have a text layer, **Document to Markdown** extracts real tables.

**Can it read CAPTCHAs?** No, and it is not meant to.

Questions? Use the **Issues** tab.

# Actor input Schema

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

Direct links to PNG, JPEG, TIFF (also multi-page), WebP, GIF, BMP images or scanned PDFs. Google Drive, Dropbox and GitHub share links are converted to downloads automatically.

## `files` (type: `array`):

Upload images or PDFs from your computer (stored in your Apify key-value store).

## `languages` (type: `string`):

Language(s) of the text, joined with +, e.g. eng, deu, fra, spa, ita, por, pol, rus, ara, chi_sim, jpn, kor, eng+deu. Two-letter codes work too (en, de, fr). 100+ languages are supported – less common ones are downloaded automatically.

## `pageSegmentation` (type: `string`):

Auto works for most images and documents. Single column suits receipts and narrow text, single line suits one-line crops and labels, sparse suits screenshots, forms, signs and memes with scattered text.

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

Detect pages scanned sideways or upside down and rotate them before reading.

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

Add 'lines': every text line with its confidence and position (x, y, width, height in pixels of the original image).

## `includeWordBoxes` (type: `boolean`):

Add 'wordBoxes': every word with its confidence and position – for highlighting, redaction or reading form fields.

## `pageRange` (type: `string`):

Read only these PDF pages, e.g. 1-3,5 (empty = all, up to the limit below).

## `maxPagesPerFile` (type: `integer`):

Limit for PDFs and multi-page TIFFs. Every page read is charged as one image.

## `pdfPassword` (type: `string`):

Password for protected PDFs.

## `maxFileSizeMb` (type: `integer`):

Bigger files are skipped with an error (no charge).

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

Empty = automatic (by the CPU cores of the run). More memory for the run = more cores = faster.

## Actor input object example

```json
{
  "urls": [
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png"
  ],
  "languages": "eng",
  "pageSegmentation": "auto",
  "autoRotate": true,
  "includeLines": false,
  "includeWordBoxes": false,
  "maxPagesPerFile": 50,
  "maxFileSizeMb": 50
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
        "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kris_fili/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/test/main/testing/phototest.tif",
        "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("kris_fili/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/test/main/testing/phototest.tif",
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png"
  ]
}' |
apify call kris_fili/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

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