UAE Emirates ID OCR Python SDK
Instantly extract data, bilingual text, and MRZ from UAE Emirates IDs (Front & Back) using our native Python library.
Parsing Emirates ID Challenges
Parsing the UAE Emirates ID presents unique challenges for global businesses. The documents feature complex bilingual layouts containing both Arabic and English text. Additionally, managing dual-sided verification, extracting the 15-digit national identification number, and parsing the 3-line Machine Readable Zone (MRZ) on the reverse side require highly specialized OCR capabilities.
Why StructOCR for the UAE
StructOCR's model is specifically trained on a vast dataset of UAE Emirates IDs, ensuring high accuracy across both Arabic and Latin scripts. This advanced national id ocr capability facilitates efficient information parsing for Gulf region compliance. Fully supports the latest Emirates ID formats, enabling seamless data extraction from both front and back sides, specifically optimized for the 3-line MRZ on the back. Our latest v1.4.0 Python SDK simplifies the integration process, allowing you to extract structured data in seconds.
Common Use Cases in the UAE
- Fintech & Crypto Onboarding: Verify users for trading apps and digital wallets in Dubai and Abu Dhabi.
- Real Estate (Ejari): Automate tenant identity verification for property management.
- Telecom & Utilities: Speed up SIM card registration and utility service applications.
Python SDK Integration
Install the SDK via pip: `pip install structocr`. Then use the following code.
Prerequisite: Python 3.6+ and `structocr` v1.4.0+ library installed.
Prefer another stack? Open the Node.js SDK + Express integration.
from structocr import StructOCR
# 💰 Deposit via Crypto (USDT/USDC) for a 10% credit bonus!
# 👉 https://structocr.com/pricing
# Initialize with your API Key
client = StructOCR("YOUR_API_KEY_HERE")
def scan_emirates_id():
# Note: Supports JPG, PNG, WebP (Max 4.5MB)
# Target: Emirates ID (Supports front, back, and 3-line MRZ)
image_path = "uae_emirates_id_back.jpg"
try:
print(f"Scanning {image_path}...")
# The SDK handles file upload and API communication
# It automatically detects that this is a UAE document
result = client.scan_national_id(image_path)
# Check success flag
if result.get('success'):
data = result['data']
print("✅ UAE Emirates ID Extraction Successful!")
# Basic Identity
print(f"Region: {data.get('country_code')}")
print(f"Name: {data.get('given_names')} {data.get('surname')}")
print(f"Card Number: {data.get('document_number')}")
# Critical Field: UAE Identity Number (15 digits)
print(f"Personal #: {data.get('personal_number')}")
# Demographics
print(f"DOB: {data.get('date_of_birth')} ({data.get('sex')})")
print(f"Nationality: {data.get('nationality')}")
# Machine Readable Zone (MRZ) - Found on the back
additional = data.get('additional_fields', {})
if additional.get('mrz_line_1'):
print("\n--- MRZ Data (Reverse Side) ---")
print(additional.get('mrz_line_1'))
print(additional.get('mrz_line_2'))
if additional.get('mrz_line_3'):
print(additional.get('mrz_line_3'))
else:
print(f"❌ Extraction Failed: {result.get('error')}")
except Exception as e:
# Handle SDK or Network errors
print(f"An error occurred: {e}")
if __name__ == "__main__":
scan_emirates_id()Technical Specs
- •Latency: < 3s (Average via Cloudflare edge routing)
- •Availability: Served from Cloudflare's global edge network
- •Security: AES-256 Encryption & GDPR/PDPL Compliant
- •Input: JPG, PNG, WebP (Max 4.5MB) — Supports Front & Back images
- •Output: JSON (Structured Data with 3-line MRZ support)
Key Features
- •Bilingual Arabic & English: Native support for rendering and extracting dual-language fields accurately.
- •15-Digit ID Formatting: Automatically validates and formats the 784-YYYY-XXXXXXX-X personal number pattern.
- •3-Line MRZ Parsing: Accurately extracts and validates the Machine Readable Zone lines standard on Emirates IDs.
- •Blur & Glare Detection: Automatically identifies unreadable images caused by smart card holograms.
- •Smart Crop & Deskew: Automatically aligns and crops the document from complex backgrounds.
JSON Response Example
The SDK returns a Python dictionary matching this JSON structure.
{
"success": true,
"data": {
"type": "national_id",
"country_code": "ARE",
"nationality": "ARE",
"document_number": "123456789",
"card_series": null,
"personal_number": "784-1990-1234567-1",
"surname": "AL MANSOORI",
"given_names": "AHMED MOHAMMED",
"sex": "M",
"date_of_birth": "1990-05-15",
"place_of_birth": "DUBAI",
"address": "Downtown Dubai, Sheikh Mohammed bin Rashid Blvd",
"date_of_issue": "2021-08-20",
"date_of_expiry": "2031-08-19",
"issuing_authority": "Federal Authority for Identity and Citizenship",
"additional_fields": {
"phone_number": null,
"tramite_number": null,
"ejemplar": null,
"mrz_line_1": "IDARE1234567894<<<<<<<<<<<<<<<",
"mrz_line_2": "9005155M3108198ARE<<<<<<<<<<<4",
"mrz_line_3": "AL<MANSOORI<<AHMED<MOHAMMED<<<"
}
}
}Frequently Asked Questions
Does the API support Arabic text extraction?
Yes, our engine is natively trained to handle the Arabic scripts present on the Emirates ID.
Are the ID images stored on your servers?
Only briefly. Images are kept for at most 24 hours for quality spot-checks, then deleted.
Can I pay for API credits using Cryptocurrency?
Yes! StructOCR supports USDT/USDC deposits. You also get an automatic 10% credit bonus when topping up with crypto.
You May Also Like
Related tutorials, platform guides, and comparisons
UAE Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from UAE passports with a server-side integration.
UAE Emirates ID OCR with Node.js SDK
Extract Emirates ID number, names, dates and other visible fields from Emirates ID with the StructOCR Node.js SDK and Express.
Bangladesh Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Bangladesh passports with a server-side integration.
France Carte Nationale d'Identité OCR Python SDK
Python Tutorial: Automate KYC in France. Extract data from Carte Nationale d'Identité and validate TD1/TD2 MRZ using StructOCR Python SDK. Supports native text.
Saudi Arabia National ID & Iqama OCR Python SDK
Python Tutorial: Automate KYC in Saudi Arabia. Extract data from National IDs and Iqamas using the StructOCR Python SDK. Supports bilingual (Arabic/English) text, 10-digit ID numbers, and 3-line MRZ extraction.
Pakistan CNIC OCR Python SDK
Python Tutorial: Automate KYC in Pakistan. Extract data from CNIC using StructOCR Python SDK. Supports native text.
Thailand ID Card OCR Python SDK
Python Tutorial: Automate KYC in Thailand. Extract data from the Thai National Identity Card using StructOCR Python SDK. Supports Thai script, dual-language fields, and 13-digit Citizen ID extraction.
Vietnam CCCD OCR Python SDK
Python Tutorial: Automate KYC in Vietnam. Extract data from the Vietnamese Identity Card (Căn cước công dân / CCCD) using StructOCR Python SDK. Supports native text, diacritics, and MRZ extraction.
PHP Receipt OCR API
Tutorial: Integrate the StructOCR Receipt API into your PHP web applications. Upload an image for a free test! Extract merchants, totals, and line items from POS receipts using raw cURL or Guzzle.
PHP Weighbridge Ticket OCR API Tutorial
Integrate weighbridge ticket OCR in PHP. Extract ticket number, vehicle, material, gross, tare, net, and validation data from Base64 images.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add Passport OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Lovable.dev app through a secure server-side function for travel and KYC flows.
Add Receipt OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR receipt API into a Lovable.dev app. No backend required — just paste a prompt and add your API key.
Add VIN OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR VIN scanner API into a Lovable.dev app. Build automotive and fleet tools with zero backend required.
Manual TOS Entry vs. Container OCR Automation API
Analyzing the ROI and operational efficiency of replacing manual gate checkers with an automated Container OCR API in logistics yards.
OpenALPR vs. StructOCR API for VIN Decoding
Why traditional License Plate Recognition (ALPR) engines are not suitable for scanning Vehicle Identification Numbers (VINs).
Add Container OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a Replit application. Build logistics and yard management tools using Replit Agent and Secrets.
From tutorial to production in 5 minutes.
You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.