# OCR

Optical Character Recognition (OCR) is the process of text recognition, used to extract text from images, serving as an easier alternative to manual data entry.

## Perform OCR

<mark style="color:blue;">`GET`</mark> `https://infer.roboflow.com/doctr/ocr`

#### Query Parameters

| Name                                       | Type   | Description                                                                   |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------- |
| api\_key<mark style="color:red;">\*</mark> | String | [A Roboflow API Key](/developer/authentication/find-your-roboflow-api-key.md) |

#### Request Body

| Name                                          | Type   | Description                                         |
| --------------------------------------------- | ------ | --------------------------------------------------- |
| image<mark style="color:red;">\*</mark>       | Object | A JSON object containing image information and data |
| image.type<mark style="color:red;">\*</mark>  | String | One of the following: "url" or "base64"             |
| image.value<mark style="color:red;">\*</mark> | String | Either a URL or a base64 encoded image              |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

To learn about how to deploy an OCR solution locally on your device using Python, [check out this blog post](https://blog.roboflow.com/ocr-api/).

{% hint style="success" %}
You can also deploy an OCR solution on your device using our open-source inference server. [Learn more about deploying DocTR (OCR) locally here.](https://inference.roboflow.com/foundation/doctr/)
{% 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/serverless/foundation-models/ocr.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.
