OCRAny API Documentation
Integrate our OCR API into your applications, implement text recognition functionality with just a few lines of code
Get API Key
Quick Start
OCRAny API uses RESTful design and supports text recognition from images via HTTP requests.
Authentication
All API requests require authentication using an API key. You can obtain your API key in the console.
Authorization: Bearer YOUR_API_KEY
Base Endpoint
The base URL for the API is:
https://api.ocrany.com
Recognize Text from Images
Send a POST request to the /ocr endpoint, upload an image file or provide an image URL.
curl -X POST https://api.ocrany.com/ocr \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@/path/to/image.jpg"
Response Example
{
"code": 0,
"text": "This is the text content recognized from the image..."
}
Using Image URL
You can also recognize text by providing an image URL.
curl -X POST https://api.ocrany.com/v1/ocr \
- H "Authorization: Bearer YOUR_API_KEY" \
- H "Content-Type: application/json" \
- d '{"url": "https://example.com/image.jpg"}'
Parameter Options
You can customize OCR recognition behavior with the following parameters:
Parameter | Type | Description |
---|---|---|
image | string | Base64 encoded string of the image |
format | string | Output format, options include "text", "json", "xml" |
Error Handling
The API uses standard HTTP status codes to indicate request status. Error responses include error codes and description information.
{
code: -1,
msg: "error"
}
Usage Limits
API requests have different limits based on your subscription plan:
Plan | Request Limit | File Size Limit |
---|---|---|
Free | - | 10MB |
Basic | 1,000 requests/day | 10MB |
Professional | 10,000 requests/day | 20MB |