# Image OCR Text Extractor — Images & Scanned PDFs (`nexgensignal/image-ocr-text-extractor`) Actor

OCR images and scanned PDFs by link with Tesseract: JPEG, PNG, WebP, TIFF and PDF pages, 24 languages. Text line by line with word count, confidence and optional word positions. Pages with no text are not billed. Part of NexGen Signal — data tools and official-source data products

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

## Pricing

from $33.50 / 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.
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 OCR Text Extractor — Images & Scanned PDFs

Give image links (JPEG, PNG, GIF, WebP, BMP, TIFF) or PDF links, including scanned PDFs, and get **the text in each image or PDF page** as one row: text line by line with paragraphs, word and line counts, average confidence, and optionally every word with its confidence and position.

OCR runs inside the actor with Tesseract 5 and 24 language packs (English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Swedish, Danish, Norwegian, Finnish, Czech, Turkish, Russian, Ukrainian, Arabic, Hindi, Chinese simplified and traditional, Japanese, Korean, Vietnamese, Indonesian); pick up to five per run. Images are converted to grayscale and small images are enlarged before reading; PDF pages are rendered at 300 DPI by default.

The unit of output is one image or PDF page delivered. Pages where no text is found are not billed.

### Who buys this and for what job

- **Back-office and finance teams** reading scanned letters, forms and receipts they hold the rights to.
- **Archivists and researchers** making historical scans searchable.
- **AI builders** adding scanned documents to a knowledge base.
- **Developers** needing an OCR step without running Tesseract themselves.

Buyers usually search for this as **"OCR API"**, **"image to text"** or **"scanned PDF to text"**.

### 📊 Sample Output

