# EasyOCR

[EasyOCR](https://github.com/JaidedAI/EasyOCR) is a multilingual optical character recognition model deployable via our [Serverless Hosted API](/deploy/serverless-hosted-api-v2.md). Supported languages include English, Japanese, Kannada, Korean, Latin (covering Spanish, French, Italian, Portuguese, German, Polish, and Dutch), Telugu, and Simplified Chinese.

## Code sample

Call the `/easy_ocr/ocr` endpoint directly with `curl`:

```bash
curl --location 'https://serverless.roboflow.com/easy_ocr/ocr' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "YOUR_API_KEY",
    "image": {"type": "url", "value": "https://media.roboflow.com/swift.png"},
    "language_codes": ["en"]
  }'
```

The same call through the SDK. Install it:

```bash
pip install inference-sdk
```

Run EasyOCR on an image. Pass your [Roboflow API Key](https://app.roboflow.com/settings/api) via the `API_KEY` env variable.

```python
import os
import urllib.request
from inference_sdk import InferenceHTTPClient

image_url = "https://media.roboflow.com/swift.png"
image_path = "swift.png"
urllib.request.urlretrieve(image_url, image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
)

result = client.ocr_image(
    inference_input=image_path,
    model="easy_ocr",
    language_codes=["en"],
)

print(result["result"]) # Extracted text
```

The code above prints inference results to the terminal:

```
was thinking earlier today that have gone through, to use the lingo, eras Of listening to each of Swift's Eras. Meta indeed: started listening to Ms. Swift's music after hearing the Midnights album: few weeks after hearing the album for the first time, found myself playing various songs on repeat. listened to the album in order multiple times:
```

{% hint style="info" %}
Set `api_url` to match your deployment target:

* `https://serverless.roboflow.com` for the Serverless Hosted API.
* `http://localhost:9001` for a local [Inference](https://inference.roboflow.com/) server.
* Your [Dedicated Deployment](/deploy/dedicated-deployments.md) URL for a private endpoint.
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/deploy/supported-models/easyocr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
