# Bulk Image OCR: Image to Text (English & Spanish) (`gunpark/bulk-image-ocr`) Actor

Extract text from image URLs in bulk with offline OCR (Tesseract). English and Spanish, confidence scores and optional word boxes. Flat $0.003 per image with text; blank and failed images free.

- **URL**: https://apify.com/gunpark/bulk-image-ocr.md
- **Developed by:** [Alejandro Rodriguez](https://apify.com/gunpark) (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 $2.40 / 1,000 image with texts

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

## Bulk Image OCR: Image to Text (English & Spanish)

Extract the text from images in bulk. Paste image URLs (PNG, JPEG, WebP, GIF, BMP, TIFF) and get one row per image with the recognised **text**, a **confidence score** and, optionally, every **word with its confidence and bounding box**. OCR runs offline inside the Actor (Tesseract engine): no third-party API keys, nothing sent to other services.

**Flat $0.003 per image that contains text** – no start fee, no per-check fee. Blank images, images without text, unsupported files and failed downloads are **free**.

### Use cases

- **Screenshots and scanned notes to text** for search, archiving or translation.
- **Receipts, invoices and labels** – get the raw text to feed your own parser or an LLM.
- **AI agents (MCP)** – let your agent read text inside images it finds or receives.
- **Spanish and English content** – choose one or both languages per run.
- Pair it with the **[PDF to Markdown extractor](https://apify.com/gunpark/pdf-to-markdown-extractor)** (text-layer PDFs) and the **[Bulk Image Converter](https://apify.com/gunpark/image-converter-compressor)** (resize/convert before OCR).

### Input

| Field | Default | Description |
|---|---|---|
| `imageUrls` | sample image | 1–100 public image URLs per run. |
| `languages` | `["eng"]` | `eng`, `spa` or both. |
| `includeWords` | `false` | Add every word with confidence (0–100) and bounding box. |
| `maxFileSizeMb` | `10` | Larger files are skipped (not charged). |
| `maxSecondsPerImage` | `40` | Time budget per image; slower images are reported as failed and not charged. |

```json
{ "imageUrls": ["https://example.com/receipt.jpg"], "languages": ["spa", "eng"], "includeWords": true }
```

### Output (one row per image)

```json
{
  "url": "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
  "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 lazy fox. ...",
  "characterCount": 225,
  "meanConfidence": 94,
  "wordCount": 60,
  "languages": ["eng"],
  "imageType": "png",
  "bytes": 54342,
  "sha256": "…",
  "billable": true
}
```

`billable: false` rows (no meaningful text found) are returned but not charged.

### For AI agents (MCP)

Actor ID: `gunpark/bulk-image-ocr`. Minimal input: `{"imageUrls":["https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png"]}`. Read `text` and `meanConfidence` from the dataset items. MCP server: `https://mcp.apify.com?tools=gunpark/bulk-image-ocr` (running it requires an Apify account).

### Pricing

One `image` event per image where OCR found text ($0.003; lower on higher Apify plans). No start fee. Use "Max total charge" to cap a run – the Actor stops cleanly at the cap.

### Limits

- Printed text works best; handwriting, very small text, heavy noise or stylised fonts reduce accuracy (check `meanConfidence`).
- English and Spanish only for now. PDFs are not OCR'd by this Actor.
- Only publicly reachable image URLs; private and local network addresses are refused.

### Legal

You are responsible for having the right to process the images you submit. Do not use it to extract personal data you have no lawful basis to process. OCR engine: Tesseract.js (Apache-2.0); language data: MIT.

### More tools from the same author

- [PDF to Markdown & Text Extractor](https://apify.com/gunpark/pdf-to-markdown-extractor) – PDF URLs → Markdown/text/tables for RAG, flat $0.003 per PDF.
- [Bulk Image Converter & Compressor](https://apify.com/gunpark/image-converter-compressor) – PNG/JPEG → WebP/AVIF, resize, strip metadata.
- [Bulk PageSpeed Insights & Core Web Vitals Audit](https://apify.com/gunpark/bulk-pagespeed-audit) – Lighthouse scores + real-user Core Web Vitals for many URLs or a sitemap.
- [Dataset Transformer](https://apify.com/gunpark/dataset-transformer) – filter, dedupe, sort any Apify dataset/JSON/CSV and export CSV/JSONL.

# Actor input Schema

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

Public URLs of PNG, JPEG, WebP, GIF, BMP or TIFF images (1–100 per run).

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

Language(s) of the text. Select both for mixed English/Spanish images.

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

Adds every recognised word with its confidence (0–100) and bounding box.

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

Larger images are skipped and not charged.

## `maxSecondsPerImage` (type: `integer`):

Time budget per image for download and OCR. Images that exceed it are reported as failed and not charged.

## Actor input object example

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png"
  ],
  "languages": [
    "eng"
  ],
  "includeWords": false,
  "maxFileSizeMb": 10,
  "maxSecondsPerImage": 40
}
```

# Actor output Schema

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

No description

## `state` (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 = {
    "imageUrls": [
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gunpark/bulk-image-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": ["https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png"] }

# Run the Actor and wait for it to finish
run = client.actor("gunpark/bulk-image-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": [
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png"
  ]
}' |
apify call gunpark/bulk-image-ocr --silent --output-dataset

```

## MCP server setup

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