OCR & Computer Vision
OCR & Computer Vision
The OCR API (/v1/ocr/) is a standalone computer vision service for document extraction, face matching, liveness detection, and compliance checks. It operates independently from the Digital Identity flow — you can use it without user registration.
Front and back extraction as separate calls
MRZ and biographical data extraction
Owner info (front) and vehicle specs (back), plus V2 combined model
Egyptian driving license data extraction
Face match (vs. ID photo), face compare, and liveness detection
Auto-detect any document via /general, or submit unknowns via /others
Egyptian vehicle plate text extraction
CR document data extraction
Arabic text to English transliteration
Base URL and authentication
The OCR API uses a different base path from the Digital Identity API:
Every request requires:
Common request format
All OCR endpoints accept a JSON body with image as a base64-encoded string, plus optional transaction and control fields:
Common response format
data contains document-specific extracted fields. All step outputs include transaction_id, request_id, and client_transaction_id.
Save transaction_id from any step to chain subsequent calls or to look up the record later via the admin Transactions API.
Lookup transaction by ID (admin)
Retrieve the full record for any OCR or Digital Identity transaction. Pass the transaction_id returned by any OCR step (e.g. id/front, passport, liveness) or Digital Identity verify call (verify/id/front, verify/id/back, verify/liveness/multi).
Requires ApiKey and an admin bearer token.
cURL
JavaScript
Python
If the ID is invalid or expired, the API returns error code 5004 (Transaction Not Found). See Error codes.
National ID
Scan front
Response data fields:
Scan back
Response data fields: maritalStatus, job, jobTitle, religion, husbandName, releaseDate, idExpiry, idNumber, gender
Passport
Response data fields:
Car license
License front (owner information)
Response data fields: license_number, license_type, name, nationality, address, expiry, issuance, traffic_unit
License back (vehicle information)
Response data fields: model_year, type, sub_type, chasis, volume, motor, color, fuel, cylinder, examination_dt
Driving license
Response data fields: nameArabic, nameEnglish, nationalID, nationalityArabic, nationalityEnglish, licenseType, job, address, expiryDate, issuanceDate, trafficUnit1, trafficUnit2
Face recognition
Face match (face vs. ID photo)
Match a face image against the ID front photo stored in a transaction. Requires completing the id/front step first for the same transaction_id.
Response data fields:
Face compare (two faces)
Compare any two face images directly, without requiring an ID transaction.
Response data fields: same as Face Match — isMatched, dissimilarity, threshold, score
Liveness detection
Verify that a face image is from a live person, using three frames captured in quick succession.
All three images must be of the same person and captured within 0.5 seconds of each other. Compress each to under 500 KB.
License plate recognition
Response data fields: result — the extracted plate text
Document classification
Identify the type of document in an image before processing it with a specific endpoint.
Response services.classification.doc_type returns the detected type (e.g., national_id, passport, driving_license).
Liveness multi (standalone)
Run liveness detection using three face frames, without being tied to a Digital Identity user account. Same as /v1/ocr/liveness/multi.
All three face images must be of the same person and captured within 0.5 seconds of each other. Compress each to under 500 KB.
Response services.liveness returns true if the face images are live.
General document scan
Auto-detects the document type and extracts all available fields without specifying an endpoint upfront. Useful when the document type is unknown at call time.
Response services.classification.doc_type indicates the detected type. data contains the extracted fields for that document type.
Car license V2
An updated model for car license scanning with improved accuracy. Accepts a single image and extracts both owner and vehicle data.
Commercial registry (CR)
Extract data from an Egyptian commercial registry document.
Transliteration
Convert Arabic text to its English transliteration.
Other documents
Extract data from document types not covered by the dedicated endpoints above.
AML validation
Check a name or ID number against criminal and AML records.
File upload variants
Every endpoint has an equivalent /file variant that accepts multipart/form-data instead of base64. Replace the endpoint path with /file suffix and send the image as a form field:
Available /file variants: id/front/file, id/back/file, car/license/front/file, car/license/back/file, car/licenseV2/file, passport/file, face/match/file, driving_license/file, license_plate/file, classification/file, others/file
OCR vs. Digital Identity verify
Use the OCR API when you need raw document extraction or biometric checks without tying the result to a Vlens user. Use the Digital Identity verify flow when you need the result to count toward a user’s verification status.

