# Universal OCR (EN / 中文 / JP / KR) (`fuji8899/universal-image-ocr`) Actor

Convert any image (URL or base64) to text with Tesseract. English, Simplified & Traditional Chinese, Japanese, Korean. One dataset item per run.

- **URL**: https://apify.com/fuji8899/universal-image-ocr.md
- **Developed by:** [fuji chen](https://apify.com/fuji8899) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 95.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

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

## Universal OCR — Extract Text from Images in 5+ Languages

Extract text from **any image** in English, Chinese (Simplified & Traditional), Japanese,
Korean, Russian, French, German, Spanish, Italian, Portuguese and Arabic.

No API key required. No GPU required. Pay only for the compute your run consumes.

> **Best for**: screenshots, receipts, invoices, scanned documents, product labels,
> menus, memes, and feeding OCR text into LLM / RAG pipelines.

***

### Quick start (copy & paste)

**1. One image**

```json
{
  "imageUrl": "https://raw.githubusercontent.com/JaidedAI/EasyOCR/master/examples/english.png"
}
```

**2. Chinese + English on the same image**

```json
{
  "imageUrl": "https://your-image-url.com/menu.png",
  "languages": ["chinese", "en"]
}
```

**3. Batch — 100 images in one run**

```json
{
  "imageUrls": [
    "https://your-image-url.com/a.png",
    "https://your-image-url.com/b.jpg",
    "https://your-image-url.com/c.webp"
  ],
  "languages": ["en"]
}
```

**4. From base64 (for private images)**

```json
{
  "imageBase64": "data:image/png;base64,iVBORw0KGgoAAAANS...",
  "languages": ["en"]
}
```

**5. Call it from Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("fuji8899/universal-image-ocr").call(run_input={
    "imageUrl": "https://your-image-url.com/receipt.png",
    "languages": ["en"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["text"])
    for line in item["lines"]:
        print(f"  {line['confidence']:.2f}  {line['text']}")
```

**6. Call it from JavaScript**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('fuji8899/universal-image-ocr').call({
  imageUrl: 'https://your-image-url.com/receipt.png',
  languages: ['en'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].text);
```

***

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `imageUrl` | string | — | Public URL of a single image |
| `imageUrls` | array | — | Batch of image URLs |
| `imageBase64` | string | — | Raw base64 (data URI allowed) |
| `languages` | array | `["en"]` | Accepted values: `en`, `chinese`, `ch_sim`, `ch_tra`, `japanese`, `korean`, `russian`, `french`, `german`, `spanish`, `italian`, `portuguese`, `arabic` |
| `minConfidence` | number | `0` | Drop lines below this confidence (0–1) |
| `includeBoundingBoxes` | boolean | `true` | Return pixel coordinates |
| `gpu` | boolean | `false` | Enable GPU (only if your plan allows GPU actors) |

> At least one of `imageUrl`, `imageUrls`, `imageBase64` is required.

***

### Output

One dataset item per image:

```json
{
  "source": "https://example.com/receipt.png",
  "languages": ["en", "chinese"],
  "lineCount": 2,
  "text": "INVOICE #1024\nTotal: $59.90",
  "lines": [
    {
      "text": "INVOICE #1024",
      "confidence": 0.9812,
      "boundingBox": [[10, 8], [240, 8], [240, 38], [10, 38]]
    },
    {
      "text": "Total: $59.90",
      "confidence": 0.9655,
      "boundingBox": [[10, 52], [210, 52], [210, 80], [10, 80]]
    }
  ]
}
```

| Field | Meaning |
|---|---|
| `text` | All detected lines joined with `\n` — ready for LLM input |
| `lines[].confidence` | 0–1, per line. Filter with `minConfidence` |
| `lines[].boundingBox` | 4 corner points, `[x, y]` in pixels |

#### Verified accuracy

Tested on a real WHO public-health poster containing mixed English and Chinese:
**12 / 12 lines detected correctly**, confidence 0.74–0.96.

***

### Typical use cases

- **Accounting** — digitise invoices and receipts into structured text
- **RAG pipelines** — extract text from screenshots before embedding
- **E-commerce** — read product labels, spec sheets, expiry dates
- **Translation** — pull CJK menu / signage text, then translate
- **Archives** — bulk OCR a folder of scanned images via `imageUrls`
- **Monitoring** — OCR dashboard screenshots on a schedule

***

### FAQ

**Do I need my own API key?**
No. The model runs inside the Actor. You only pay for Apify compute.

**Does it need a GPU?**
No. CPU-only. A typical single-image run finishes in seconds.

**Why is the first run slow?**
Model weights (~100 MB) download on the first run per container. Later runs reuse the cache.

**Can I process 1,000 images?**
Yes — use `imageUrls` in batches. Split large jobs across runs to stay inside the memory limit
(1 GB by default).

**Does it handle handwriting?**
Partly. Printed text is reliable; cursive handwriting is limited.

**Which image formats?**
Any format Pillow supports: JPG, PNG, WEBP, BMP, TIFF, GIF.

**Do bounding boxes come back in a specific coordinate space?**
Yes — pixel coordinates of the **original** image, four corners in order.

***

### Notes & limitations

- First run per container downloads model weights (~100 MB).
- Very large batches should be split to stay within the memory limit.
- Handwriting recognition is limited; printed text works best.
- Rotated / heavily skewed images may need pre-processing.

***

### Keywords

`ocr` `image to text` `text extraction` `easyocr` `chinese ocr` `japanese ocr`
`korean ocr` `invoice ocr` `receipt ocr` `screenshot to text` `document digitisation`
`pdf ocr` `multilingual ocr` `computer vision` `data extraction`

# Actor input Schema

## `imageUrl` (type: `string`):

Public URL of a single image to OCR.

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

A list of public image URLs to OCR in one run.

## `imageBase64` (type: `string`):

Raw base64-encoded image data (optionally a full data: URI).

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

Languages present in the images. Supports English, Chinese (Simplified/Traditional), Japanese, Korean and more.

## `minConfidence` (type: `number`):

Discard detected text lines below this confidence score (0-1).

## `includeBoundingBoxes` (type: `boolean`):

Return pixel coordinates for each detected line.

## `gpu` (type: `boolean`):

Enable GPU acceleration (not required; CPU works on all plans).

## Actor input object example

```json
{
  "imageUrl": "https://apify.com/img/apify-logo.svg",
  "languages": [
    "en"
  ],
  "minConfidence": 0,
  "includeBoundingBoxes": true,
  "gpu": false
}
```

# Actor output Schema

## `ocrResults` (type: `string`):

Dataset of extracted text lines. One item per processed image, with source, lineCount, text and per-line confidence/bbox.

# 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 = {
    "imageUrl": "https://apify.com/img/apify-logo.svg",
    "languages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fuji8899/universal-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 = {
    "imageUrl": "https://apify.com/img/apify-logo.svg",
    "languages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("fuji8899/universal-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 '{
  "imageUrl": "https://apify.com/img/apify-logo.svg",
  "languages": [
    "en"
  ]
}' |
apify call fuji8899/universal-image-ocr --silent --output-dataset

```

## MCP server setup

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