NewConnect Claude, Cursor, ChatGPT, and other AI agents to API Ninjas via our MCP server

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.

(4.5)

From 7,083 users

3,400+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
251ms293ms320ms491ms976ms

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.

PlanImage Size Limit
Free200KB per image
PremiumUp to 5MB per image

Files

  • image  required

    Image file to extract text from. Must be either JPEG or PNG format.

Headers

  • X-Api-Key  required

    API 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/imagetotext

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1

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.