Skip to main content

OCR: Optical Character Recognition

Our API provides a feature to extract characters from images.

Extract text from images using OCR.​

Performs optical character recognition (OCR) to extract text from images, enabling text-based analysis, data extraction, and automation workflows from visual data.

path=/ocr method=post

Request

JavaScript

const response = await fetch('https://api.umamiai.xyz/v1/ocr', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"
},
body: JSON.stringify({
"document": "https://example.com"
}),
});
const data = await response.json();

Python

import requests

response = requests.post(
"https://api.umamiai.xyz/v1/ocr",
headers={"Content-Type":"application/json","Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
json={"document":"https://example.com"}
)
data = response.json()

Curl

curl -L \
-X POST \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
-H 'Content-Type: application/json' \
'https://api.umamiai.xyz/v1/ocr' \
-d '{"document":"https://example.com"}'

Response

{
"uri": "text",
"content": "text",
"mimeType": "text",
"text": "text",
"textStyles": [],
"pages": [],
"entities": [],
"entityRelations": [],
"textChanges": [],
"revisions": []
}