# Image to Text OCR – Scanned PDF & Image to Text (`rowfeed/image-to-text-ocr`) Actor

Extract text from images and scanned PDFs with OCR in 26 languages: PNG, JPG, WEBP, TIFF and PDF links in bulk, one row per page with a confidence score. $1 per 1,000 pages. Empty and unreadable pages are free.

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

## Pricing

from $1.00 / 1,000 ocr 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 – Scanned PDF & Image to Text

Extract text from images and scanned PDFs: give it links to PNG, JPG, WEBP, TIFF, GIF or BMP images or PDFs and get the text back, one row per page, with line and paragraph breaks and a confidence score.

Built for teams digitising invoices, letters, forms and archives, for RAG and AI pipelines that need text from scans, and for AI agents that hit a picture of text mid-task.

### What you get

- **The text of every page** with line and paragraph breaks kept.
- **26 OCR languages**: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Swedish, Norwegian, Danish, Finnish, Czech, Romanian, Hungarian, Turkish, Russian, Ukrainian, Greek, Chinese (simplified), Japanese, Korean, Arabic, Hindi, Vietnamese and Indonesian.
- **Smart PDF handling:** a PDF page that already contains text is read directly, which is exact, fast and cheaper. Only scanned pages go through OCR.
- **`ocr_confidence`** (0-100) per OCR page, so you can spot pages worth a second look.
- **Bulk:** many links per run, up to 2,000 pages per file, multi-page TIFFs included.

### Example output row

A real row from the pre-filled example:

```json
{
  "url": "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
  "file_type": "image",
  "page": 1,
  "page_count": 1,
  "text": "The (quick) [brown] {fox} jumps!\nOver the $43,456.78 <lazy> #90 dog\n& duck/goose, as 12.5% of E-mail\nfrom aspammer@website.com is spam.\nDer ,,schnelle” braune Fuchs springt\niiber den faulen Hund. Le renard brun\n«rapide» saute par-dessus le chien\nparesseux. La volpe marrone rapida\nsalta sopra il cane pigro. El zorro\nmarron rapido salta sobre el perro\nperezoso. A raposa marrom rapida\nsalta sobre 0 céo preguicoso.",
  "method": "ocr",
  "ocr_confidence": 89.8,
  "char_count": 414,
  "language": "eng"
}
```

### Pricing

Pay per event, no subscription:

- **$1 per 1,000 OCR pages** ($0.001 per image or scanned page).
- **$0.40 per 1,000 PDF pages that already contain text** ($0.0004), read without OCR.
- $0.001 per run start at the default 2 GB memory (Apify bills the start per GB).
- **Free:** empty pages, pages OCR cannot read well (confidence below 45, usually handwriting or photos), and error rows.

Examples: a 10-page scanned PDF costs $0.011. 1,000 receipts cost about $1.

You can cap the cost of a run with the maximum charge setting; the Actor stops before it.

### Input

| Field | What it does |
|---|---|
| `urls` | Direct links to images or PDFs, up to 50 MB each. |
| `languages` | The language(s) in the documents, up to 3. Default English. |
| `maxPagesPerFile` | Stop after this many pages per PDF or TIFF. Default 50. |

### Good to know

- Works best on printed and typed text. Handwriting is mostly not readable; such pages come back with low confidence and are free.
- The OCR engine is Tesseract 5, open source, running inside the Actor. Your files are not sent to any other service.
- Links must be reachable without a login. Links to internal or private network addresses are refused.
- A link that is not an image or a PDF, a password-protected PDF, or a file over 50 MB becomes an error row, never charged, and the rest of the list continues.
- Pick the right language: OCR in the wrong language misreads accented letters.

### More tools from Rowfeed

- [PDF to Text](https://apify.com/rowfeed/pdf-page-text-extractor) – text from PDFs that already contain text, page by page.
- [PDF to Excel](https://apify.com/rowfeed/pdf-table-extractor) – the tables in a PDF as rows and an Excel file: bank statements, invoices, price lists.
- [YouTube Transcript API](https://apify.com/rowfeed/youtube-transcript-api) – the full transcript of any YouTube video.
- [Remove Duplicates & Merge Datasets](https://apify.com/rowfeed/dataset-merge-dedup) – combine several runs or files into one clean list.
- [Google Sheets Export](https://apify.com/rowfeed/google-sheets-export) – send the results of any run to a Google Sheet.

# Actor input Schema

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

Direct links to images (PNG, JPG, WEBP, TIFF, GIF, BMP) or PDFs, up to 50 MB each. One row per page.

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

Pick the language(s) in the documents, up to 3. Mixing more languages makes OCR slower and less exact.

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

Stop after this many pages of each PDF or multi-page TIFF.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/scan.pdf",
    "https://example.com/receipt.jpg"
  ],
  "languages": [
    "eng"
  ],
  "maxPagesPerFile": 50
}
```

# Actor output Schema

## `results` (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/tessdoc/main/images/eurotext.png",
        "https://www.irs.gov/pub/irs-prior/f1040--1913.pdf"
    ],
    "languages": [
        "eng"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowfeed/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://www.irs.gov/pub/irs-prior/f1040--1913.pdf",
    ],
    "languages": ["eng"],
}

# Run the Actor and wait for it to finish
run = client.actor("rowfeed/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://www.irs.gov/pub/irs-prior/f1040--1913.pdf"
  ],
  "languages": [
    "eng"
  ]
}' |
apify call rowfeed/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

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