Image to Text API
The Image to Text API detects and extracts text from images using state-of-the-art optical character recognition (OCR) algorithms. It can detect texts of different sizes, fonts, and even handwriting.
From 7,083 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 301ms | 338ms | 373ms | 672ms | 1130ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/imagetotext POST
https://api.api-ninjas.com/v1/imagetotext
Given an input image, return all detected texts and their bounding boxes.
| Plan | Image Size Limit |
|---|---|
| Free | 200KB per image |
| Premium | Up to 5MB per image |
Files
imagerequiredImage file to extract text from. Must be either JPEG or PNG format.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Sample Request Live Demo!

Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/imagetotextHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[
{
"text": "API",
"bounding_box": {
"x1": 60,
"y1": 72,
"x2": 163,
"y2": 118
}
},
{
"text": "Ninjas",
"bounding_box": {
"x1": 189,
"y1": 72,
"x2": 373,
"y2": 132
}
},
{
"text": "Image",
"bounding_box": {
"x1": 64,
"y1": 178,
"x2": 170,
"y2": 215
}
}
]
...Code Examples
1
2
3
curl -X POST "https://api.api-ninjas.com/v1/imagetotext" \
-H "X-Api-Key: YOUR_API_KEY" \
-F "image=@YOUR_IMAGE.jpeg"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Frequently Asked Questions
Can I use the Image to Text API for commercial purposes?
How do I get an API key and start using the Image to Text API?
What happens if I exceed my quota for the month?
What happens if a request to the Image to Text API fails?
What are some use cases for the Image to Text API?
How do I submit an image and what formats are supported?
What does the Image to Text response include?
What is the maximum image size I can upload?