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/ocr

Request Parameters

Use multipart/form-data format

ParameterTypeRequiredDescription
X-Access-KeyStringYesAccess key. Replace with your own key. The access_key form field is also accepted for compatibility.
fileFileYesSingle 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.

Open Console

Code Examples

Examples in multiple languages

javascript
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

Response
{
  "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
    }
  ]
}
FieldTypeDescription
request_idstringUnique identifier for this request.
messagestringSuccess message.
userstringGitHub username linked to the Access Key.
costintegerPoints charged for this recognition.
remaining_quotaintegerPoints remaining after the charge.
image_width / image_heightintegerOriginal image dimensions in pixels.
elapsed_secondsnumberOCR processing time in seconds.
result_summarystringSummary of the number of detected text blocks.
wordsarrayText 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 edgeQuota cost
≀100 px1 point
101–200 px2 points
201–300 px4 points
301–600 px10 points
601–1980 px20 points
1981–2980 px63 points
2981–3980 px125 points
>3980 px200 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

StatusError fieldDescription
400errorUpload validation failed. The error field explains whether the file is empty, unsupported, too large, or oversized.
401invalid_access_keyMissing or invalid access key.
402insufficient_creditsNot enough points. The response includes the required points and current balance.
403user_disabledThe current user account is disabled.
404quota_account_missingThe account quota record does not exist. Contact an administrator.
500errorInternal processing failed. Points are refunded automatically; try again later.
503errorThe 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