BETA

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

POSTUpload Document

Upload File for OCR

Upload a document and start OCR processing

POST

Endpoint:

endpoint
https://alapi.deep.sa/v1/ocr/upload

Request Format:

Two input modes are accepted: upload a file directly (multipart/form-data) or supply a public HTTPS URL and let the server fetch the PDF for you (application/x-www-form-urlencoded).

Mode A — File Upload: multipart/form-data

Name Type Description
file file Document file: PDF, JPG, PNG, TIFF, BMP or WEBP (a TIFF is read from its first page)

Mode B — URL Fetch: application/x-www-form-urlencoded

Name Type Description
url string Public HTTPS URL of a PDF or image file. The server fetches and validates the content.
filename string Optional filename hint. Defaults to the URL path basename.
Security: Only HTTPS URLs to public hosts are accepted. Private IPs, cloud-metadata addresses (169.254.169.254, etc.), CGNAT, loopback, and link-local ranges are blocked. The server does not forward your Authorization header when fetching the remote file. Maximum file size: 100 MiB.

Response (200 OK):

response.json
{
  "token": "abc123xyz...",
  "status": "queued",
  "progress": 0,
  "upload_progress": 100,
  "queue_position": 1
}

Code Examples:

Send the file directly as multipart/form-data.

upload.py
import requests

url = "https://alapi.deep.sa/v1/ocr/upload"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

with open("document.pdf", "rb") as f:
    files = {"file": f}
    response = requests.post(url, headers=headers, files=files)

result = response.json()
token = result["token"]
print(f"Job started, token: {token}")

Ready to Get Started?

Generate an API key from your dashboard and start building

Activate account?

Activate this account?