![Table of OCR results: link, page number, word count, mean confidence and the start of the text.](https://api.apify.com/v2/key-value-stores/IXCaMKjxSmUTLHhmq/records/image-ocr-text-extractor.png)

| source_type | page_number | word_count | mean_confidence | text |
|---|---|---|---|---|
| image | 1 | 536 | 90.3 | Albert Einstein  Old Grove Ra. Wassau Point Peconic, Long Is … |
| pdf_page | 3 | 442 | 94.3 | Form W-4 (2026)  Step 2(b)— Multiple Jobs Worksheet (Keep fo … |
| pdf_page | 5 | 399 | 89.3 | Form W-4 (2026)  Higher Paying Job Annual Taxable Wage & Sal … |
| pdf_page | 1 | 817 | 92.9 | Form W-4  Department of the Treasury Internal Revenue Servic … |
| pdf_page | 4 | 963 | 92.9 | Form W-4 (2026)  Step 4(b)— Deductions Worksheet (Keep for y … |

Rows from live run `ntbOdvzs0bJP180ct` on Apify (the Store example: the 1939 Einstein–Szilard letter (a typed scan) and the five pages of the IRS W-4 form). Notice the confidence: about 90 on the 1939 typewritten scan and 89 to 96 on the printed form pages.

### ✅ What you get

Every field of each record:

- `record_id` — file hash plus page number.
- `url`, `final_url`, `found_on_page` — the link, where it was served from, and the page it was found on (with followImageLinks).
- `source_type`, `page_number`, `page_count` — image or pdf_page, and its position.
- `width`, `height` — pixels (PDF pages as rendered).
- `languages` — OCR languages used.
- `text`, `text_chars`, `word_count`, `line_count` — the text and its size.
- `mean_confidence` — average word confidence, 0 to 100.
- `words` — each word with confidence and bounding box (with includeWords).
- `sha256`, `processed_at` — file hash and when it was read (UTC).

### ⚙️ Sample inputs

**A scanned letter and a PDF (the Store example)**

```json
{
  "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png", "https://www.irs.gov/pub/irs-pdf/fw4.pdf"],
  "maxPages": 10
}
```

One image and five PDF pages.

**Word positions in two languages**

```json
{
  "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png"],
  "languages": ["eng", "fra"],
  "includeWords": true,
  "maxPages": 3
}
```

Each word with its box, for highlighting or redaction tools.

**Labels and signs**

```json
{
  "imageUrls": ["https://example.com/your-image.png"],
  "pageSegmentation": "sparse",
  "maxPages": 10
}
```

Sparse mode finds scattered text such as labels and screenshots.

Input fields:

| Field | Meaning |
|---|---|
| `imageUrls` | image or PDF links, or pages with followImageLinks (up to 5,000). |
| `languages` | 1 to 5 language codes (default eng). |
| `pageSegmentation` | auto, single_block, single_column, sparse, single_line. |
| `includeWords` | add word boxes and confidences (default false). |
| `followImageLinks` | read images and PDFs on pages you give (default false). |
| `maxPdfPages` | pages read per PDF (default 50). |
| `pdfDpi` | PDF render resolution, 72 to 400 (default 300). |
| `maxFileMb` | skip files bigger than this (default 50). |
| `maxPages` | stop after this many delivered pages (default 1,000). Each delivered page is billed. |

### 🧾 JSON sample record

```json
{
  "record_id": "9958a33916fa3ea43d2c-1",
  "url": "https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png",
  "final_url": "https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png",
  "found_on_page": null,
  "source_type": "image",
  "page_number": 1,
  "page_count": 1,
  "width": 1500,
  "height": 881,
  "languages": [
    "eng",
    "fra"
  ],
  "text": "Albert Einstein\n\nOld Grove Rd.\nHassau Point\nPeconic, Long Island\n\nAugust 2nd, 1939\n\nF.D. Roosevelt,\n\nPresident of the United States,\nWaite Hous:\n\nington, D.C.\n\nSirs\n\nSome recent work by E.Permi and L. Sailard, which has been com-\nmunicated to me in manuscript, leads me to expect that the element uran-\nium may be turned into a new and important source of energy in the in-\nmediate future. Certain aspects of the situation which has arisen seem\nto call for watchfulness and, if necessary, quick actio …",
  "text_chars": 3180,
  "word_count": 536,
  "line_count": 61,
  "mean_confidence": 92,
  "words": [
    {
      "text": "Albert",
      "confidence": 95.3,
      "left": 465,
      "top": 42,
      "width": 52,
      "height": 11,
      "line": 1
    },
    {
      "text": "Einstein",
      "confidence": 74.2,
      "left": 527,
      "top": 42,
      "width": 70,
      "height": 11,
      "line": 1
    },
    {
      "text": "Old",
      "confidence": 87.9,
      "left": 466,
      "top": 56,
      "width": 26,
      "height": 11,
      "line": 2
    },
    "… more words"
  ],
  "sha256": "9958a33916fa3ea43d2cb646c1e40d1c1cdf96b411d0e8d90efc3da32db8619f",
  "processed_at": "2026-10-17T04:11:23Z"
}
```

### 🔧 How it works

Files are downloaded 6 at a time; pages are read in parallel up to the run's CPU count. Tesseract's word table (TSV) is turned into lines and paragraphs; the average of the word confidences is reported.

Every run reads each host's robots.txt first: a path it disallows is skipped, listed in the run receipt and never charged. Only public internet addresses are fetched (no private, loopback or cloud-metadata addresses, checked again on every redirect). No logins, no CAPTCHA solving, no proxies.

Delivery is pushed first and charged after. The run receipt (`RUN_RECEIPT`) lists every link with its outcome and pages delivered, page outcomes with counts (delivered, no text found, unreadable), the robots.txt result per host, and the delivered and charged counts.

### 💰 Pricing example

Per page delivered, no start fee, no monthly charge:

| Apify plan | Price per page |
|---|---|
| Free | $0.05 |
| Bronze | $0.045 |
| Silver | $0.04 |
| Gold, Platinum, Diamond | $0.0335 |

- 10 pages: $0.50 on the Free plan, $0.335 on Gold.
- 1,000 pages: $50.00 on Free, $33.50 on Gold.
- 10,000 pages: $500.00 on Free, $335.00 on Gold.

**Coverage and size.** Proof runs on 17 Oct 2026: 40 pages of IRS Publication 17 at 200 DPI in about 4 minutes on the default 4 GB memory (more memory gives more CPU and runs faster); the Store example (6 pages) in about 20 seconds. Handwriting is not read reliably.

### ⚖️ Legal & ToS

Images belong to their owners. You choose the links. Make sure you have the right to download and use the content you point it at; the actor fetches only what you give it (and, where you turn it on, what those pages link to).

Every run reads each host's robots.txt first: a path it disallows is skipped, listed in the run receipt and never charged. Only public internet addresses are fetched (no private, loopback or cloud-metadata addresses, checked again on every redirect). No logins, no CAPTCHA solving, no proxies.

### ❓ FAQ

**Does it read handwriting?**
Not reliably. Tesseract is built for printed and typed text.

**Why is a page missing?**
Pages where OCR found no text are not delivered or billed; RUN_RECEIPT counts them.

**Can I make it faster?**
Give the run more memory (Apify gives more CPU with more memory) or lower pdfDpi.

### 🆘 Troubleshooting

- **Low confidence or garbled text** — Check the languages; try pageSegmentation single_block or sparse; raise pdfDpi for small print.
- **not an image or PDF** — The link returned something else, such as a web page; use followImageLinks for pages.
- **SOURCE UNAVAILABLE** — None of your links could be reached after retries. Nothing was charged.

### 🔗 Related Actors

- [Brand Logo & Favicon Lookup](https://apify.com/nexgensignal/brand-logo-lookup-api) — a company's logo from its domain
- [Website Performance Audit](https://apify.com/nexgensignal/website-performance-audit-api) — Lighthouse scores and web vitals per page
- [PR Newswire Scraper](https://apify.com/nexgensignal/press-release-monitor-api) — press releases by company or topic

🏢 **About NexGen Signal** — data tools and official-source data products on Apify. Browse the catalog: [apify.com/nexgensignal](https://apify.com/nexgensignal)

### ⭐ Found this useful?

If this actor saved you time, a rating on its Apify Store page helps other buyers find it.

Part of NexGen Signal — data tools and official-source data products.

# Actor input Schema

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

Direct image or PDF links (or pages, with the option below). Up to 5,000 per run.

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

1 to 5 languages in the text (empty = English). More languages are slower.

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

How the text is laid out on the page.

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

Add each word with its confidence and bounding box.

## `followImageLinks` (type: `boolean`):

When a link is a web page, read the images and PDFs it shows or links to (up to 200).

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

Read at most this many pages of each PDF.

## `pdfDpi` (type: `integer`):

Higher reads small print better but is slower.

## `maxFileMb` (type: `integer`):

Skip files bigger than this.

## `maxPages` (type: `integer`):

Stop after this many images / PDF pages are delivered. Each delivered page is billed; pages with no readable text are not.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png",
    "https://www.irs.gov/pub/irs-pdf/fw4.pdf"
  ],
  "languages": [
    "eng"
  ],
  "pageSegmentation": "auto",
  "includeWords": false,
  "followImageLinks": false,
  "maxPdfPages": 50,
  "pdfDpi": 300,
  "maxFileMb": 50,
  "maxPages": 10
}
```

# Actor output Schema

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

The delivered (and billed) records.

## `receipt` (type: `string`):

Per-link outcome, robots result, delivered and charged counts.

# 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": [
        "https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png",
        "https://www.irs.gov/pub/irs-pdf/fw4.pdf"
    ],
    "maxPages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgensignal/image-ocr-text-extractor").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": [
        "https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png",
        "https://www.irs.gov/pub/irs-pdf/fw4.pdf",
    ],
    "maxPages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgensignal/image-ocr-text-extractor").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": [
    "https://upload.wikimedia.org/wikipedia/commons/b/bf/Einstein-Roosevelt-letter.png",
    "https://www.irs.gov/pub/irs-pdf/fw4.pdf"
  ],
  "maxPages": 10
}' |
apify call nexgensignal/image-ocr-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexgensignal/image-ocr-text-extractor"
        }
    }
}
```

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/smf8rUpe4S0eH1VXz/builds/eUWmHnY7AyOvdT4Kh/openapi.json
