# Image OCR: Text from Images and Scanned PDFs (`cyrus_1/image-ocr-text-extractor`) Actor

Read text from images (PNG, JPEG, WebP, TIFF) and PDFs: one row per image or page with text, lines, confidence and positions. 11 script families, with Arabic in right-to-left order. PDF pages that already have text cost $1 per 1,000. No login or API key.

- **URL**: https://apify.com/cyrus_1/image-ocr-text-extractor.md
- **Developed by:** [Mohamed Ayman](https://apify.com/cyrus_1) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 image or pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

Extract text from images and scanned PDFs (PNG, JPEG, WebP, TIFF and PDF links), with a confidence score and position for every line, for teams digitising scans, receipts and screenshots in bulk. It costs $4 per 1,000 images or scanned pages where text is found and $1 per 1,000 where none is; PDF pages that already have a text layer are read from it for $1 per 1,000 instead of being OCRed; failed downloads and error rows are free.

Give it public image or PDF links and get one JSON row per image, per TIFF frame and per PDF page, with the joined text and every line with its box. No login, no paid OCR service, no proxy.

### Image OCR: Text from Images and Scanned PDFs

- **Text plus layout data.** Joined `text`, every line with `confidence` and a four-corner `box`, and optionally every word.
- **Scans and photos.** Reads multi-page TIFFs frame by frame, plain images, and scanned PDF pages (each page is rendered first, then read).
- **Text layer first for PDFs.** A PDF page that already contains its own text is read from that text and skipped by OCR, at $1 per 1,000 pages instead of $4. Only the scanned pages are OCRed, so a PDF that is part text and part scan costs what it should.
- **Any way of giving files.** Links, Google Drive and Dropbox share links, base64 text, Apify key-value store records, a dataset with a link field, a CSV or TXT list of links, ZIP archives, and web pages that link to PDFs. Every link goes through the same safe downloader.
- **11 recognisers.** English and other Latin-script languages, Chinese, Japanese, Korean, Arabic script, Cyrillic, Devanagari, Thai, Greek, Tamil and Telugu.
- **Arabic, Persian and Urdu in reading order.** Right-to-left lines come back in logical order, so the text can be searched, copied and fed to a language model as it is written: lines read right to left, a line the detector split in two reads as one, numbers stay where they belong, and `words` are in reading order too.

### Quick start

Paste this input as it is. An empty input reads a default public IRS form.

```json
{
  "urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"],
  "language": "en",
  "quality": "fast",
  "pages": "1"
}
```

### Example output

One row per image or PDF page. The IRS form above has a text layer, so by default its pages are read from it (`textSource: "text-layer"`, `charges: {"text-layer-page": 1}`, no `lines`). To force OCR, set `usePdfTextLayer` to false. This row is from a real OCR run on page 1 of that form (text shortened, only the first of 103 lines shown):

```json
{
  "rowType": "ocr",
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "finalUrl": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "origin": "url",
  "fileName": null,
  "parentUrl": null,
  "sourceType": "pdf",
  "textSource": "ocr",
  "pageNumber": 1,
  "pageCount": 6,
  "status": "ok",
  "error": null,
  "errorCode": null,
  "language": "en",
  "width": 1237,
  "height": 1600,
  "renderDpi": 145.5,
  "text": "W-9\nRequest for Taxpayer\nForm\nGive form to the\n(Rev. March 2024)\nIdentification Number and Certification\n…",
  "lineCount": 103,
  "averageConfidence": 0.9835,
  "lines": [
    {
      "text": "W-9",
      "confidence": 0.9923,
      "box": [[108, 64], [201, 64], [201, 115], [108, 115]],
      "words": null
    }
  ],
  "ocrSeconds": 2.957,
  "charges": { "image": 1 },
  "extractedAt": "2026-11-18T17:23:11Z"
}
```

Boxes are in pixels of the image (`width` x `height`). For PDF pages they are in the rendered page (long side about 1,600 px, see `renderDpi`). Lines come in reading order, top to bottom and left to right within a row. A failed file or page gives `rowType: "error"` with an `errorCode` and a message.

### Use cases

- Extract text from scanned PDFs and photographed documents.
- Read receipts, invoices and ID-style forms into structured lines.
- Pull text from screenshots, signs and product photos in bulk.
- Make scanned archives searchable by turning pages into text.
- Read Arabic, Cyrillic, Chinese, Japanese or Korean text from images.
- Feed text from images into an LLM or RAG pipeline, using the confidence score to filter weak lines.

### Input

| Field | Default | What it does |
|---|---|---|
| `urls` | one IRS form, only if you give no file at all | Image, PDF or ZIP links. Google Drive and Dropbox share links work |
| `base64Files` | none | Files as base64 text (or a data: URI), or `{"name": "a.pdf", "data": "..."}` objects |
| `keyValueStoreId`, `keyValueStoreKeys` | none | Records of an Apify key-value store, stored with their own content type (for example `application/pdf`). No store ID means this run's own default store |
| `datasetId`, `datasetField`, `datasetLimit` | none, none, 1000 | A dataset of yours and the field that holds each link (a link, a list of links, or `{"url": ...}`; `a.b` goes one level deeper) |
| `urlListUrls`, `urlListColumn` | none | Links to a TXT (one link per line) or CSV file that lists links; the CSV column is found by header or content, or named |
| `followPdfLinks`, `maxLinksPerPage` | false, 20 | A link that returns a web page is read for links to PDFs, one level deep, at most this many per page |
| `maxFilesPerZip`, `maxZipUncompressedMb` | 200, 500 | Limits for ZIP archives, which are expanded in memory |
| `language` | `en` | Which recogniser to use, see below |
| `quality` | `fast` | `fast` = smaller model, `accurate` = larger model, about 4 times slower on dense pages. English, Chinese and Japanese only (Japanese always uses the larger one) |
| `usePdfTextLayer` | true | PDF pages that have their own text (40 or more letters or digits) are read from it, with no OCR, for $0.001. Off means OCR every page |
| `pages` | all | PDF pages to read, for example `1-3,5` or `4-` |
| `minConfidence` | 0.5 | Lines below this confidence (0 to 1) are dropped |
| `includeWordBoxes` | false | Position and confidence per word |
| `includeLines` | true | The `lines` list. Off gives the joined `text` only |
| `maxPagesPerPdf` | 500 | At most this many pages of one PDF or TIFF |
| `maxFileSizeMb` | 50 | Bigger files give a free error row |

### Languages

- `en`: English and the other Latin-script languages, such as French, German, Spanish, Portuguese, Italian, Turkish and Vietnamese.
- `ch` Chinese, `japan` Japanese, `korean` Korean.
- `arabic`: Arabic script (Arabic, Persian, Urdu).
- `cyrillic`: Russian, Ukrainian, Bulgarian and others.
- `devanagari`: Hindi, Marathi, Nepali.
- `th` Thai, `el` Greek, `ta` Tamil, `te` Telugu.

That is 11 recognisers covering several dozen languages, not 100 or more. One run uses one language. English and Arabic are tested. For `arabic`, `text` joins the boxes of one line with a space and starts a new text line for each visual row; `lines` and `lineCount` still hold one entry per detected box, so a short Arabic line can be one text line and two or three entries in `lines`.

### How much does it cost?

- **$4 per 1,000 images or PDF pages** where text was found (`image`).
- **$1 per 1,000** for an image or page that was read but had no text above the confidence threshold (`image-no-text`).
- **$1 per 1,000 PDF pages read from their text layer** (`text-layer-page`): a page that already holds at least 40 letters or digits of text is not OCRed. These rows have no line boxes or confidence, and `textSource` says `text-layer`. A scan whose hidden layer holds only a stamp or a page number is below that bar, so it is OCRed as usual.
- **Dense pages** add $0.004 per extra block of lines. For `en`, `ch` and `japan` that starts above 150 lines, one event per extra 100 lines. For `korean`, `arabic`, `cyrillic`, `devanagari`, `th`, `el`, `ta` and `te` it starts above 40 lines, one event per extra 40 lines.
- **Accurate mode** adds $0.004 per image or page, whatever the line count (and always for Japanese).
- Each row shows what it was charged in `charges`, for example `{"image": 1, "dense-page": 2}`.
- Free: failed downloads, files that are not images or PDFs, corrupt files and every error row.
- Apify adds a very small run-start charge, shown on the Pricing tab.

**Worked example with the free $5 monthly credit.** Apify's free plan includes $5 of credit each month. In fast mode that reads about 1,250 images with text. A 6-page scanned form at $0.004 a page costs $0.024, so $5 covers about 208 such forms. The same pages in accurate mode cost $0.008 each, so the credit covers about 625 pages. A 6-page PDF that already has a text layer costs 6 x $0.001 = $0.006, so $5 covers about 833 of them.

To cap spending, set a maximum cost per run in the run options. The actor stops cleanly when it is reached.

### Limits

- OCR is imperfect. Low resolution, handwriting, heavy skew, stylised fonts and dense small print cause errors. Check `averageConfidence`.
- Right-to-left text (`language: arabic`, also for Persian and Urdu): `text` and every line and word are in logical (reading) order, and the boxes of one line are listed right to left. The ordering is tested on generated Arabic pages, including lines with numbers. Two limits: the Arabic recogniser often does not read Latin words inside an Arabic line (numbers are read), so a mixed line may lose its Latin word; and PDF pages read from a text layer (`textSource: text-layer`) keep the order the PDF stores them in, which for Arabic is not checked. For those, set `usePdfTextLayer` to false to OCR the pages.
- Tables, columns and layout are not rebuilt. You get lines with boxes, so reconstruct the layout from the boxes if you need it.
- Large images are shrunk to 4,000 px on the long side before reading (boxes are scaled back). Images over 50 megapixels are refused.
- GIF and BMP are not accepted. Password-protected PDFs are not opened.
- Downloads use http and https only, with a 50 MB and 60 second default limit. Links to private or internal addresses are refused. There is no proxy, so a site that blocks Apify's servers gives a free error row.
- For non-English languages, the first run may take a few seconds longer while the model loads.

### Your files stay yours

The images and documents you send belong to you. They are downloaded into memory, read and dropped. Nothing is written to disk or to a key-value store, and nothing is kept after the run except the output dataset and the run input you provided.

- **Sources.** Google Drive and Dropbox links must be public ("anyone with the link"). A Drive file link and a Docs, Slides or Sheets link (exported as PDF) work; a Drive folder does not (`folder_not_supported`), and Drive may show a virus-scan page instead of a very large file, which gives a free error. A Dropbox folder link is downloaded as a ZIP. OneDrive and SharePoint links are not converted. Key-value store records must be files stored with their own content type, not JSON or text.
- **ZIP archives** are unpacked in memory, never written to disk, one file at a time. Limits: at most `maxFilesPerZip` readable files (200), at most `maxZipUncompressedMb` when unpacked (500 MB), a member unpacking to more than 100 times its compressed size is refused, a member bigger than `maxFileSizeMb` is skipped, password-protected members are skipped, and a ZIP inside a ZIP is not opened. The ZIP file itself counts against `maxFileSizeMb`, and an archive is held in memory while it is read, so raise the memory for very large archives. Each readable file is charged like a file you gave directly.
- **Web pages** are read for PDF links only when `followPdfLinks` is on, one level deep: links found on the page are read as PDFs, and a PDF link that returns another web page or a ZIP is refused. Only links ending in `.pdf`, `citation_pdf_url` meta tags and alternate-PDF link tags are found; links built by JavaScript are not seen.
- **Error codes** for sources: `bad_base64`, `bad_key`, `record_not_found`, `store_unavailable`, `missing_field`, `bad_list`, `empty_list`, `no_pdf_links`, `folder_not_supported`, `corrupt_archive`, `archive_too_large`, `suspicious_archive`, `encrypted`, `no_supported_files`. All are free.

### FAQ

**Which languages does it read?**
Eleven recognisers covering several dozen languages: English and other Latin-script languages, Chinese, Japanese, Korean, Arabic script (Arabic, Persian, Urdu), Cyrillic, Devanagari, Thai, Greek, Tamil and Telugu. One run uses one language. English and Arabic are the most tested, so try a sample of your own files for the others.

**Does it read Arabic, Persian and Urdu in the right order?**
Yes, with language set to arabic. The text comes back in logical order (the order you would type it), the boxes of one line are listed right to left and joined into one text line, numbers keep their place after the words they follow, and with includeWordBoxes the words are in reading order with their own boxes. It is tested on generated Arabic pages, including lines with numbers. Check a sample of your own: the recogniser is a general one, it can misread letters in small or decorative print, and it often skips Latin words inside an Arabic line.

**How accurate is it?**
Accuracy depends on the image. Clean printed text reads well; low resolution, handwriting, heavy skew, stylised fonts and dense small print cause errors. Every line carries a confidence score and every row has averageConfidence, so you can filter or review weak results. Lines below minConfidence, 0.5 by default, are dropped.

**What do I pay for pages with no text, or failures?**
A page that was read but had no text above the confidence threshold costs $0.001, and so does a PDF page read from its text layer. Failed downloads, files that are not images or PDFs, corrupt files and every other error row are free. The charges field on each row shows exactly what that row cost, so you can reconcile it with your bill.

**Does it work on scanned PDFs?**
Yes. Each scanned PDF page is rendered to an image and read, and you get one row per page. Pages that already have a text layer are not OCRed: they are read from that text for $0.001 and the row says textSource text-layer. A PDF that is part text and part scan therefore pays OCR prices only for the scanned pages. Set usePdfTextLayer to false to OCR every page anyway. Use the pages input, for example 1-3,5, to read only some pages. If all your PDFs have a real text layer, PDF to Text and Markdown is cheaper and gives Markdown and metadata.

**Are my files stored?**
No. Images and documents are downloaded into memory, read and dropped. Nothing is written to disk or to a key-value store, and nothing is kept after the run except the output dataset in your own Apify account and the run input you provided. Links to private or internal addresses are refused.

**Does it need a login or a paid service?**
No. The OCR engine, RapidOCR with PaddleOCR models, runs on CPU inside the actor. There is no login, no key for any outside service and no proxy. Because there is no proxy, a site that blocks Apify's servers will give a free error row for that link instead of a result.

**When does accurate mode make sense?**
Accurate mode uses a larger model that is about four times slower and adds $0.004 per image or page. It applies to English, Chinese and Japanese; Japanese always uses it. Try fast first on a sample, check averageConfidence, and switch to accurate only for dense or difficult pages where fast makes mistakes.

**Can I schedule it or call it from my own tools?**
Yes. Run it from Apify Schedules or call it through the Apify API with the input shown above. n8n, Make and Zapier have Apify integrations, and AI agents can run it through Apify's MCP server. Results land in the run's default dataset, ready to download as JSON, CSV or Excel.

**Can I send files instead of links?**
Yes. Pass base64 text in base64Files, or put the files in a key-value store and list their keys in keyValueStoreKeys, or point the actor at a dataset of links with datasetId and datasetField. Rows say where each file came from in origin, fileName and parentUrl; the base64 data itself is never copied into the output.

**Do Google Drive and Dropbox links work?**
Public share links do. The actor turns them into direct-download links before fetching, so you can paste the link from the Share button. Docs, Slides and Sheets links are exported as PDF. Folders are not supported on Drive, and links that need a login give a free error row.

**Can I give it a ZIP?**
Yes, from any source. The readable files inside are processed one by one and each is charged like a direct file. The unpacking is limited (file count, total size, compression ratio) so a hostile archive cannot exhaust memory, and nothing is written to disk.

**Can it find the PDFs on a web page?**
Turn on followPdfLinks and give the page's link. The actor reads the page for links to PDFs (up to maxLinksPerPage), one level deep, and reads each one. It does not follow links from those files or click through further pages.

**Can I give it a list of links as a spreadsheet?**
Yes. Put the links in a TXT file (one per line) or a CSV file, host it anywhere public (a Google Drive or Dropbox share link works), and pass its link in urlListUrls. Name the CSV column in urlListColumn if it is not called url or link.

### Use from code or an AI agent

The actor runs under limited permissions. Python example:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("cyrus_1/image-ocr-text-extractor").call(
    run_input={"urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"], "pages": "1", "language": "en"}
)
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["status"] == "ok":
        print(row["pageNumber"], row["averageConfidence"], (row["text"] or "")[:80])
