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:
Authentication
To access the Ocr.best API, you need to include an API key in the request header.
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:
Form Data: image (file)
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:
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:
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"'
Response Format
JSON structure for both success and error responses.