This documentation provides details on how to use our OCR API to extract text from images with multilingual support.
The Arabic OCR service provides a REST API for extracting text from images with support for multiple languages, including Arabic.
Base URL: http://ocr.nusrv.com/
Most API endpoints require authentication using an API key.
Visit the API Key Management page to generate your API key.
You can include your API key in requests using one of these methods:
X-API-Key: YOUR_API_KEY
?api_key=YOUR_API_KEY
/api/languages endpoint is public and does not require authentication.
Each API key is limited to 100 requests per day. When your limit is exceeded, requests will return a 429 Too Many Requests status code.
The following languages and language combinations are available for OCR:
| Language Code | Language Name |
|---|---|
ara |
Arabic |
eng |
English |
fra |
French |
ita |
Italian |
deu |
German |
spa |
Spanish |
por |
Portuguese |
rus |
Russian |
tur |
Turkish |
ara+eng |
Arabic + English |
ara+fra |
Arabic + French |
ara+ita |
Arabic + Italian |
ara+deu |
Arabic + German |
ara+spa |
Arabic + Spanish |
eng+fra |
English + French |
/api/languages
Retrieves a list of all available language options for OCR processing.
{
"status": "success",
"languages": {
"ara": "Arabic",
"eng": "English",
"fra": "French",
"ita": "Italian",
"deu": "German",
"spa": "Spanish",
"por": "Portuguese",
"rus": "Russian",
"tur": "Turkish",
"ara+eng": "Arabic + English",
"ara+fra": "Arabic + French",
"ara+ita": "Arabic + Italian",
...
}
}
/api/ocr
Submit an image for OCR text extraction.
Content-Type: multipart/form-data
| Name | Type | Required | Description |
|---|---|---|---|
image |
File | Yes | The image or PDF file to process (JPG, PNG, GIF, BMP, TIFF, PDF) |
lang |
String | No | Language code(s) for OCR processing (default: eng)For multiple languages, use + separator (e.g., ara+eng) |
{
"status": "success",
"result_id": "550e8400-e29b-41d4-a716-446655440000",
"text": "مرحبا بالعالم\nHello world",
"language": "ara+eng"
}
{
"status": "error",
"message": "No image file provided"
}
curl -X POST "http://ocr.nusrv.com/api/ocr" \
-H "X-API-Key: YOUR_API_KEY" \
-F "image=@/path/to/image.jpg" \
-F "lang=ara+eng"
const formData = new FormData();
formData.append('image', imageFile);
formData.append('lang', 'ara+eng');
fetch('http://ocr.nusrv.com/api/ocr', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY'
},
body: formData
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
/api/results/{result_id}
Retrieve a previously processed OCR result using its result ID.
| Name | Type | Required | Description |
|---|---|---|---|
result_id |
String | Yes | The unique identifier returned from a successful OCR request |
{
"status": "success",
"result": {
"text": "مرحبا بالعالم\nHello world",
"language": "ara+eng",
"filename": "example.jpg"
}
}
{
"status": "error",
"message": "Result not found"
}
curl -X GET "http://ocr.nusrv.com/api/results/550e8400-e29b-41d4-a716-446655440000"
result_id to retrieve results later if needed