```

The same input works with the JavaScript client, the REST API, n8n, Make and Zapier. AI agents can find and run the actor through Apify's MCP server (the `search-actors`, `fetch-actor-details` and `call-actor` tools).

### Licences

- **RapidOCR** (the engine): Apache 2.0.
- **OCR models:** PaddleOCR models converted to ONNX by RapidOCR. The English, Latin, Chinese and Japanese models ship inside the RapidOCR package, and its `MODEL_LICENSES.md` lists them as Apache 2.0. The models for the other scripts (Korean, Arabic script, Cyrillic, Devanagari, Thai, Greek, Tamil and Telugu) are not part of the package: they are downloaded when the actor is built, or on first use if that download failed. The RapidOCR package does not state a licence for those downloaded files, so we do not claim one for them. Check the model terms yourself if your use needs it.
- **python-bidi:** LGPL-3. It is used for Arabic text, installed as an ordinary, unmodified Python dependency and not copied into the actor's own code.
- **pypdfium2 and PDFium:** Apache 2.0 and BSD-3. **Pillow:** HPND. **onnxruntime:** MIT. **OpenCV (headless):** Apache 2.0; it bundles FFmpeg as a shared library under LGPL.
- No Tesseract and no PyMuPDF.

### More from this publisher

- [PDF to Text and Markdown](https://apify.com/cyrus_1/pdf-to-text-markdown) is the choice for PDFs that already have a text layer: Markdown, metadata and tables of text, one row per PDF. It can also read its scanned pages with the same OCR engine when you turn on `ocrScannedPages`.

# Actor input Schema

## `urls` (type: `array`):

Public http or https links to PNG, JPEG, WebP or TIFF images, to PDFs (each page is read), or to ZIP archives of them. Google Drive and Dropbox share links work. Links are one way to give files; the other ways are below. If you give no file at all, a public IRS form is read as an example.

## `base64Files` (type: `array`):

Files sent as base64 text, for callers that have the bytes but no link (n8n, Make, your own code). Each entry is the base64 string or a data: URI, or an object like {"name": "invoice.pdf", "data": "<base64>"}. The data is never copied into the output. A ZIP sent this way is expanded.

## `keyValueStoreId` (type: `string`):

The key-value store that holds your files (pick one of yours). Leave empty to read from this run's own default store. Used with Record keys below.

## `keyValueStoreKeys` (type: `array`):

Keys of the records to read from the key-value store. Each record must be a file stored with its own content type, for example application/pdf, not JSON or text. A ZIP record is expanded. Keys may contain letters, digits and !-\_.'() only.

## `datasetId` (type: `string`):

A dataset of yours whose items hold a link to a file, for example the output of another actor. Pick it here, then name the field below.

## `datasetField` (type: `string`):

The field of each dataset item that holds the link, for example pdfUrl or media.url (a dot goes one level deeper). The value can be one link, a list of links, or an object with a url. Required with Dataset with links.

## `datasetLimit` (type: `integer`):

Read at most this many items from the dataset.

## `urlListUrls` (type: `array`):

Links to text files that list links to read: a TXT file with one link per line, or a CSV file. For a CSV the column is found by its header (url, link, pdf, file, ...) or by the first column that holds links, or you name it below. Up to 5,000 links per list.

## `urlListColumn` (type: `string`):

The header of the CSV column that holds the links, when it is not named url, link or similar. Leave empty to find it automatically.

## `followPdfLinks` (type: `boolean`):

When a link returns a web page, read the page for links to PDF files (links ending in .pdf, citation_pdf_url and alternate PDF links) and read those PDFs, one level deep. Without this a web page gives a free error row.

## `maxLinksPerPage` (type: `integer`):

No more than this many PDF links are followed from one web page.

## `maxFilesPerZip` (type: `integer`):

No more than this many readable files are taken from one ZIP archive. Other entries are left out.

## `maxZipUncompressedMb` (type: `integer`):

A ZIP whose files add up to more than this when unpacked is stopped (protection against zip bombs). Files are unpacked in memory, one at a time, never written to disk.

## `language` (type: `string`):

Which recogniser to use. English also reads French, German, Spanish and other Latin-script languages. The others read their own script and usually English words too.

## `quality` (type: `string`):

fast uses a smaller model (cheapest to run, good on clean text). accurate uses the larger model, about 4 times slower, and is charged extra (accurate-page events). Only changes English, Chinese and Japanese.

## `usePdfTextLayer` (type: `boolean`):

For PDFs, a page that already contains its own text (at least 40 letters or digits) is read from that text and not OCRed. It costs $0.001 (text-layer-page) instead of $0.004 and has no boxes or confidence. Turn off to OCR every page, for example when a scan carries a poor hidden text layer. Pages with no text layer are always OCRed.

## `pages` (type: `string`):

Which PDF pages to read, for example 1-3,5 or 4-. Empty means all pages (up to the max below). Applies to PDFs only.

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

Lines the engine is less sure of than this (0 to 1) are dropped.

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

Add the position and confidence of each word inside every line. Slower and larger rows.

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

Add every line with its text, confidence and position. Turn off to get only the joined text.

## `maxPagesPerPdf` (type: `integer`):

No more than this many pages are read from one file.

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

Larger files are skipped with an error row and are not charged.

## Actor input object example

```json
{
  "urls": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "datasetLimit": 1000,
  "followPdfLinks": false,
  "maxLinksPerPage": 20,
  "maxFilesPerZip": 200,
  "maxZipUncompressedMb": 500,
  "language": "en",
  "quality": "fast",
  "usePdfTextLayer": true,
  "pages": "1",
  "minConfidence": 0.5,
  "includeWordBoxes": false,
  "includeLines": true,
  "maxPagesPerPdf": 500,
  "maxFileSizeMb": 50
}
```

# Actor output Schema

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

One row per image, TIFF frame or PDF page with the joined text, every line with its confidence and position (for pages read by OCR), where the text came from, and the charges for the row.

# 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 = {
    "urls": [
        "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    ],
    "pages": "1"
};

// Run the Actor and wait for it to finish
const run = await client.actor("cyrus_1/image-ocr-text-extractor").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 = {
    "urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"],
    "pages": "1",
}

# Run the Actor and wait for it to finish
run = client.actor("cyrus_1/image-ocr-text-extractor").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 '{
  "urls": [
    "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
  ],
  "pages": "1"
}' |
apify call cyrus_1/image-ocr-text-extractor --silent --output-dataset

```

## MCP server setup

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

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/qMimvCHs7aWDbkyx2/builds/CZHzVGdmTt7NeZK8u/openapi.json
