Skip to main content

Driver Licence OCR

Extract driver licence information from an image, including licence number, name, date of birth, and expiry date.

Extract driver license information from image

Error Definition

http statuserror_codeerror_message
200--
4001001Fail to do rotate image
4001002Can not find driver license on picture
5002001some error occur in serverside

Extract driver license information from image

POST https://api.aigen.online/aiscript/driver-license/v1

Request Body

NameTypeDescription
image*StringInput base64 image encoded utf-8
{
"status": "200",
"message": "success",
"response_id": "123wereqs2",
"error_list": [
{
"code": "string",
"message": "string"
}
],
"result": [
{
"keyname": "string",
"text": "string",
"confidence": 0
}
]
}

Example code

import requests
import json

api = "https://api.aigen.online/aiscript/driver-license/v1"
headers = {"x-aigen-key": "<key>", "content-type": "application/json"}
data = json.dumps({"image": "<base64_string>"})

res = requests.post(api, data=data, headers=headers)
print(res.json())