API Documentation

The OCR.best API allows you to convert images containing text into machine-readable text. This documentation provides details on how to make requests to the API and the expected responses.

Base URL

The base URL for making API requests is:

https://www.ocr.best/api/user/ocr_api Copy

Authentication

To access the Ocr.best API, you need to include an API key in the request header.

Authorization: Bearer YOUR_API_KEY Copy

Replace YOUR_API_KEY with your actual API key obtained from the service provider

API Endpoints

Three ways to send image data.

1. Image File Upload

This endpoint allows you to directly upload an image file for text extraction.

Send a POST request to the base URL with the following headers and form data:

Header: Content-Type: multipart/form-data
Form Data: image (file)
Copy

2. Image URL

This endpoint allows you to provide the URL of the image to be processed for text extraction.

Send a POST request to the base URL with the following headers and JSON body:

JSON Body: image_url (string) Copy

3. Base64 Image Data

This endpoint allows you to provide the image data as a Base64-encoded string.

Send a POST request to the base URL with the following headers and JSON body:

JSON Body: base64 (string) Copy

CURL Example

Here is an example of how to use CURL to make a request to the API:

curl  -X POST \
'https://www.ocr.best/api/user/ocr_api' \
--header 'Accept: */*' \
--header 'Authorization: Bearer YOUR_API_KEY   \
--form 'base64="base64 DATA URI string"'
Copy

Response Format

JSON structure for both success and error responses.

Success Response

{"error": false, "result": "ocrbest"} Copy

Error Response

{"error": true, "message": "Authorization error"} Copy
Preview
notication image notication image notication image notication image notication image notication image delete account image
Heading
Notification
line__1

Why are you cancelling?