alOCR
Extract text from documents with advanced Arabic and English OCR. Supports PDFs and images with automatic deskewing and layout detection.
- Path
- /v1/ocr
- Key scope
- ocr
Supported file formats
PDF, JPG, PNG, TIFF, BMP, WEBP
Supports Arabic and English text extraction with automatic language detection
GETGet Single Page
Get Page by Number
Retrieve one page: its text in reading order, lines, layout regions, tables, extracted fields and image links. Add ?markdown=1 for a Markdown rendering
Endpoint:
https://alapi.deep.sa/v1/ocr/jobs/{token}/{page_num}
Request Format:
| Name | Type | Description |
|---|---|---|
token |
String | Access token received from upload |
page_num |
Integer | Page number (1-indexed) |
Response (200 OK):
{
"page_num": 1,
"text": "Extracted text from this page...",
"direction": "rtl",
"lines": [{ "text": "...", "box": [40, 52, 980, 88], "conf": 0.98 }],
"regions": [{ "cls": "paragraph", "box": [40, 52, 980, 300] }],
"tables": [{ "rows": [["cell", "cell"]] }],
"fields": { "dates": [], "totals": [] },
"thumbnail": {
"url": "https://...presigned-url..."
},
"image": {
"url": "https://...presigned-s3-url..."
},
"status": "done"
}
thumbnail and image are short-lived links (valid for about an hour); request the page again for fresh ones.
Code Examples:
import requests
API_BASE = "https://alapi.deep.sa/v1"
API_KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}
token = "YOUR_TOKEN_HERE"
page_num = 3
response = requests.get(
f"{API_BASE}/ocr/jobs/{token}/{page_num}",
headers=headers
)
page = response.json()
print(f"Page {page['page_num']}: {page['status']}")
print(page["text"])
Error Handling:
| Status | Description |
|---|---|
400 |
page_num must be >= 1 |
404 |
Job or page not found |
410 |
The job's results are no longer available |
Ready to Get Started?
Generate an API key from your dashboard and start building