Skip to content

Image To Text (OCR)

Image To Text (OCR) uses advanced machine learning (Tesseract) to recognize and extract text from images. It supports multiple languages and returns the raw text along with a confidence score.

POST /ocr

FieldTypeRequiredDescription
urlstringYesDirect URL to the image file (JPG, PNG, BMP).
langstringNoLanguage code (default: ‘eng’). See supported codes.
const res = await fetch('https://heavstal.com.ng/api/v1/ocr', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
url: 'https://i.imgur.com/example.png',
lang: 'eng'
})
});
{
"status": "success",
"creator": "HEAVSTAL TECH",
"data": {
"confidence": 92.5,
"text": "HEAVSTAL TECH\nBuilding the future."
}
}