# Image Text Scraper: Bulk OCR for Web Pages (EN / Chinese) (`fuji8899/image-text-scraper`) Actor

Crawl any web page and OCR every image into clean text. Strongest on English and Chinese printed text; 13 languages available. Skips icons and ads, retries rate-limited CDNs, per-image timeouts so one slow image never kills the run. No API key or GPU. Structured JSON output.

- **URL**: https://apify.com/fuji8899/image-text-scraper.md
- **Developed by:** [fuji chen](https://apify.com/fuji8899) (community)
- **Categories:** Developer tools, AI, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% 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

## Image Text Scraper — Bulk OCR from Web Pages & Images

Point it at a **web page** and it finds every image, then extracts the text from all of them.
Or feed it a list of image URLs directly.

**Strongest on printed English and Chinese.** 13 languages available in total:
English, Chinese (Simplified & Traditional), Japanese, Korean, Russian, French, German,
Spanish, Italian, Portuguese, Arabic — see the accuracy table below before relying on
non-Latin scripts.

**No API key. No GPU. No per-page fees.**

> Built for lead generation, competitor research, screenshot pipelines and LLM data extraction.

***

### Where this Actor is strong, and where it is not

We would rather tell you upfront than have you find out after a paid run.

| Content | Accuracy | Notes |
|---|---|---|
| **Printed English** — screenshots, posters, product images, UI, memes | ★★★★★ | Measured 19/19 lines correct on a dense infographic |
| **Printed Chinese** (Simplified & Traditional) — signage, menus, packaging, screenshots | ★★★★★ | Measured 100% on street signs and mixed CN/EN posters |
| **Latin-script languages** — French, German, Spanish, Italian, Portuguese | ★★★★ | Good; accents occasionally misread on low-res or angled photos |
| **Russian, Arabic** | ★★★ | Available, but right-to-left and cursive scripts degrade on small text |
| **Japanese, Korean** | ★★ | Available, but **street signs and angled photos perform poorly**. Flat printed text (menus, packaging, screenshots) is noticeably better |
| **Handwriting** | ☆ | Not supported by the underlying model |
| **Dense documents** — full A4 pages, tables, long articles | ☆ | Very slow (minutes per image) and error-prone. Use a dedicated document-OCR Actor instead |
| **Text smaller than ~12 px** | ★ | Accuracy drops sharply |

**Rule of thumb:** if a human can read it comfortably in a screenshot, this Actor can too.
If it is a photo of a tilted sign at night, expect errors.

***

### Quick start

**1. Crawl a page and OCR every image on it**

```json
{
  "pageUrl": "https://en.wikipedia.org/wiki/Receipt"
}
```

**2. OCR a batch of image URLs**

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

**3. Chinese + English page**

```json
{
  "pageUrl": "https://example.cn/products",
  "languages": ["chinese", "en"],
  "maxImagesPerPage": 10
}
```

**4. From Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("fuji8899/image-text-scraper").call(run_input={
    "pageUrl": "https://en.wikipedia.org/wiki/Receipt",
    "languages": ["en"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["status"] == "ok":
        print(item["source"], "->", item["text"][:80])
```

**5. From JavaScript**

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('fuji8899/image-text-scraper').call({
  pageUrl: 'https://en.wikipedia.org/wiki/Receipt',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter(i => i.status === 'ok').map(i => i.text));
```

***

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `pageUrl` | string | — | Crawl this page, OCR every image found |
| `pageUrls` | array | — | Batch of pages |
| `imageUrl` | string | — | OCR a single image directly |
| `imageUrls` | array | — | Batch of direct image URLs |
| `imageBase64` | string | — | Raw base64 (data URI allowed) |
| `languages` | array | `["en"]` | `en`, `chinese`, `ch_sim`, `ch_tra`, `japanese`, `korean`, `russian`, `french`, `german`, `spanish`, `italian`, `portuguese`, `arabic` |
| `minConfidence` | number | `0` | Drop lines below this score |
| `includeBoundingBoxes` | boolean | `true` | Return pixel coordinates |
| `maxImagesPerPage` | integer | `10` | Images taken from each page |
| `maxPages` | integer | `3` | Pages processed |
| `minImageSize` | integer | `120` | Skip images smaller than this (px) |
| `imageTimeoutSecs` | integer | `120` | Abort a single image after this many seconds; it is reported with `status: "timeout"` and the run continues |
| `maxOcrSeconds` | integer | `400` | Total OCR time budget; when exhausted, remaining images are marked `status: "skipped"` and everything already extracted is saved |

> Provide at least one of `pageUrl`, `pageUrls`, `imageUrl`, `imageUrls`, `imageBase64`.

> **About `languages`:** use the exact strings above. When calling via API, `"japanese"` works but `"ja"` is rejected by input validation. Pass only the languages that actually appear in your images — every extra language slows OCR down.

***

### Why the two timeouts exist

OCR is CPU-bound and a single text-dense image can block for minutes. Without guards, one bad
image would consume the whole platform timeout and you would get **nothing** — not even the
images that had already been processed successfully.

Instead:

1. Each image gets `imageTimeoutSecs`. If it exceeds that, the worker process is killed and the
   item is written with `status: "timeout"` plus a readable `error` message.
2. The whole OCR phase shares `maxOcrSeconds`. When the budget runs out, remaining images are
   written with `status: "skipped"` and the run finishes cleanly.

Every run also writes a `SUMMARY` record to the key-value store:

```json
{
  "imagesProcessed": 7,
  "skipped": 2,
  "failed": 1,
  "timedOut": 1,
  "totalCandidates": 10,
  "languages": ["en"],
  "imageTimeoutSecs": 120,
  "ocrTimeBudgetSecs": 400,
  "ocrSecondsTotal": 388.4
}
```

**Tuning advice:** start with `maxImagesPerPage: 3`. Look at `ocrSeconds` in the output. If your
images average 20s each, you can safely raise the limits. If one image alone burns 300s, it is a
document scan and this Actor is the wrong tool.

**A note on run-to-run variance:** OCR duration is not stable. The same dense English image has
been measured at 190s on one run and rejected at 180s on another, depending on how much CPU the
container received. If you are doing `languages: ["en"]` bulk work on dense marketing images,
set `imageTimeoutSecs` to **200 or higher** and `maxOcrSeconds` to **600**, otherwise the guard
may cut off images that would have succeeded.

***

### Output

One dataset item per image:

```json
{
  "source": "https://en.wikipedia.org/wiki/File:ReceiptSwiss.jpg",
  "origin": "https://en.wikipedia.org/wiki/Receipt",
  "status": "ok",
  "languages": ["en"],
  "lineCount": 6,
  "text": "RESTAURANT\nTable 12\nTotal 48.50",
  "width": 330,
  "height": 440,
  "lines": [
    {
      "text": "RESTAURANT",
      "confidence": 0.9612,
      "boundingBox": [[10, 8], [240, 8], [240, 38], [10, 38]]
    }
  ]
}
```

| Field | Meaning |
|---|---|
| `status` | `ok` / `failed` / `page_failed` |
| `text` | All lines joined with `\n` — ready for LLM input |
| `origin` | Which page the image came from |
| `lines[].confidence` | 0–1 per line |

A `SUMMARY` record is also written to the key-value store with processed / skipped / failed counts.

#### Smart filtering

Icons, spacers, tracking pixels and SVGs are skipped automatically so you don't waste compute
on UI chrome. Tune with `minImageSize`.

***

### Typical use cases

- **Lead generation** — OCR business cards, flyers, signage photos from a directory site
- **Competitor research** — extract pricing tables and spec sheets published as images
- **E-commerce QA** — read product labels, expiry dates and certifications
- **LLM data prep** — turn image-heavy pages into text for RAG
- **Archive digitisation** — bulk OCR scanned document galleries
- **Compliance monitoring** — snapshot and OCR regulatory notice pages

***

### FAQ

**Do I need my own API key?**
No. Everything runs inside the Actor.

**Does it need a GPU?**
No, CPU only. Budget roughly 5–15 seconds per image after the model is loaded.
Set memory to **2048 MB** (default) — 1024 MB is not enough for model loading.

**Why is the first image slow?**
Model weights (~100 MB) download once per container. Later images in the same run are fast.

**Can I OCR 1,000 images?**
Yes, but split it across multiple runs and raise the memory limit. Watch your compute budget.

**Does it execute JavaScript to find images?**
No — it parses server-rendered HTML. On JS-heavy sites (SPA) some images may be missed.
Pass those image URLs directly via `imageUrls` instead.

**What image formats work?**
JPG, PNG, WEBP, BMP, TIFF, GIF.

**Handwriting?**
Limited. Printed text is reliable.

***

### Notes & limitations

- Server-rendered HTML only — no headless browser, keeps runs fast and cheap.
- Model weights download on the first run per container.
- Rotated or heavily skewed images may need pre-processing.

***

### Keywords

`image text scraper` `bulk ocr` `ocr scraper` `website image ocr` `screenshot to text`
`image to text` `text extraction` `chinese ocr` `japanese ocr` `korean ocr`
`easyocr` `document digitisation` `lead generation` `data extraction` `computer vision`

# Actor input Schema

## `pageUrl` (type: `string`):

Give a web page URL and the Actor will find every image on it, then OCR them all.

## `pageUrls` (type: `array`):

Multiple pages to crawl. Limited by Max pages.

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

Skip crawling and OCR this single image directly.

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

A list of image URLs to OCR directly.

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

Raw base64-encoded image data (data: URI allowed).

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

13 languages supported. Pick only the ones that actually appear in your images - fewer languages means faster OCR. NOTE: if you call this Actor via API, use these exact strings (e.g. 'japanese', not 'ja'; 'korean', not 'ko').

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

Drop text lines below this confidence (0-1).

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

Return pixel coordinates for each text line.

## `maxImagesPerPage` (type: `integer`):

How many images to take from each crawled page. Keep this low (3-10) - OCR is CPU heavy and a dense infographic can take minutes.

## `maxPages` (type: `integer`):

Upper bound on how many page URLs are processed.

## `minImageSize` (type: `integer`):

Skip images whose longest side is below this. Filters out icons and spacers.

## `imageTimeoutSecs` (type: `integer`):

A single image that takes longer than this is aborted and reported with status 'timeout' instead of blocking the whole run. Raise it if your images are text-dense.

## `maxOcrSeconds` (type: `integer`):

When this budget runs out, remaining images are marked 'skipped' and whatever was already extracted is saved. Guard against the whole run being killed by a platform timeout.

## Actor input object example

```json
{
  "pageUrl": "https://en.wikipedia.org/wiki/Receipt",
  "languages": [
    "en"
  ],
  "minConfidence": 0,
  "includeBoundingBoxes": true,
  "maxImagesPerPage": 10,
  "maxPages": 3,
  "minImageSize": 120,
  "imageTimeoutSecs": 120,
  "maxOcrSeconds": 400
}
```

# Actor output Schema

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

One item per image: source URL, extracted text, confidence and bounding boxes.

## `summary` (type: `string`):

Counts of processed / skipped / failed images.

# 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 = {
    "pageUrl": "https://en.wikipedia.org/wiki/Receipt",
    "languages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fuji8899/image-text-scraper").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 = {
    "pageUrl": "https://en.wikipedia.org/wiki/Receipt",
    "languages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("fuji8899/image-text-scraper").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 '{
  "pageUrl": "https://en.wikipedia.org/wiki/Receipt",
  "languages": [
    "en"
  ]
}' |
apify call fuji8899/image-text-scraper --silent --output-dataset

```

## MCP server setup

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

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/PmbWrAOht2uC5v5kv/builds/XM4rHOfGUhUXY5dj0/openapi.json
