# OCR API - Image & PDF to Text Extractor, 100+ Languages (`sndzcc/image-pdf-to-text`) Actor

OCR tool to extract text from images, screenshots, photos and scanned or digital PDFs in 100+ languages, in bulk. Image to text and PDF to text with clean output per page. No API key.

- **URL**: https://apify.com/sndzcc/image-pdf-to-text.md
- **Developed by:** [Sndz Data](https://apify.com/sndzcc) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 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

## OCR API: Image & PDF to Text Extractor, 100+ Languages

Extract the text from **images, screenshots, photos and PDFs**, digital or **scanned**, in **100+ languages**, in bulk. Get clean text **per page**, with the OCR confidence and word count.

- **Digital PDFs** are read directly from their text layer: instant and exact.
- **Scanned PDFs and images** go through OCR (Tesseract), with automatic straightening of sideways or upside-down pages.

No API key, no Google account, no subscription: **pay per page**.

### Why this one?

- **Smart PDF handling.** Text pages are read directly; only scanned pages use OCR. Faster and more accurate than OCR-ing everything.
- **Mixed languages.** Read documents that mix English, Spanish, German, French... in one pass. 100+ languages, including Chinese, Japanese, Arabic, Hindi and Russian.
- **Upside-down and rotated pages** are detected and fixed.
- **Bulk.** Hundreds of files per run, straight from their URLs.
- **Cheap.** A fraction of what OCR APIs charge per page.

### Use cases

- **Invoices, receipts and forms:** get the text out for bookkeeping, search or AI extraction.
- **Scanned contracts and archives:** make old documents searchable.
- **Screenshots and social images:** pull quotes, prices and posts out of images.
- **AI pipelines:** feed clean text into ChatGPT, Claude or your RAG system.
- **Translation:** extract the text first, then translate it.

### Input

| Field | What it does |
|---|---|
| **Image or PDF URLs** | JPG, PNG, WebP, TIFF, BMP, GIF or PDF links, one per line. |
| **Languages** | Every language the text may contain: `en`, `es`, `de`, `fr`, `zh`, `ja`, `ar`... or Tesseract codes (`chi_sim`). |
| **Max pages per PDF** | Stop after N pages of each PDF. |
| **Always use OCR on PDFs** | OCR every page, even those that already have text. |

```json
{
  "files": ["https://example.com/invoice.pdf", "https://example.com/screenshot.png"],
  "languages": ["en", "es"],
  "maxPagesPerPdf": 50
}
```

### Output

One row per image or PDF page:

```json
{
  "fileUrl": "https://example.com/scan.pdf",
  "fileType": "pdf",
  "page": 1,
  "pages": 4,
  "method": "ocr",
  "text": "The LinnSequencer\n32 Track MIDI Sequence Recorder\n\nThe LinnSequencer is a state-of-the-art composition...",
  "confidence": 94.6,
  "words": 729,
  "chars": 4310,
  "languages": ["eng", "deu", "spa"]
}
```

`method` is `text-layer` for digital PDF pages and `ocr` for images and scanned pages. `confidence` (0–100) is the average OCR confidence: above 85 is usually very clean.

### Good to know

- Works best on clear, straight text (scans, screenshots, documents). Handwriting and very stylized fonts are harder.
- Files that can't be downloaded or opened are skipped (not charged) and listed in the `FAILED_FILES` record.
- OCR engine: Tesseract (Apache-2.0) with the tessdata_fast language models.

### Integrations

Connect it to Google Drive, Dropbox, Make, Zapier or n8n to extract text from every new document automatically.

### How to use it

1. Click **Try for free** (or **Start**) at the top of this page.
2. Fill in the input, or keep the example to see it working in seconds.
3. Click **Start** and wait for the run to finish.
4. Download the results as **Excel, CSV, JSON or HTML**, or get them through the Apify API.

### How much does it cost?

**$0.004 per page** ($4.00 per 1,000). No start fee, no monthly fee, and you only pay for the results saved to your dataset.

| Example | Cost |
|---|---|
| A 20-page scanned contract | about $0.08 |
| 1,000 invoices or receipts | about $4.00 |

Apify's free plan includes monthly credit, so you can try it for free.

### FAQ

**Which files can it read?**

JPG, PNG, WebP, TIFF, BMP and GIF images, and PDFs, both digital and scanned.

**Which languages are supported?**

More than 100, including English, Spanish, German, French, Chinese, Japanese, Arabic, Hindi and Russian. Several at once are fine.

**Does it read scanned PDFs?**

Yes. Pages with text are read directly; scanned pages go through OCR, and upside-down pages are turned automatically.

**Can it read handwriting?**

Clear print works best. Handwriting and very stylized fonts give lower accuracy.

### More tools from Sndz Data

- [BORME Scraper API - Spain New Company Leads Daily](https://apify.com/sndzcc/borme-spain-companies): every new company registered in Spain, daily
- [App Store & Google Play Reviews Scraper API](https://apify.com/sndzcc/app-reviews-scraper): App Store and Google Play reviews in one run
- [Job Scraper API - Greenhouse, Lever, Ashby & Workable](https://apify.com/sndzcc/ats-jobs-scraper): all open jobs from Greenhouse, Lever, Ashby and more
- [Google News Scraper API - Articles with Real URLs](https://apify.com/sndzcc/google-news-scraper): news by keyword or topic, with real article URLs
- [Email & Contact Scraper API - Emails, Phones & Socials](https://apify.com/sndzcc/contact-details-scraper): emails, phones and social profiles from any website
- [Telegram Scraper API - Channel Posts, Views & Media](https://apify.com/sndzcc/telegram-channel-scraper): posts, views and media from public Telegram channels
- [Brand Monitoring API - Mentions Radar for News & Reddit](https://apify.com/sndzcc/brand-mentions-radar): brand mentions across 9 sources, with sentiment
- [AI Image Upscaler API - Upscale & Enhance Photos 4x](https://apify.com/sndzcc/ai-image-upscaler): upscale and enhance photos 4x with AI
- [Keyword Research API - Google, YouTube & Amazon Ideas](https://apify.com/sndzcc/keyword-ideas-machine): hundreds of keyword ideas from 5 search engines
- [Tech Stack Detector API - Wappalyzer & BuiltWith Alternative](https://apify.com/sndzcc/tech-stack-detector): the technologies behind any website, in bulk
- [Polymarket & Kalshi API - Prediction Market Odds](https://apify.com/sndzcc/prediction-markets-scraper): live odds from Polymarket and Kalshi in one dataset
- [WHOIS & Domain Lookup API - DNS, SSL & Availability](https://apify.com/sndzcc/domain-intel): WHOIS, availability, DNS and SSL for any list of domains
- [Bluesky Scraper API - Posts, Profiles & Followers](https://apify.com/sndzcc/bluesky-scraper): posts, profiles and followers from Bluesky, no login
- [SEO Audit API - Broken Links, Meta Tags & Site Crawler](https://apify.com/sndzcc/seo-audit): SEO audit and broken link checker for any website

### Support

Need tables, layout, or a specific language? Open an issue on the **Issues** tab.

If this Actor saves you time, a quick ⭐ review helps a lot and keeps it maintained. Thank you!

# Actor input Schema

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

Links to images (JPG, PNG, WebP, TIFF, BMP, GIF) or PDFs, digital or scanned, one per line.

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

Two-letter codes (en, es, fr, de, pt, it, zh, ja, ar...) or Tesseract codes (eng, spa, chi_sim...). Add every language the text may contain; 100+ are supported.

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

Stop after this many pages of each PDF.

## `forceOcr` (type: `boolean`):

By default, PDF pages that already contain text are read directly (faster, exact) and only scanned pages go through OCR. Turn on to OCR every page.

## Actor input object example

```json
{
  "files": [
    "https://raw.githubusercontent.com/tesseract-ocr/tessdoc/main/images/eurotext.png",
    "https://raw.githubusercontent.com/ocrmypdf/OCRmyPDF/main/tests/resources/skew.pdf"
  ],
  "languages": [
    "en"
  ],
  "maxPagesPerPdf": 50,
  "forceOcr": false
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per image or PDF page: text, method (OCR or text layer), confidence and word count.

## `allData` (type: `string`):

Every field, including languages and image size.

# 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/ocrmypdf/OCRmyPDF/main/tests/resources/skew.pdf"
    ],
    "languages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sndzcc/image-pdf-to-text").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/ocrmypdf/OCRmyPDF/main/tests/resources/skew.pdf",
    ],
    "languages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("sndzcc/image-pdf-to-text").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/ocrmypdf/OCRmyPDF/main/tests/resources/skew.pdf"
  ],
  "languages": [
    "en"
  ]
}' |
apify call sndzcc/image-pdf-to-text --silent --output-dataset

```

## MCP server setup

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

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/Id212lVVa37nc9Umh/builds/QRPgkbeRtphrCM4Yh/openapi.json
