# AI OCR Text Extractor - High Precision Image-to-Text (`mikolabs/ai-ocr-text-extractor-high-precision-image-to-text`) Actor

It's a high-performance solution designed to extract text from images with exceptional accuracy. Powered by industrial-grade deep learning models, it transforms unstructured image data—such as invoices, receipts, screenshots, and handwritten notes—into structured, searchable JSON data in seconds.

- **URL**: https://apify.com/mikolabs/ai-ocr-text-extractor-high-precision-image-to-text.md
- **Developed by:** [mikolabs](https://apify.com/mikolabs) (community)
- **Categories:** AI, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 66.7% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## AI OCR Text Extractor - High Precision Image-to-Text

![AI OCR Text Extractor](./logo.png)

### What does AI OCR Text Extractor do?

AI OCR Text Extractor is a high-performance solution designed to extract text from images with exceptional accuracy. Powered by industrial-grade deep learning models, it transforms unstructured image data into structured, searchable JSON data in seconds.

The actor can process:

- Invoices and financial documents
- Receipts and transaction records
- Screenshots and digital documents
- Handwritten notes and forms
- Scanned documents and image-based records

### Why use AI OCR Text Extractor?

Organizations across industries generate millions of images daily—from scanned paperwork to digital receipts. Manual text extraction is time-consuming and error-prone, while traditional OCR solutions often struggle with complex layouts, varied handwriting, and poor image quality.

AI OCR Text Extractor solves these challenges with deep learning models that understand context and handle real-world complexity. Here are just some of the ways you could benefit from automated text extraction:

- **Automate Workflows**: Reduce manual data entry by pushing extracted text directly to your database.
- **Financial Processing**: Extract structured data from invoices and receipts for accounting systems.
- **Digitization**: Turn handwritten notes and forms into searchable archives.
- **Data Engineering**: Feed clean text data into machine learning pipelines and LLMs.
- **Compliance**: Speed up regulatory documentation and audit processes.

If you would like more inspiration on how automated document processing could help your business or organization, check out our [industry pages](https://apify.com/industries).

### How to use AI OCR Text Extractor

It's easy to extract text from images with AI OCR Text Extractor. Just follow these few steps and you'll get your structured data in seconds.

1. Click on **Try for free**.
2. Upload your images to the Key-Value Store or provide a list of image URLs.
3. Configure optional parameters like **OCR Languages** and **Minimum Confidence**.
4. Click on **Run**.
5. When the extraction is finished, preview or download your data from the **Dataset** tab in JSON, CSV, or Excel formats.

### How much will it cost to use AI OCR Text Extractor?

Apify gives you $5 free usage credits every month on the [Apify Free plan](https://apify.com/pricing). Depending on image resolution and complexity, you can process hundreds of images per month completely free!

If you need to process more images regularly, we recommend our [$49/month Starter plan](https://apify.com/pricing), which provides substantial additional credits for high-volume text extraction tasks.

For enterprise-scale document processing, the [Scale plan](https://apify.com/pricing) at $499/month offers dedicated resources and priority support.

---

### ⚡ Performance & Memory Optimization

OCR is a computationally intensive task. To ensure smooth operation and avoid **Out of Memory (OOM)** errors:

- **Setting Up RAM**: We recommend setting the Actor's memory to **at least 4096MB (4GB)** in the **Settings** tab. High-resolution images or large batches may require 8GB+ to process efficiently.
- **GPU Acceleration**: For heavy workloads, enable the **GPU** setting in the input. Ensure you are using a GPU-enabled Apify plan for this to take effect.

---

### Results

The actor returns a structured JSON dataset. Each record includes the full combined text and detailed information for every detected text block (including bounding boxes).

```json
{
  "source_file": "invoice.png",
  "file_type": "image",
  "total_pages": 1,
  "languages_used": ["en"],
  "combined_text": "Invoice #12345\nDate: 2024-05-12\nTotal: $599.99",
  "total_word_count": 8,
  "pages": [
    {
      "page_number": 1,
      "full_text": "...",
      "blocks": [
        {
          "text": "Invoice #12345",
          "confidence": 0.9982,
          "bounding_box": {
            "top_left": [10, 20],
            "top_right": [200, 20],
            "bottom_right": [200, 50],
            "bottom_left": [10, 50]
          }
        }
      ]
    }
  ]
}
````

### Tips for using AI OCR Text Extractor

- **Image Quality**: Upload clear, high-contrast images for best results. Blurry or extremely low-resolution images may reduce accuracy.
- **Specify Languages**: For non-English text, always select the appropriate language in the dropdown to significantly improve character recognition.
- **Confidence Threshold**: Use the `minConfidence` setting to filter out noisy artifacts or half-cut characters in messy documents.
- **OOM Errors**: If the run fails with an "OOM" (Out of Memory) error, simply increase the memory in the Actor's **Settings** to 4GB or 8GB.

### Legal considerations

This actor extracts text from images you provide. You are responsible for ensuring you have the legal right to process and store the data contained within those images.

Note that personal data is protected by GDPR in the European Union and by other regulations around the world. You should not process images containing personal data unless you have a legitimate reason to do so. If you're unsure, consult your legal team.

We also recommend that you read our blog post: [is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

***

For more information, visit the [AI OCR Text Extractor actor page](https://apify.com/mikolabs/ai-ocr-text-extractor---high-precision-image-to-text).

# Actor input Schema

## `fileUrls` (type: `array`):

Public URLs of image files to process. Supported: .jpg, .jpeg, .png, .bmp, .tiff, .tif, .webp, .gif, .ico, .svg, .heic, .heif

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

Images encoded as base64 strings. Each item must have 'filename' (e.g. 'invoice.png') and 'data' (base64 string or data URI).

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

Select one or more languages for OCR. English is recommended for most latin-based texts.

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

The minimum confidence score (0.0 to 1.0) for text blocks. NOTE: If you encounter OOM (Out of Memory) errors, increase the Actor's memory to at least 4GB in the Apify Console.

## Actor input object example

```json
{
  "fileUrls": [
    "https://pbs.twimg.com/media/HAaO7DFWwAEfl3Q?format=jpg&name=medium"
  ],
  "base64Files": [],
  "languages": [
    "en"
  ],
  "minConfidence": 0.3
}
```

# 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 = {
    "fileUrls": [
        "https://pbs.twimg.com/media/HAaO7DFWwAEfl3Q?format=jpg&name=medium"
    ],
    "base64Files": [],
    "languages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikolabs/ai-ocr-text-extractor-high-precision-image-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 = {
    "fileUrls": ["https://pbs.twimg.com/media/HAaO7DFWwAEfl3Q?format=jpg&name=medium"],
    "base64Files": [],
    "languages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("mikolabs/ai-ocr-text-extractor-high-precision-image-to-text").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "fileUrls": [
    "https://pbs.twimg.com/media/HAaO7DFWwAEfl3Q?format=jpg&name=medium"
  ],
  "base64Files": [],
  "languages": [
    "en"
  ]
}' |
apify call mikolabs/ai-ocr-text-extractor-high-precision-image-to-text --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mikolabs/ai-ocr-text-extractor-high-precision-image-to-text",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AI OCR Text Extractor - High Precision Image-to-Text",
        "description": "It's a high-performance solution designed to extract text from images with exceptional accuracy. Powered by industrial-grade deep learning models, it transforms unstructured image data—such as invoices, receipts, screenshots, and handwritten notes—into structured, searchable JSON data in seconds.",
        "version": "0.0",
        "x-build-id": "StVTp99hehsgABg2y"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/mikolabs~ai-ocr-text-extractor-high-precision-image-to-text/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-mikolabs-ai-ocr-text-extractor-high-precision-image-to-text",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/mikolabs~ai-ocr-text-extractor-high-precision-image-to-text/runs": {
            "post": {
                "operationId": "runs-sync-mikolabs-ai-ocr-text-extractor-high-precision-image-to-text",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/mikolabs~ai-ocr-text-extractor-high-precision-image-to-text/run-sync": {
            "post": {
                "operationId": "run-sync-mikolabs-ai-ocr-text-extractor-high-precision-image-to-text",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "fileUrls": {
                        "title": "File URLs",
                        "type": "array",
                        "description": "Public URLs of image files to process. Supported: .jpg, .jpeg, .png, .bmp, .tiff, .tif, .webp, .gif, .ico, .svg, .heic, .heif"
                    },
                    "base64Files": {
                        "title": "Base64 Files",
                        "type": "array",
                        "description": "Images encoded as base64 strings. Each item must have 'filename' (e.g. 'invoice.png') and 'data' (base64 string or data URI)."
                    },
                    "languages": {
                        "title": "OCR Languages",
                        "type": "array",
                        "description": "Select one or more languages for OCR. English is recommended for most latin-based texts.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "en",
                                "hi",
                                "te",
                                "es",
                                "fr",
                                "de",
                                "zh",
                                "ja",
                                "ko",
                                "ar",
                                "ru",
                                "pt",
                                "tr",
                                "it",
                                "bn"
                            ],
                            "enumTitles": [
                                "English",
                                "Hindi",
                                "Telugu",
                                "Spanish",
                                "French",
                                "German",
                                "Chinese",
                                "Japanese",
                                "Korean",
                                "Arabic",
                                "Russian",
                                "Portuguese",
                                "Turkish",
                                "Italian",
                                "Bengali"
                            ]
                        },
                        "default": [
                            "en"
                        ]
                    },
                    "minConfidence": {
                        "title": "Minimum Confidence",
                        "minimum": 0,
                        "maximum": 1,
                        "type": "number",
                        "description": "The minimum confidence score (0.0 to 1.0) for text blocks. NOTE: If you encounter OOM (Out of Memory) errors, increase the Actor's memory to at least 4GB in the Apify Console.",
                        "default": 0.3
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
