Quick Start
EasyOCR provides a simple RESTful API for quick OCR integration
API Endpoint
Unified endpoint
POST https://console.easyocr.org/api/ocrRequest Parameters
Use multipart/form-data format
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Access-Key | String | Yes | Access key. Replace with your own key. The access_key form field is also accepted for compatibility. |
| file | File | Yes | Single image file to recognize (JPG, JPEG, PNG, GIF, BMP, TIF, TIFF, WEBP, up to 3MB). The image field is also accepted for compatibility. |
Get your Access Key first
Open the console to create or view your X-Access-Key before sending requests with the examples below.
Code Examples
Examples in multiple languages
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('https://console.easyocr.org/api/ocr', {
method: 'POST',
headers: {
'X-Access-Key': 'eocr_your_access_key_here'
},
body: formData
});
const data = await response.json();
console.log(data);Response Format
Returns JSON format
{
"cost": 20,
"elapsed_seconds": 0.4699,
"message": "OCR recognition succeeded.",
"remaining_quota": 1073,
"image_width": 900,
"image_height": 1500,
"request_id": "b9f069b4113a4455b86800bbfd1bca44",
"result_summary": "Detected 2 text blocks",
"user": "demo_user",
"words": [
{
"bottom": 171.09375,
"left": 53.90625,
"rate": 0.9983862042427063,
"right": 508.59375,
"text": "EasyOCR demo",
"top": 79.6875
},
{
"bottom": 288.28125,
"left": 56.25,
"rate": 0.9859622716903687,
"right": 649.2186889648438,
"text": "Example document content",
"top": 227.34375
}
]
}| Field | Type | Description |
|---|---|---|
| request_id | string | Unique identifier for this request. |
| message | string | Success message. |
| user | string | GitHub username linked to the Access Key. |
| cost | integer | Points charged for this recognition. |
| remaining_quota | integer | Points remaining after the charge. |
| image_width / image_height | integer | Original image dimensions in pixels. |
| elapsed_seconds | number | OCR processing time in seconds. |
| result_summary | string | Summary of the number of detected text blocks. |
| words | array | Text block array; each item includes text, rate, left, top, right, and bottom. |
Point Billing
Charged by the longest image edge; points are charged only after success
| Longest edge | Quota cost |
|---|---|
| β€100 px | 1 point |
| 101β200 px | 2 points |
| 201β300 px | 4 points |
| 301β600 px | 10 points |
| 601β1980 px | 20 points |
| 1981β2980 px | 63 points |
| 2981β3980 px | 125 points |
| >3980 px | 200 points |
How is it calculated?
The larger value of width and height is used for billing. Each image is limited to 10000px and 3MB. New users receive 10,000 points after signing in and can purchase more after the balance is used.
Example
900 Γ 1500 px
Longest edge 1500 px Β· 20 points
Error Status Codes
Failed requests are not charged; 503 and 500 responses automatically refund reserved points
| Status | Error field | Description |
|---|---|---|
| 400 | error | Upload validation failed. The error field explains whether the file is empty, unsupported, too large, or oversized. |
| 401 | invalid_access_key | Missing or invalid access key. |
| 402 | insufficient_credits | Not enough points. The response includes the required points and current balance. |
| 403 | user_disabled | The current user account is disabled. |
| 404 | quota_account_missing | The account quota record does not exist. Contact an administrator. |
| 500 | error | Internal processing failed. Points are refunded automatically; try again later. |
| 503 | error | The OCR service is unavailable or returned an error. Points are refunded automatically; try again later. |
Error responses are JSON. For 400, error contains the upload validation reason; for 503/500, it contains the concrete server-side failure description.
Need Help?
If you encounter any issues, visit our help center or contact us