# Image OCR API: Image to Text, Lines & Bounding Boxes (`rod_analytics/image-ocr-api`) Actor

Fast Image OCR and image to text API for AI agents and workflows. Extract clean text, word confidence and line/word bounding boxes from PNG, JPEG, WebP and TIFF images across 35+ languages. $0.002 per image; failed images are free.

- **URL**: https://apify.com/rod_analytics/image-ocr-api.md
- **Developed by:** [Rod Services](https://apify.com/rod_analytics) (community)
- **Categories:** AI, Developer tools, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 images ocr extracted

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/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

**Extract text, confidence scores, and line/word bounding boxes from PNG, JPEG, WebP and TIFF images across 35+ languages.**
**No API key needed.** Paste image URLs or upload a file, click Start, and get clean text plus coordinates for `$0.002` per image.

### What you get

- **Clean text** extracted via Tesseract OCR 5 in 35+ languages (`eng`, `deu`, `fra`, `spa`, `lit`, `pol`, `rus`, `jpn`, `chi_sim` and more).
- **Mean confidence score** (`0` to `100`) and word/line counts per image.
- **Line bounding boxes** (`left`, `top`, `width`, `height`, `confidence`) and optional **word bounding boxes**.
- **Image preprocessing** (EXIF auto-orientation, transparent PNG flattening, smart upscaling of small text).
- **Zero charge on failures** (`invalid` or `error` rows are free).

### Quick start

1. Paste public `imageUrls` or upload an image via **Upload an image**.
2. Keep `languages: ["eng"]` or pass multiple Tesseract ISO 639-3 codes (e.g. `["eng", "deu"]`).
3. Click **Start**.

From the Apify API:

```bash
curl -X POST "https://api.apify.com/v2/acts/rod_analytics~image-ocr-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"imageUrls": ["https://tesseract.projectnaptha.com/img/eng_bw.png"], "languages": ["eng"]}'
```

### Input

| Field | Default | Description |
| --- | --- | --- |
| `imageUrls` | Sample image | Public `http(s)` URLs to PNG, JPEG, WebP, GIF, BMP or TIFF files. |
| `uploadedFile` | empty | Optional uploaded image file from Apify Console. |
| `languages` | `["eng"]` | Tesseract ISO 639-3 language codes (35+ installed). |
| `includeBoxes` | `true` | Return line bounding boxes and per-line confidence. |
| `includeWordBoxes` | `false` | Also return per-word bounding boxes. |
| `preprocess` | `true` | EXIF auto-rotate, flatten alpha onto white, upscale images under 900 px. |
| `psm` | `3` | Tesseract page segmentation mode (`3` auto, `6` block, `11` sparse UI). |
| `maxConcurrency` | `3` | Parallel OCR workers (`1` to `6`). |
| `maxImageSizeMb` | `25` | Maximum image size to download (`1` to `100` MB). |

### Output sample

```json
{
  "sourceUrl": "https://tesseract.projectnaptha.com/img/eng_bw.png",
  "fileName": "eng_bw.png",
  "status": "ok",
  "mimeType": "image/png",
  "width": 640,
  "height": 480,
  "language": "eng",
  "text": "Mild Splendour of the various-formed Wood...",
  "confidence": 91.4,
  "wordCount": 71,
  "lineCount": 9,
  "lines": [
    { "text": "Mild Splendour of the various-formed Wood", "confidence": 92.1, "left": 41, "top": 52, "width": 556, "height": 24 }
  ],
  "processingSecs": 0.84,
  "error": null
}
```

### Pricing

Pay per event. Failed, invalid or unreachable images are free.

| Event | Free | Bronze | Silver | Gold / Platinum / Diamond |
| --- | --- | --- | --- | --- |
| Image OCR (`image-ocr`) | $0.002 | $0.0018 | $0.0016 | $0.0015 |
| Actor start (per GB, min 1) | $0.001 | $0.001 | $0.001 | $0.001 |

### License & terms

Uses Tesseract OCR 5 and language data under Apache-2.0. You process images you supply or have permission to read.

### Related Actors

More tools from the same developer, built with pay-per-event pricing and clean JSON output.

| Actor | What it does |
| --- | --- |
| [Website to Markdown Crawler: Clean Text for LLM & RAG](https://apify.com/rod_analytics/website-to-markdown) | Crawl websites into clean Markdown, RAG chunks and llms.txt |
| [PDF to Text & Markdown Extractor with OCR, Tables & RAG](https://apify.com/rod_analytics/doc-to-markdown) | Extract PDF, Word, Excel and PowerPoint files to Markdown and text |
| [Audio Transcriber: Transcribe Audio, Video & Podcasts](https://apify.com/rod_analytics/media-transcriber) | Whisper transcripts, SRT/VTT subtitles and AI summaries from audio and podcasts |
| [Bulk LLM Runner: AI Prompt for Every Row, JSON Output, No Key](https://apify.com/rod_analytics/bulk-llm-runner) | Run one LLM prompt per dataset or JSON row with structured output |
| [SEO Audit Tool: Site Crawler, Broken Links & Score](https://apify.com/rod_analytics/seo-site-audit) | Crawl sites for broken links, metadata gaps and on-page SEO issues |
| [PageSpeed Insights & Lighthouse Bulk Checker, No API Key](https://apify.com/rod_analytics/lighthouse-audit) | Core Web Vitals, Lighthouse scores, regression tracking and client reports |
| [Tech Stack Detector: Wappalyzer & BuiltWith Alternative](https://apify.com/rod_analytics/tech-stack-detector) | Detect CMS, frameworks, analytics and hosting across 7,600+ fingerprints |
| [WHOIS & DNS Lookup: Bulk Domain, SPF, DMARC & SSL Check](https://apify.com/rod_analytics/domain-security-audit) | Bulk WHOIS, DNS records, SSL certificate and email security checks |
| [Contact Details Scraper: Emails, Phones & Social Links](https://apify.com/rod_analytics/company-contact-extractor) | Extract emails, phones and social links from company websites |
| [Company Profile & Enrichment from Domain: Firmographics API](https://apify.com/rod_analytics/company-profile-from-domain) | Enrich domains with tech stack, DNS, socials, role emails and VAT ID |
| [Email Validator & Verifier: Bulk MX & Disposable Check](https://apify.com/rod_analytics/bulk-email-verifier) | Verify syntax, DNS MX, disposable domains and catch-all hints |
| [Email Format Finder: Company Email Pattern Lookup](https://apify.com/rod_analytics/email-format-finder) | Discover corporate email patterns like first.last@domain.com |
| [Work Email Finder: Find Email by Name and Domain](https://apify.com/rod_analytics/work-email-finder) | Find and verify a person's work email from name and company domain |
| [Phone Number Validator & Enrichment: E.164, Carrier & Country](https://apify.com/rod_analytics/phone-number-validator) | Validate phone numbers, convert to E.164 and detect country and line type |
| [VIES VAT Checker & EU Company Registry Lookup](https://apify.com/rod_analytics/eu-company-lookup) | Validate EU VAT numbers via VIES and look up company registry records |
| [Companies House Scraper: UK Company Search, No API Key](https://apify.com/rod_analytics/uk-companies-house) | Search UK companies and retrieve profiles, officers and filings |
| [EU TED Tenders Scraper & Alerts: Public Procurement](https://apify.com/rod_analytics/ted-tenders) | Search and monitor EU public procurement notices from TED |
| [Greenhouse, Lever & Ashby Job Scraper: 8 ATS in One Feed](https://apify.com/rod_analytics/multi-ats-jobs-api) | Extract structured job postings from 8 ATS platforms in one feed |
| [GitHub Scraper: Repo Stats, Stars, Trending & Search](https://apify.com/rod_analytics/github-repo-stats) | Repository stats, stars, languages and trending GitHub searches |
| [Hacker News Scraper: Stories, Comments & Who's Hiring Jobs](https://apify.com/rod_analytics/hackernews-scraper) | Stories, Ask/Show HN, comments and Who's Hiring job posts |
| [RSS & Atom Feed Reader: Clean JSON, Discovery & Only-New Mode](https://apify.com/rod_analytics/rss-feed-reader) | Read RSS, Atom, JSON Feeds and OPML lists with feed discovery and state |

# Changelog

This Actor's version history is a separate document: https://apify.com/rod_analytics/image-ocr-api/changelog.md

# Actor input Schema

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

Public http(s) URLs to PNG, JPEG, WebP, GIF, BMP or TIFF images (including screenshots, receipts, scans or photos).

## `uploadedFile` (type: `string`):

Optional image uploaded from your computer via Apify Console.

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

Tesseract language codes (e.g. eng, deu, fra, spa, lit, pol, rus, jpn, chi_sim). Uses eng by default.

## `includeBoxes` (type: `boolean`):

Return line-level text, confidence and pixel bounding boxes (left, top, width, height).

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

Also return word-level bounding boxes and per-word confidence scores.

## `preprocess` (type: `boolean`):

Auto-rotate by EXIF, flatten transparent backgrounds onto white, and gently upscale small images under 900 px wide.

## `psm` (type: `integer`):

3 = auto layout (default), 6 = uniform block of text, 11 = sparse text for screenshots/UI.

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

How many images to OCR in parallel.

## `maxImageSizeMb` (type: `integer`):

Skip images larger than this size.

## Actor input object example

```json
{
  "imageUrls": [
    "https://tesseract.projectnaptha.com/img/eng_bw.png"
  ],
  "languages": [
    "eng"
  ],
  "includeBoxes": true,
  "includeWordBoxes": false,
  "preprocess": true,
  "psm": 3,
  "maxConcurrency": 3,
  "maxImageSizeMb": 25
}
```

# Actor output Schema

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

No description

## `overview` (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://tesseract.projectnaptha.com/img/eng_bw.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rod_analytics/image-ocr-api").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"] }

# Run the Actor and wait for it to finish
run = client.actor("rod_analytics/image-ocr-api").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"
  ]
}' |
apify call rod_analytics/image-ocr-api --silent --output-dataset

```

## MCP server setup

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

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/wbhZuTeHj8HWnPDDU/builds/UjmJsjDN3DV2FpSjB/openapi.json
