# Image to Text OCR: Extract Text from Image URLs (`joesimo/image-ocr`) Actor

Extract text from images in bulk with Tesseract OCR. Paste image URLs (PNG, JPG, WebP, GIF, BMP, TIFF) and get the full text, each line with confidence and position, and word counts. 7 languages, no login, no API key.

- **URL**: https://apify.com/joesimo/image-ocr.md
- **Developed by:** [Joe Simo](https://apify.com/joesimo) (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

$1.50 / 1,000 images

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: Extract Text from Image URLs

Turn images into text in bulk. Paste image URLs and get the full text of each image, every line with its confidence score and position, and word and line counts. Runs Tesseract OCR inside the Actor, so there is no login, no API key and no third-party OCR service.

### What you get

| Field | Example |
|---|---|
| url | https://tesseract.projectnaptha.com/img/eng_bw.png |
| status | ok |
| text | Mild Splendour of the various-vested Night! ... |
| confidence | 92 (0 to 100) |
| wordCount | 58 |
| lineCount | 8 |
| lines | \[{ "text": "...", "confidence": 95.1, "bbox": { "x0": 36, "y0": 92, "x1": 618, "y1": 126 } }] |
| language | eng |
| bytes, contentType, ocrMs | 26854, image/png, 637 |

Images that cannot be read get a row with `status: "error"` and a reason (HTTP error, too large, not an image). You only pay for images that were read.

### Use cases

- Pull text out of screenshots, scanned receipts, invoices, flyers and signs
- Make image archives searchable
- Feed text from images into AI agents, Make, Zapier or n8n workflows
- Check what text a banner or social image contains

### Input

- **Image URLs**: direct links to PNG, JPG, WebP, GIF, BMP or TIFF files. SVG and PDF are not supported (for PDFs with a text layer, use our PDF Text Extractor).
- **Text language**: English, Spanish, French, German, Italian, Portuguese or Dutch.
- **Include lines**: adds each line with confidence and bounding box.
- **Minimum line confidence**: hide low-confidence lines from the lines array.
- **Max images** and **Max image size (MB)**.

```json
{
    "imageUrls": [
        "https://tesseract.projectnaptha.com/img/eng_bw.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png"
    ],
    "language": "eng",
    "includeLines": true
}
```

### Pricing

Pay per event: one charge per image read successfully (see the Pricing tab). Failed downloads and non-image links are free. Set a maximum charge per run and the Actor stops cleanly when it is reached.

### Tips for accuracy

- Printed text at 10 pt or larger reads best. Handwriting and very small or stylized fonts read poorly.
- Higher resolution helps. Crop to the text area when you can.
- Pick the right language so accents and special letters come out right.

### Integrations and API

Run it from the Apify API, the JavaScript or Python client, Make, Zapier, n8n, Google Sheets, webhooks or the Apify MCP server. Results download as JSON, CSV or Excel.

### FAQ

**Does it store my images?** No. Each image is downloaded, read in memory and discarded. Only the text result goes to the dataset.

**Can it read private links?** It can read any URL reachable from the public internet without a login. Links to private network addresses are refused.

**Is this legal?** OCR of images you are allowed to use is fine. Only process images you have the right to use, and do not use the output to collect personal data without a legal basis.

# Actor input Schema

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

Direct links to images (PNG, JPG, WebP, GIF, BMP, TIFF). One result row per image. SVG and PDF are not supported. If left empty, the Actor reads 4 demo images.

## `language` (type: `string`):

Language of the text in the images.

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

Adds a lines array: each line's text, confidence (0 to 100) and bounding box in pixels.

## `minLineConfidence` (type: `integer`):

Drop lines below this confidence (0 to 100) from the lines array. The full text is not filtered.

## `maxImages` (type: `integer`):

Stop after this many images.

## `maxImageMB` (type: `integer`):

Skip images larger than this.

## Actor input object example

```json
{
  "imageUrls": [
    "https://tesseract.projectnaptha.com/img/eng_bw.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ],
  "language": "eng",
  "includeLines": true,
  "minLineConfidence": 0,
  "maxImages": 100,
  "maxImageMB": 10
}
```

# Actor output Schema

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

One row per image URL: status, full text, lines with confidence and bounding box, word and line 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://tesseract.projectnaptha.com/img/eng_bw.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("joesimo/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://tesseract.projectnaptha.com/img/eng_bw.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
        "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("joesimo/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://tesseract.projectnaptha.com/img/eng_bw.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/testocr.png",
    "https://raw.githubusercontent.com/naptha/tesseract.js/master/tests/assets/images/simple.png",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ]
}' |
apify call joesimo/image-ocr --silent --output-dataset

```

## MCP server setup

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