For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
HomeAPI Reference
HomeAPI Reference
  • Get started
    • Welcome
    • Quick Start
  • API basics
    • Authentication
    • Conventions
    • Errors
    • Webhooks
  • Products
    • Digital Identity
    • OCR & Computer Vision
    • E-Contracting
    • OAuth Registration
    • Iframe Integration
  • SDKs
    • Flutter SDK
  • Resources
    • Support
  • Changelog
    • Changelog
Dashboard
LogoLogo
On this page
  • Base URL and authentication
  • Common request format
  • Common response format
  • National ID
  • Scan front
  • Scan back
  • Passport
  • Car license
  • License front (owner information)
  • License back (vehicle information)
  • Driving license
  • Face recognition
  • Face match (face vs. ID photo)
  • Face compare (two faces)
  • Liveness detection
  • License plate recognition
  • Document classification
  • File upload variants
  • AML validation
  • OCR vs. Digital Identity verify
Products

OCR & Computer Vision

Standalone document extraction, face recognition, and biometric services
||View as Markdown|
Was this page helpful?
Edit this page
Previous

Digital Identity

Next

E-Contracting

Built with

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.

National ID

Extract text and data from Egyptian national ID front and back

Passport

Extract passport machine-readable zone (MRZ) and biographical data

Car License

Extract vehicle license front (owner info) and back (vehicle specs)

Driving License

Extract Egyptian driving license data

Face Recognition

Match a face to an ID photo or compare two face images

License Plate

Extract text from Egyptian vehicle license plates


Base URL and authentication

The OCR API uses a different base path from the Digital Identity API:

https://api.vlenseg.com/v1/ocr/

Every request requires:

1ApiKey: YOUR_TENANT_API_KEY
2Authorization: Bearer YOUR_ACCESS_TOKEN
3Content-Type: application/json

Common request format

All OCR endpoints accept a JSON body with image as a base64-encoded string, plus optional transaction and control fields:

1{
2 "image": "BASE64_ENCODED_IMAGE",
3 "transaction_id": "optional-uuid-to-group-steps",
4 "client_transaction_id": "your-own-reference",
5 "country": "EGY",
6 "getExtractedData": true
7}
FieldRequiredDescription
imageYesBase64-encoded JPEG or PNG. Max 3 MB.
transaction_idNoGroup multiple steps into one transaction. Omit to start a new one.
client_transaction_idNoYour own reference ID.
countryNoDefaults to EGY.
getExtractedDataNoInclude full extracted fields in the response. Default false.

Common response format

1{
2 "services": {
3 "validations": { "validation_errors": [] },
4 "spoofing": { "fake": false },
5 "classification": { "doc_type": "national_id" },
6 "liveness": null,
7 "AML": null,
8 "SRC": null
9 },
10 "data": { ... },
11 "error_code": null,
12 "error_message": null
13}

data contains document-specific extracted fields. All step outputs include transaction_id, request_id, and client_transaction_id.


National ID

Scan front

$curl -X POST https://api.vlenseg.com/v1/ocr/id/front \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "image": "BASE64_ID_FRONT",
> "getExtractedData": true
> }'

Response data fields:

FieldDescription
first_name / last_namesArabic name components
first_name_english / last_names_englishTransliterated name
idNumberNational ID number
dateOfBirthDate of birth
govern / city / districtAddress
genderM / F
transaction_idUse in subsequent steps

Scan back

$curl -X POST https://api.vlenseg.com/v1/ocr/id/back \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "image": "BASE64_ID_BACK",
> "transaction_id": "TX_FROM_FRONT"
> }'

Response data fields: maritalStatus, job, jobTitle, religion, husbandName, releaseDate, idExpiry, idNumber, gender


Passport

$curl -X POST https://api.vlenseg.com/v1/ocr/passport \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "image": "BASE64_PASSPORT_IMAGE"
> }'

Response data fields:

FieldDescription
passport_noPassport number
nameFull name
nationalityNationality
country_codeIssuing country ISO code
genderGender
Date_of_BirthDate of birth
Date_of_ExpiryExpiry date
doc_TypeDocument type (e.g. P for passport)

Car license

License front (owner information)

$curl -X POST https://api.vlenseg.com/v1/ocr/car/license/front \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{"image": "BASE64_LICENSE_FRONT"}'

Response data fields: license_number, license_type, name, nationality, address, expiry, issuance, traffic_unit

License back (vehicle information)

$curl -X POST https://api.vlenseg.com/v1/ocr/car/license/back \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{"image": "BASE64_LICENSE_BACK"}'

Response data fields: model_year, type, sub_type, chasis, volume, motor, color, fuel, cylinder, examination_dt


Driving license

$curl -X POST https://api.vlenseg.com/v1/ocr/driving_license \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{"image": "BASE64_DRIVING_LICENSE"}'

Response data fields: NameArabic, NameEnglish, NationalID, NationalityArabic, NationalityEnglish, LicenseType, Job, Address, ExpiryDate, IssuenceDate, 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.

$curl -X POST https://api.vlenseg.com/v1/ocr/face/match \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "image": "BASE64_FACE_IMAGE",
> "transaction_id": "TX_WITH_ID_FRONT"
> }'

Response data fields:

FieldDescription
isMatchedWhether the face matches the ID photo
dissimilarityDistance score (lower = more similar)
thresholdMatch threshold used (default 2.4)
scoreMatch confidence score
detected_face_imageWhether a face was detected in the submitted image
detected_id_face_imageWhether a face was detected in the ID photo

Face compare (two faces)

Compare any two face images directly, without requiring an ID transaction.

$curl -X POST https://api.vlenseg.com/v1/ocr/face/compare \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "face_image1": "BASE64_FACE_1",
> "face_image2": "BASE64_FACE_2",
> "liveness": "2"
> }'

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.

$curl -X POST https://api.vlenseg.com/v1/ocr/liveness/multi \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "face_1": "BASE64_FACE_1",
> "face_2": "BASE64_FACE_2",
> "face_3": "BASE64_FACE_3",
> "transaction_id": "TX_WITH_ID_FRONT"
> }'

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

$curl -X POST https://api.vlenseg.com/v1/ocr/license_plate \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{"image": "BASE64_CAR_IMAGE"}'

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.

$curl -X POST https://api.vlenseg.com/v1/ocr/classification \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{"image": "BASE64_DOCUMENT"}'

Response services.classification.doc_type returns the detected type (e.g., national_id, passport, driving_license).


File upload variants

Every endpoint has an equivalent /file variant that accepts a multipart/form-data upload instead of base64:

$curl -X POST https://api.vlenseg.com/v1/ocr/passport/file \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -F "file=@passport.jpg"

AML validation

Check a name or ID number against criminal and AML records.

$curl -X POST https://api.vlenseg.com/v1/ocr/aml/validate \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "idNumber": "29901234567890",
> "name": "Ahmed Mohamed"
> }'

OCR vs. Digital Identity verify

OCR API (/v1/ocr/)Digital Identity (/api/DigitalIdentity/verify/)
Requires user registrationNoYes
Links result to a user accountNoYes
Sets isDigitalIdentityVerifiedNoYes
Suitable for standalone extractionYesNo
Includes NTRA / CSO authority checksNoYes (configurable)

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.