# Image to Text API

> Image to Text is an OCR and image to text API that extracts text from image files or remote image URLs using optical character recognition. Upload a JPG, PNG, or GIF up to 5 MB to receive the raw extracted text.

**Endpoint:** `POST https://api.apiverve.com/v1/imagetotext`  
**Category:** AI/Computer Vision  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/imagetotext

## Overview

An image to text API and image text recognition API: extract text from an image upload or an image URL, from photos and screenshots to scanned pages. The API reads text from the image with optical character recognition (OCR) and returns it as plain text in JSON. Pass language to read Spanish, French, German, Portuguese, Italian, Dutch, Russian, Japanese, Chinese, Korean, Arabic or Hindi as well as English, or several codes for mixed text. Paid plans add word, character and line counts, a confidence score and the position of every word.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/imagetotext" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "image=@photo.jpg"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `image` | string | Yes | Upload an image file to extract text from (supported formats: JPG, PNG, GIF, WebP, BMP, TIFF, HEIC, max 5MB) |
| `language` | string | No | Language of the text, as ISO 639-1 codes; comma-separate several for mixed text (e.g. en,ja). Defaults to en. One of: en, es, fr, de, pt, it, nl, ru, ja, zh, ko, ar, hi |

## Response fields

- `text` — string · Extracted text content from the image using OCR
- `words` — number · Total number of words extracted from image · (premium)
- `characters` — number · Total character count in extracted text · (premium)
- `lines` — number · Number of lines detected in extracted text · (premium)
- `language` — array · The languages the image was read as
- `confidence` — number · Mean recognition confidence across the words, 0-100 · (premium)
  - `wordBoxes.0.text` — string · The word · (premium)
  - `wordBoxes.0.confidence` — number · Recognition confidence for the word, 0-100 · (premium)
  - `wordBoxes.0.left` — number · Left edge in pixels · (premium)
  - `wordBoxes.0.top` — number · Top edge in pixels · (premium)
  - `wordBoxes.0.width` — number · Width in pixels · (premium)
  - `wordBoxes.0.height` — number · Height in pixels · (premium)
  - `wordBoxes.0.block` — number · Text block the word belongs to · (premium)
  - `wordBoxes.0.line` — number · Line number within its paragraph · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "text": "A year after that (in 2021) I hired somebody tp#lp me write blog posts for\nmy personal website.\n\nThe point is, | like reinvesting the money | make\nback into my business.",
    "words": 32,
    "characters": 169,
    "lines": 5,
    "language": [
      "en"
    ],
    "confidence": 87.7,
    "wordBoxes": [
      {
        "text": "after",
        "confidence": 96.7,
        "left": 76,
        "top": 19,
        "width": 35,
        "height": 13,
        "block": 1,
        "line": 1
      },
      {
        "text": "that",
        "confidence": 96.9,
        "left": 115,
        "top": 19,
        "width": 30,
        "height": 12,
        "block": 1,
        "line": 1
      },
      {
        "text": "tp#lp",
        "confidence": 62.6,
        "left": 357,
        "top": 19,
        "width": 49,
        "height": 16,
        "block": 1,
        "line": 1
      },
      {
        "text": "business.",
        "confidence": 96.9,
        "left": 174,
        "top": 150,
        "width": 99,
        "height": 20,
        "block": 3,
        "line": 2
      }
    ]
  }
}
```

## Use cases

- **Expense Receipt Scanning** — Accounting software converts uploaded photos of paper receipts into plain text to identify merchant names and purchase totals.
- **ID Card Digitization** — When onboarding new bank customers, verify identity documents by pulling printed names and identification numbers straight from submitted photo files.
- **Searchable Media Archives** — To index visual media, digital asset libraries scan promotional graphics by image URL to make embedded headlines and labels searchable.
- **Assistive Screen Reading** — Transcribe text trapped inside web graphics and infographics before generating spoken audio descriptions for visually impaired readers.

## SDKs

- **npm** — `npm install @apiverve/imagetotext` (https://www.npmjs.com/package/@apiverve/imagetotext)
- **PyPI** — `pip install apiverve-imagetotext` (https://pypi.org/project/apiverve-imagetotext/)
- **NuGet** — `dotnet add package APIVerve.API.ImagetoText` (https://www.nuget.org/packages/APIVerve.API.ImagetoText)
- **Source** — https://github.com/apiverve/imagetotext-api

## More

- Full reference: https://docs.apiverve.com/ref/imagetotext
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
