# Image to Text OCR (`ridgeline_apps/image-to-text-ocr`) Actor

Extract text from images by URL or upload: receipts, screenshots, scans and photos of documents. PNG, JPEG, WebP, TIFF, BMP, GIF. Confidence scores and optional word positions. Images with no text are free.

- **URL**: https://apify.com/ridgeline_apps/image-to-text-ocr.md
- **Developed by:** [Promise Land Provision LLC](https://apify.com/ridgeline_apps) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 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.
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

Extract text from images: paste image links or upload files and get the text back as JSON, CSV or XLSX. It works on screenshots, receipts, scanned pages, photos of documents, labels and signs. It reads PNG, JPEG, WebP, multi-page TIFF, BMP and GIF.

**Built for:** digitizing receipts and scans, pulling text from screenshots, feeding images into AI and search pipelines, and bulk OCR jobs in Make, Zapier or n8n.

### What you get

- **Text with confidence.** Each image returns its text, keeping lines and paragraphs, plus an overall confidence score from 0 to 100.
- **Word positions (optional).** Every word with its confidence and pixel box (left, top, width, height) in the original image's coordinates. Useful for highlighting, redaction and form parsing.
- **Layout modes.** Auto for documents and screenshots, Sparse for signs, labels and product photos, Single block for a cropped paragraph, Single line for codes and plates.
- **7 languages:** English, Spanish, French, German, Portuguese, Italian and Dutch, mixable in one run.
- **Automatic cleanup.** It fixes phone-photo rotation (EXIF), flattens transparent backgrounds, converts to grayscale, boosts contrast and upscales small images before OCR.
- **Multi-page TIFF.** Each page is read, with per-page text.
- **Fair billing.** Images with no text, failed downloads and unsupported files are never charged. The run stops cleanly at your maximum cost per run.

### How to use

1. Add image links (one per line) or upload images in **Images**.
2. Pick the **Languages** that appear in your images.
3. Choose a **Text layout**: Auto suits most images.
4. Click **Start**, then download results as JSON, CSV, XLSX or HTML, or fetch them with the API.

```bash
curl -X POST "https://api.apify.com/v2/acts/ridgeline_apps~image-to-text-ocr/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"files": ["https://example.com/receipt.jpg"], "ocrLanguages": ["eng"]}'
```

### Input

| Field | Description | Default |
|---|---|---|
| `files` | Image URLs or uploaded files | required |
| `ocrLanguages` | Any of `eng`, `spa`, `fra`, `deu`, `por`, `ita`, `nld` | `["eng"]` |
| `layout` | `auto`, `sparse`, `block` or `line` | `auto` |
| `includeWordBoxes` | Add every word with confidence and position | `false` |
| `maxFileSizeMb` | Larger files are skipped (free) | 20 |
| `maxPagesPerImage` | Pages read from multi-page TIFFs | 10 |

### Output

```json
{
  "url": "https://example.com/receipt.jpg",
  "fileName": "receipt.jpg",
  "status": "ok",
  "text": "Invoice number 48213 was issued to Ridgeline Supply on March\n4 2026. The total amount due is 1,284.50 dollars...",
  "confidence": 95.7,
  "wordCount": 34,
  "hasText": true,
  "format": "jpeg",
  "width": 1600,
  "height": 700,
  "pageCount": 1
}
```

With **Include word positions** on, a `pages` list includes every word:

```json
{ "text": "48213", "confidence": 96.4, "left": 412, "top": 160, "width": 118, "height": 34 }
```

Images that can't be read come back with `"status": "error"` and a plain-English `error`. They are never charged.

### Pricing

Pay per image with text found, with no subscription. Each page of a multi-page TIFF counts as one image. Images with no text and failed images are free. The exact price is shown on the Pricing tab, and you can set a maximum cost per run in the run options.

### FAQ

**How accurate is it?** On clear printed text, such as screenshots, scans and receipts, confidence is usually above 90%. Blurry, angled or low-light photos score lower; the confidence score tells you which results to double-check.

**Handwriting?** OCR is designed for printed text. Handwriting results are poor.

**Animated GIFs?** Only the first frame is read.

**Where do my images go?** Images are downloaded into your own Apify run and processed there with Tesseract. Nothing is sent to any third-party AI or OCR service.

### Legal

Only process images you have the right to use. You're responsible for the images you submit and how you use the extracted text. Not intended for medical records (PHI) or other regulated data that requires a signed processing agreement.

Built on open-source software: Tesseract OCR (Apache-2.0), Pillow (MIT-CMU) and httpx (BSD-3-Clause).

Questions or a feature request? Open an issue on the **Issues** tab.

# Actor input Schema

## `files` (type: `array`):

Paste image URLs (one per line) or upload images. Supports PNG, JPEG, WebP, TIFF (including multi-page), BMP and GIF.

## `ocrLanguages` (type: `array`):

Languages in your images. Pick every language that appears.

## `layout` (type: `string`):

Auto works for documents and screenshots. Use Sparse for signs, labels, product photos and memes; Single block for a cropped paragraph; Single line for one line of text such as a code or plate.

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

Add every word with its confidence and pixel position (left, top, width, height). Useful for highlighting, redaction and form parsing.

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

Larger files are skipped and not charged.

## `maxPagesPerImage` (type: `integer`):

Multi-page TIFF files: read at most this many pages. Each page with text counts as one image.

## Actor input object example

```json
{
  "files": [
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ],
  "ocrLanguages": [
    "eng"
  ],
  "layout": "auto",
  "includeWordBoxes": false,
  "maxFileSizeMb": 20,
  "maxPagesPerImage": 10
}
```

# 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 = {
    "files": [
        "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.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("ridgeline_apps/image-to-text-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 = { "files": [
        "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
        "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ridgeline_apps/image-to-text-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 '{
  "files": [
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ]
}' |
apify call ridgeline_apps/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ridgeline_apps/image-to-text-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/krB1W0NEUCwD5fY3r/builds/ZpBlEsgylz6GdfeFV/openapi.json
