Documentation
  • Introduction
  • ⚡Quick Guide
  • APIs
    • 🇦🇪UAE Resident ID OCR
    • 🔑OAuth Token
    • 🆔National ID OCR
      • 🔁API Response
    • 🧑‍💼Face Match
      • Face Match (Two Images)
      • Face Match (Image & Transaction ID)
    • ✈️Passport
    • ✈️Libyan passport
    • 🚗Car License
    • ↔️Transliteration
      • National ID Transliteration
      • Commercial Register Translation
      • Names Transliteration
    • 🏫Know Your Business (eKYB)
      • 📖Data Extraction & Verifications
        • Egyptian Commercial Register ID OCR
          • ✅With Verification
        • Egyptian Tax Card OCR
    • 📄Valify Sanction Shield
      • Sanction Shield v2.1.0
    • Sanction Shield v2.0.0
    • 🛡️Supported lists
    • ❓Transaction Inquiry
    • 📷Fetch Images
    • 🔒OTP
      • 📲Send Phone OTP
      • ✅Verify Phone OTP
      • 📥Send Email OTP
      • ✅Verfiy Email OTP
    • Response Data Validation
  • Error Codes
    • Valify Error Codes
    • HTTP Codes
  • References
Powered by GitBook
On this page
  1. APIs

Car License


This API provides Data Extraction for the Egyptian Car License

Egyptian Car License OCR

POST https://valifystage.com/api/v1/ocr/

Headers

Name
Type
Description

Content-Type*

string

application/json

Authentication*

string

Bearer <access-token>

Request Body

Name
Type
Description

document_type*

string

egy_car_license

data*

object

Object containing the parameters below: { front_img: <base64 str>, back_img: <base64 str>, bundle_key: <str>, lang: <str> }

{
    "result": {
        "name:": '<string>',
        "nationality:": '<string>',
        "address:": '<string>',
        "traffic_unit:": '<string>',
        "traffic_department": '<string>',
        "license_type": '<string>',
        "release_date": '<string>',
        "expiry_date": '<string>',
        "brand": '<string>',
        "model": '<string>',
        "model_year": '<string>',
        "body_shape": '<string>',
        "chassis_number": '<string>',
        "engine_number": '<string>',
        "engine_capacity": '<string>',
        "cylinder": '<string>',
        "gas_type": '<string>',
        "color": '<string>'
    },
    "transaction_id": '<string>',
    "trials_remaining": '<int>'
}
{
    "message": "Bad Request – invalid request received (e.g. missing Bundle key, required parameters or invalid json) | Make sure all the required parameters are included"
}
{
    "message": "Unauthorized – your Bundle key is invalid"
}
{
    "message": "Forbidden – specified access_token could not be found"
}
{
    "message": "Not Found"
}
{
    "message": "Unsupported Media Type"
}
{
    "message": "<error-description>",
    "error_code": <valify-error-code>
}
{
    "message": "Internal Server Error"
}

  1. Download the JSON file from here.

  1. Open Postman and click on Import.

  1. Drop the JSON file.

  1. Click on "CL" then "Authorization" and replace <access token> with your generated access token and click on "Body".

  1. Fill in the required details and hit "Send".

import requests
import base64

def base64_encode(file_name):
    with open(file_name, "rb") as image_file:
        encoded_string = base64.b64encode(image_file.read()).decode()
        return encoded_string
    return ""

front_image = base64_encode('<image path>') # Place your front image here
back_image = base64_encode('<image path>') # Place your back image here
token = "<token>" # Place your token here
data = {
    'document_type': 'egy_car_license', 
    'data':
    {   
        'front_img': front_image,
        'back_img': back_image,
        'bundle_key': '<bundle key>', # Place your bundle key here
        'lang': '<str>' # optional, default: en
    }
}

r = requests.post("https://<base-url>/api/v1/ocr/",
        json=data,
        headers={'Authorization': 'Bearer %s' % token}
    )
                      
print(r.json())

PreviousLibyan passportNextTransliteration

Last updated 11 months ago

Please note that the front and back images should be converted to base 64 format. This can be done via an online tool;

🚗
https://base64.guru/converter/encode/image/jpg
1KB
Valify - EGY NID OCR v1.4.postman_collection