5 min quick start
Quick Start
EasyOCR provides a simple RESTful API for quick OCR integration
API Endpoint
Unified endpoint
Recommended
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. |
| file | File | Yes | Single image file to recognize (JPG, PNG, BMP). |
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
JavaScript
const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('https://console.easyocr.org/api/ocr', {
method: 'POST',
headers: {
'X-Access-Key': 'eocr_your_access_key_here'
},
body: formData
})
.then(res => res.json())
.then(data => console.log(data));Python
import requests
files = {
'file': open('image.jpg', 'rb')
}
headers = {
'X-Access-Key': 'eocr_your_access_key_here'
}
response = requests.post('https://console.easyocr.org/api/ocr', headers=headers, files=files)
print(response.json())Java
import okhttp3.*;
import java.io.File;
OkHttpClient client = new OkHttpClient();
RequestBody body = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", "image.jpg",
RequestBody.create(new File("image.jpg"),
MediaType.parse("image/jpeg")))
.build();
Request request = new Request.Builder()
.url("https://console.easyocr.org/api/ocr")
.addHeader("X-Access-Key", "eocr_your_access_key_here")
.post(body)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());cURL
curl --location 'https://console.easyocr.org/api/ocr' \ --header 'X-Access-Key: eocr_your_access_key_here' \ --form 'file=@"./image.jpg"'
Response Format
Returns JSON format
Response
{
"elapsed_seconds": 0.4699,
"message": "OCR recognition succeeded.",
"remaining_quota": 1093,
"request_id": "b9f069b4113a4455b86800bbfd1bca44",
"result_summary": "Recognition completed with 13 text blocks.",
"user": "demo_user",
"words": [
{
"bottom": 171.09375,
"left": 53.90625,
"rate": 0.9983862042427063,
"right": 508.59375,
"text": "Akile Exchange",
"top": 79.6875
},
{
"bottom": 288.28125,
"left": 56.25,
"rate": 0.9859622716903687,
"right": 649.2186889648438,
"text": "HKLite-One (Special Edition)",
"top": 227.34375
}
]
}Need Help?
If you encounter any issues, visit our help center or contact us