Image
OCR - Extract text from image
Extract text from an image using Optical Character Recognition (OCR).
Supported Formats
- PNG, JPEG, TIFF, BMP, GIF, WebP
Language Support
Use ISO 639-3 language codes. Multiple languages can be combined with '+'.
Examples:
- eng - English
- deu - German
- fra - French
- eng+fra - English and French
Example Usage
import httpx
with open("scan.png", "rb") as f:
response = httpx.post(
"https://api.filegraph.ai/image/to-text",
headers={"X-API-Key": "your-api-key"},
files={"file": f},
data={"language": "eng"}
)
print(response.json()["text"])
post/image/to-text
Request
- Base URL: https://api.filegraph.ai (the document declares no server; this is the origin it was published from)
- URL: https://api.filegraph.ai/image/to-text
- Auth: API key in header X-API-Key
Query parameters
languagestring
Response
Text successfully extracted
Example response
{
"char_count": 892,
"format_detected": "pdf",
"metadata": {
"page_count": 3
},
"text": "This is the extracted text from the document...",
"used_ocr": false,
"word_count": 150
}Changes
No recorded changes to this operation across all 1 revision of this API.