# Image to Text OCR API

> AI OCR for images: handwriting, receipts, documents to text and Markdown tables. Multilingual.

Photos, scans, screenshots, receipts, menus, handwritten notes, signs: send an **image link** or **upload the image**, get back **all its text in reading order** and the same text as **Markdown** that keeps headings, lists and **real tables**. Ask for a **translation** in the same call.

- Host: `image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com`
- Base URL: `https://image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com/v1/ocr`
- Auth: headers `X-RapidAPI-Key` and `X-RapidAPI-Host`
- OpenAPI: https://helenis-api.com/docs/ocr/openapi.json

## Endpoints

### OCR

Image to text, with its layout kept as Markdown.

#### Extract Text from Image URL

`POST /v1/ocr/image`

Extract the text of an image from its URL. All the text of a photo, scan or screenshot, in reading order: plain text, plus Markdown keeping headings, lists and tables. Handwriting and any language. Optional translation. 1 credit (2 with translation).

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `url` | body | `string` | yes | Direct link to an image: PNG, JPEG, WEBP, HEIC, GIF, BMP or TIFF, up to 20 MB. | `https://upload.wikimedia.org/wikipedia/commons/6/69/Sahan_Supermarket_receipt...` |
| `translate_to` | body | `string` | no | Also translate the text into this language (e.g. 'English', 'fr'). +1 credit. |  |

```bash
curl -X POST "https://image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com/v1/ocr/image" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://upload.wikimedia.org/wikipedia/commons/6/69/Sahan_Supermarket_receipt%2C_Hillegersberg%2C_Rotterdam_%282021%29_01.jpg",
    "translate_to": "English"
  }'
```

#### Extract Text from Uploaded Image

`POST /v1/ocr/image/upload`

Extract the text of an uploaded image. Same as /image, for a file sent as multipart/form-data (field `file`).

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `file` | form | `file` | yes | Image, up to 20 MB. |  |
| `translate_to` | form | `string` | no | Also translate the text into this language (e.g. 'English', 'fr'). +1 credit. |  |

```bash
curl -X POST "https://image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com/v1/ocr/image/upload" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com" \
  -F "file=@./my-file"
```

## Sample call

Extract Text from Image URL: `POST /v1/ocr/image`.

```bash
curl -X POST "https://image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com/v1/ocr/image" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: image-to-text-ocr-handwriting-tables-ai.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://upload.wikimedia.org/wikipedia/commons/6/69/Sahan_Supermarket_receipt%2C_Hillegersberg%2C_Rotterdam_%282021%29_01.jpg",
    "translate_to": "English"
  }'
```

## Response

```json
{
  "source": "https://upload.wikimedia.org/.../Sahan_Supermarket_receipt...jpg",
  "mime_type": "image/jpeg",
  "languages": ["nl"],
  "handwriting": false,
  "has_text": true,
  "text": "SAHAN Supermarkt\nBergweg 170\n3036 BL Rotterdam\n...\nOmschrijving\tBedrag\nMIRAS OLIJFOLIE (GLAS) 1L\t3,99\n...",
  "markdown": "SAHAN Supermarkt\nBergweg 170\n...\n| Omschrijving | Bedrag |\n| :--- | ---: |\n| MIRAS OLIJFOLIE (GLAS) 1L | 3,99 |\n| MERAY TRAKYA POMPOENPIT 200 | 1,99 |\n...",
  "translation": {
    "language": "English",
    "markdown": "SAHAN Supermarket\n...\n| Description | Amount |\n| :--- | :--- |\n| MIRAS OLIVE OIL (GLASS) 1L | 3.99 |\n...",
    "text": "SAHAN Supermarket\n...\nDescription\tAmount\nMIRAS OLIVE OIL (GLASS) 1L\t3.99\n..."
  }
}
```

*A real response on a public-domain receipt photo, shortened.* In `text`, table cells are separated by tabs.

## How it works

1. **Download** (or upload) of the image; GIF, BMP, TIFF and very large images are converted to JPEG (3,072 px on the long side at most, enough for small print).
2. **Read** by a vision AI model at high resolution, told to transcribe exactly, keep the layout and never add or describe anything.
3. **Return** Markdown and the plain text derived from it, plus the translation when asked.

## Privacy

Images are downloaded, read and discarded: neither the image nor the text is stored by the API. The AI sub-processor may keep requests temporarily for abuse monitoring.

## Errors

```json
{ "error": { "status": 400, "code": "unsupported_file", "message": "The file is not an image (PNG, JPEG, WEBP, HEIC, GIF, BMP or TIFF)." } }
```

| Status | `code` | Meaning |
|---|---|---|
| 400 | `invalid_url`, `invalid_request` | Fix the input. |
| 400 | `site_unreachable`, `site_blocked`, `file_too_large` | The image could not be downloaded (down, protected, over 20 MB). |
| 400 | `unsupported_file` | Not an image. |
| 429 | `daily_limit_reached` | Daily safety limit of your plan; resets at 00:00 UTC. |
| 503 | `ai_error`, `capacity_exhausted` | Temporary failure. Retry. Not billed. |

## Pricing

1 credit per image, +1 with translation. Failed calls are never billed.

| Plan | Price | Credits included | Above the quota |
|---|---|---|---|
| BASIC | Free | 3 / day | resets every day |
| PRO | $4.99/month | 1,100 / month | $0.05 per credit |
| ULTRA | $14.99/month | 3,500 / month | $0.05 per credit |
| MEGA | $49.99/month | 11,000 / month | $0.05 per credit |

Apify actor **Image to Text OCR - Handwriting & Tables**: billed per event; free-plan users get 10 images per run.

| Event | Charged for | Price |
|---|---|---|
| `image-ocr` | each image read | $0.004 |
| `translation` | each image translated | $0.004 |

## Links

- API reference (HTML): https://helenis-api.com/docs/ocr
- OpenAPI: https://helenis-api.com/docs/ocr/openapi.json
- Overview and pricing: https://helenis-api.com/apis/ocr/
- RapidAPI listing: https://rapidapi.com/helenis-api-helenis-api-docs/api/image-to-text-ocr-handwriting-tables-ai?utm_source=helenis&utm_medium=site&utm_campaign=ocr&utm_content=markdown
- Apify actor: https://apify.com/helenisapi/image-to-text-ocr-handwriting-tables?utm_source=helenis&utm_medium=site&utm_campaign=ocr&utm_content=markdown
- MCP server (Apify): https://mcp.apify.com?tools=helenisapi/image-to-text-ocr-handwriting-tables

MCP: Works in Claude, Cursor, VS Code and any MCP client; billed per event through Apify (your Apify token).

## Conventions (every Helenis API)

- Auth: two headers on every call, `X-RapidAPI-Key` (your key) and `X-RapidAPI-Host` (the API's host). One RapidAPI key works for every API you subscribe to.
- Billing in credits: one for a simple call, more for heavier work (a minute of audio, a page read by AI). Each API states its rule.
- Failed calls are never billed: a `4xx` bills zero credits and a `5xx` is never counted.
- Errors share one envelope: `{"error": {"status", "code", "message"}}` with a stable machine-readable `code`.
- `400`: fix the input (validation errors are always 400, never 422); not billed.
- `429`: rate limit; wait for `Retry-After`. `503`: temporary upstream or AI failure (`ai_error`, `upstream_timeout`); retry later, not billed.
- Values the source does not give come back as `null`, never invented.
