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
GETJob Status
Get Job Status
Retrieve the status of an OCR job and, once it is done, its results. Poll with ?include=all to get tables, lines with their confidence, layout regions, fields and Markdown in the same response
Endpoint:
https://alapi.deep.sa/v1/ocr/jobs/{token}
Parameters:
| Name | Description |
|---|---|
include |
Optional. all, or a comma-separated list of lines, regions, tables, fields, markdown (line_order comes with lines). Once the job is done, each page carries those arrays; while it is pending or processing the parameter changes nothing, so poll this one URL. Any other value answers 400 invalid_include |
tables[].rows is the table as text: one array per row, one string per column. tables[].cells lists the cells that hold text, each with row and col (from 0), text and the lines it was read from; tables[].region is the table's region. Merged cells are not modelled. lines[].conf is the confidence in that line, from 0 to 1. page_num counts from 1; line and region indices inside a page count from 0. Every page also carries url, line_count, table_count and confidence: the mean of its lines' conf (null when it has no lines), a signal for sorting pages only; decide on lines[].conf
Status Values:
| Status | Description |
|---|---|
pending
|
Job is waiting in the processing queue |
processing
|
Document is being processed |
done
|
Processing complete. Results are in the pages array; a page that could not be read carries an error and is not charged |
failed
|
Processing failed. Check the error field for details |
Response (when status is done):
// GET /ocr/jobs/{token}?include=all
{
"filename": "invoice.pdf",
"status": "done",
"progress": 100,
"total_pages": 1,
"pages_failed": 0,
"detail": "full",
"results": {
"full_url": "/v1/ocr/jobs/abc123xyz?include=all",
"document_url": "/v1/ocr/jobs/abc123xyz/document",
"includes_available": ["lines", "regions", "tables", "fields", "markdown"]
},
"pages": [
{
"page_num": 1,
"url": "/v1/ocr/jobs/abc123xyz/1",
"text": "الصنف المبلغ\nرسوم 1,250.00",
"line_count": 4,
"table_count": 1,
"confidence": 0.962,
"lines": [
{ "id": 0, "text": "الصنف", "conf": 0.98, "box": [880, 210, 1010, 248], "region": 0 },
…
],
"tables": [
{
"region": 0,
"rows": [["الصنف", "المبلغ"], ["رسوم", "1,250.00"]],
"cells": [
{ "row": 1, "col": 1, "text": "1,250.00", "lines": [3] },
…
]
}
],
"regions": […], "line_order": […], "fields": {…}, "markdown": "| الصنف | المبلغ |\n…"
}
]
}
Code Examples:
curl "https://alapi.deep.sa/v1/ocr/jobs/YOUR_TOKEN_HERE?include=all" \
-H "Authorization: Bearer YOUR_API_KEY"
Text only (lighter)
Without include, a finished job carries each page's text and summary (detail: summary); results links to the full results
curl "https://alapi.deep.sa/v1/ocr/jobs/YOUR_TOKEN_HERE" -H "Authorization: Bearer YOUR_API_KEY"
{ "status": "done", "detail": "summary", "results": { … },
"pages": [ { "page_num": 1, "url": "/v1/ocr/jobs/abc123xyz/1", "text": "…",
"line_count": 4, "table_count": 1, "confidence": 0.962 } ] }
Ready to Get Started?
Generate an API key from your dashboard and start building