Driver Licence OCR
API Documentation for Driver Licence OCR
Extract driver license information from image
Error Definition
http status | error_code | error_message |
---|---|---|
200 | - | - |
400 | 1001 | Fail to do rotate image |
400 | 1002 | Can not find driver license on picture |
500 | 2001 | some error occur in serverside |
Extract driver license information from image
POST https://apis.aigen.online/aiscript/driver-license/v1
Request Body
Name | Type | Description |
---|---|---|
image* | String | Input base64 image encoded utf-8 |
- 200: OK Successful response
- 422: Unprocessable Entity Validation error
{
"status": "200",
"message": "success",
"response_id": "123wereqs2",
"error_list": [
{
"code": "string",
"message": "string"
}
],
"result": [
{
"keyname": "string",
"text": "string",
"confidence": 0
}
]
}
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
Example code
- Python
- Nodejs
import requests
import json
api = "https://apis.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())
const axios = require("axios");
const api = "https://apis.aigen.online/aiscript/driver-license/v1";
const headers = {
"x-aigen-key": "<key>",
};
const data = { image: "<base64_string>" };
axios
.post(api, data, { headers: headers })
.then((res) => {
console.log(res.data);
})
.catch((err) => {
console.error(err.response.data);
});