# Image to Text OCR — lines, positions, 8 languages (`docflow-tools/image-ocr-own-engine`) Actor

Extract text from images (PNG, JPEG, WebP, GIF, BMP, multi-page TIFF) with an own OCR engine — no Google Lens. Returns plain text, paragraphs, and each line with its position and confidence. Small screenshots are upscaled automatically.

- **URL**: https://apify.com/docflow-tools/image-ocr-own-engine.md
- **Developed by:** [DocFlow Tools](https://apify.com/docflow-tools) (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.60 / 1,000 image reads

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 to Text OCR — lines, positions, 8 languages

Extract text from **images** (PNG, JPEG, WebP, GIF, BMP and **multi-page TIFF**) with an **own OCR engine
(Tesseract) running inside the Actor**. No Google Lens or other third-party OCR service is called. You get the
plain text in reading order with paragraphs, and optionally **every line with its position and confidence**.
Small screenshots are upscaled automatically before reading. Images are read in memory and never stored.

### What you get

One dataset item per image URL:

| Field | Description |
|---|---|
| `url` | The image URL you gave |
| `status` | `ok`, or `error` with the reason in `error` |
| `pages` | Number of pages read (more than 1 only for multi-page TIFF) |
| `width`, `height` | Size of the (first) image in pixels |
| `text` | Plain text in reading order; paragraphs separated by a blank line |
| `markdown` | The same text; the pages of a multi-page TIFF are separated by `---` |
| `lines` | Optional (`includeLines`, on by default): `[{page, text, confidence, bbox}]`, `confidence` 0-100, `bbox` `[x0, y0, x1, y1]` in pixels of the original image |
| `meanConfidence` | Average confidence of the kept lines (0-100), or `null` if no text was found. Useful to spot bad scans |

#### How an image is read

1. The image is opened (all pages for TIFF), rotated according to its EXIF orientation, converted to grayscale and
   auto-contrasted.
2. If its longest side is under 1,200 px (typical screenshots, small photos), it is enlarged 2x before OCR. Images
   over 40 megapixels are reduced first.
3. Tesseract reads it in the languages you choose. Words are grouped into lines; each line gets the average word
   confidence and a bounding box converted back to the original image coordinates.
4. Lines below `minConfidence` are dropped as noise. The rest are sorted top to bottom, left to right, and joined
   into paragraphs where there is a large vertical gap.

### Use cases

- Get the text of screenshots, scanned pages, photos of documents, posters or labels.
- Read invoices, receipts and forms and use the line positions to pick fields by area.
- Make image archives searchable, or feed image text to an LLM or a RAG index.
- Filter out low-quality scans with `meanConfidence`.
- Read every page of a multi-page TIFF fax or scan in one item.

### How to use

1. Open the Actor in Apify Console and paste direct image links into **Image URLs**.
2. Choose the **Languages** present in your images (only the ones you need: fewer languages read better and faster).
3. Optionally switch off line positions or change the minimum confidence.
4. Click **Start**, then open the **Output** tab or export the dataset.

Input example (field names exactly as the Actor reads them):

```json
{
  "imageUrls": [
    "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
  ],
  "languages": ["eng", "deu", "fra"],
  "includeLines": true,
  "minConfidence": 30
}
```

| Input | Default | Notes |
|---|---|---|
| `imageUrls` | (required) | http or https links, up to 25 MB each |
| `languages` | `["eng"]` | Any of `spa`, `eng`, `fra`, `deu`, `ita`, `por`, `cat`, `nld`. Unknown codes are ignored; an empty list uses `spa` + `eng` |
| `includeLines` | `true` | Return `lines` with positions and confidence |
| `minConfidence` | `30` | 0-100. Lines read with lower confidence are discarded |

### Output example

```json
{
  "url": "https://example.com/scans/notice.png",
  "status": "ok",
  "pages": 1,
  "width": 1024,
  "height": 768,
  "text": "Opening hours\n\nMonday to Friday 9:00 - 18:00 Saturday 10:00 - 14:00",
  "markdown": "Opening hours\n\nMonday to Friday 9:00 - 18:00 Saturday 10:00 - 14:00",
  "lines": [
    { "page": 1, "text": "Opening hours", "confidence": 95.2, "bbox": [112, 64, 498, 118] },
    { "page": 1, "text": "Monday to Friday 9:00 - 18:00", "confidence": 91.7, "bbox": [112, 190, 702, 228] },
    { "page": 1, "text": "Saturday 10:00 - 14:00", "confidence": 90.4, "bbox": [112, 240, 560, 278] }
  ],
  "meanConfidence": 92.4
}
```

A failed image gets a short item, and the other images keep going:

```json
{ "url": "https://example.com/file.svg", "status": "error", "error": "not a supported image (PNG, JPEG, WebP, GIF, BMP, TIFF)" }
```

### Pricing

> **Prices by Apify discount tier:** the prices below are for the Bronze tier. **Free plan: 50 % off.** Silver: 10 % off. Gold and higher: 20 % off. Apify applies the right price automatically.

Pay per event, in USD. Platform compute is included in the event prices.

| Event | Price | When it is charged |
|---|---|---|
| Actor start | $0.00005 | Charged by Apify when a run starts, per GB of run memory (default memory: 1 GB) |
| `image-read` | $0.002 | Per image read successfully; a multi-page TIFF is charged once per page |

**Failed images are not charged** (download errors, files over 25 MB, unsupported formats). An image that is read
successfully but contains no text is charged like any other image.

Examples:

- **100 screenshots**: 0.00005 + 100 x 0.002 = **$0.20005**
- **One 10-page TIFF**: 0.00005 + 10 x 0.002 = **$0.02005**
- **1,000 product photos**: 0.00005 + 1,000 x 0.002 = **$2.00005**

You can set a maximum cost per run in Apify; once it is reached no further images are charged.

### Use it from code, AI agents and integrations

**Apify API** (runs the Actor and returns the dataset items in one call):

```bash
curl -X POST "https://api.apify.com/v2/acts/docflow-tools~image-ocr-own-engine/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"], "languages": ["eng", "deu", "fra"]}'
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("docflow-tools/image-ocr-own-engine").call(
    run_input={
        "imageUrls": ["https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"],
        "languages": ["eng"],
        "includeLines": False,
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["status"], item.get("meanConfidence"), item.get("text", "")[:200])
```

**AI agents**: the Actor can be called by AI agents (Claude, Cursor and other MCP clients) through the Apify MCP
server at https://mcp.apify.com.

**No-code**: connect it to Make, Zapier or n8n through the Apify integrations.

### Limits and notes

- Up to **25 MB** per image; only `http://` and `https://` URLs; redirects are followed; download timeout 120 s.
- Up to 2 images are processed at the same time.
- Formats: PNG, JPEG, WebP, GIF, BMP, TIFF. For GIF and animated WebP only the first frame is read. SVG, HEIC
  and PDF are not supported (for PDFs, use Document to Markdown for RAG below).
- Languages: Spanish, English, French, German, Italian, Portuguese, Catalan and Dutch (Latin script). Other
  scripts such as Chinese, Arabic or Cyrillic are not installed.
- Printed text works best. Handwriting, very low resolution, strong blur or perspective reduce accuracy; check
  `meanConfidence` and the per-line `confidence`.
- Tables are returned as lines of text, not as table structures.
- The URL must return the image itself; the Actor does not log in or render web pages.

### FAQ

**Does it use Google Lens, Google Vision or another cloud OCR?** No. OCR runs inside the Actor with Tesseract.

**Which languages should I select?** Only those that appear in your images. Each extra language makes recognition
slower and can add mistakes.

**What are `bbox` coordinates?** `[x0, y0, x1, y1]` of each line in pixels of the original image, top-left origin,
even when the image was enlarged or reduced internally.

**Why is some text missing?** Lines with confidence below `minConfidence` (default 30) are dropped. Lower it to
keep more text, or raise it to remove noise.

**Is a multi-page TIFF one item?** Yes: one item with all pages, `lines` tagged with their `page`, and pages
separated by `---` in `markdown`. It is charged once per page.

**Are my images stored?** No. Each image is held in memory while it is read and then discarded; only the text
result goes to your dataset.

### Related tools

- [Document to Markdown for RAG](https://apify.com/docflow-tools/document-to-markdown-rag) — PDF, Word, Excel, PowerPoint and HTML to Markdown and chunks, with OCR for scanned PDFs.
- [RSS, Atom & JSON Feed Reader](https://apify.com/docflow-tools/feed-reader-only-new) — feeds in one format, only new items on scheduled runs.
- [Bulk PageSpeed & Core Web Vitals](https://apify.com/docflow-tools/pagespeed-bulk-regression-monitor) — Google PageSpeed for many URLs with regression alerts.
- [Audio Transcriber (Whisper)](https://apify.com/docflow-tools/audio-transcriber-whisper-local) — audio and video to text and subtitles.
- [Merge, Dedupe & Transform Data](https://apify.com/docflow-tools/merge-dedupe-transform-data) — merge datasets and files, remove duplicates, export.
- [Website Screenshot Monitor](https://apify.com/docflow-tools/website-screenshot-monitor) — bulk screenshots with change detection.
- [Bulk Image Converter & Compressor](https://apify.com/docflow-tools/bulk-image-converter-compressor) — convert HEIC, AVIF and other formats, compress and resize images.
- [Sitemap URL Extractor](https://apify.com/docflow-tools/sitemap-url-extractor-reliable) — every URL of a site from its sitemaps.
- [SEO Audit Crawler](https://apify.com/docflow-tools/seo-audit-crawler-cheap) — on-page SEO score and issues per page.
- [Website to Markdown & llms.txt](https://apify.com/docflow-tools/website-to-markdown-llms-txt) — main content of web pages as Markdown for LLMs.

# Actor input Schema

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

Direct links to images: PNG, JPEG, WebP, GIF, BMP or TIFF (http or https, up to 25 MB each).

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

Languages in the images: spa, eng, fra, deu, ita, por, cat, nld. Choose only those you need.

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

Return every line with its bounding box \[x0, y0, x1, y1] and confidence (0-100).

## `minConfidence` (type: `integer`):

Lines read with lower confidence are discarded as noise.

## Actor input object example

```json
{
  "imageUrls": [
    "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
  ],
  "languages": [
    "eng",
    "deu",
    "fra"
  ],
  "includeLines": true,
  "minConfidence": 30
}
```

# 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 = {
    "imageUrls": [
        "https://tesseract-ocr.github.io/tessdoc/images/eurotext.png"
    ],
    "languages": [
        "eng",
        "deu",
        "fra"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("docflow-tools/image-ocr-own-engine").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-ocr.github.io/tessdoc/images/eurotext.png"],
    "languages": [
        "eng",
        "deu",
        "fra",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("docflow-tools/image-ocr-own-engine").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-ocr.github.io/tessdoc/images/eurotext.png"
  ],
  "languages": [
    "eng",
    "deu",
    "fra"
  ]
}' |
apify call docflow-tools/image-ocr-own-engine --silent --output-dataset

```

## MCP server setup

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

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/w6fcPapMcwalNvCm0/builds/gl4FIhtTsQzTQdtcz/openapi.json
