Vehicle Insurance Policy OCR
API Documentation for Vehicle Insurance Policy OCR
Extract car policy information from image
Error Definition
HTTP Status | error_code | error_message |
---|---|---|
200 | - | - |
400 | 1001 | Too low image resolution (image must be base64 and image size must between 500x500 and 10000x1000) |
400 | 1002 | Image quality not acceptable (image must be base64 and image size must between 500x500 and 10000x1000) |
400 | 1003 | cannot convert image please check your image (image must be base64 and image size must between 500x500 and 10000x1000) |
500 | 2001 | some error occur in serverside |
Extract car policy information from image
POST https://apis.aigen.online/aiscript/vehicle-insurance-policy/v1
Request Body
Name | Type | Description |
---|---|---|
image* | String | Input base64 image encoded utf-8 |
- 200: OK Successful response
- 400: Bad Request Bad request
- 422: Unprocessable Entity Validation error
- 500: Internal Server Error
{
"response_id": "996b3cf298d546adb97c719711504e58",
"status": "1",
"message": "success",
"data": [
{
"key": "CAR_POLICY_NO",
"value": "11002-108-111111111(1)(ช่อมห้าง",
"rect": [
414,
431,
568,
80
],
"rect_norm": [
0.16686819830713423,
0.1227920227920228,
0.22893994357114067,
0.022792022792022793
],
"confidence": 0.9999095797538757
},
{
"key": "CAR_POLICY_START_DATE",
"value": "19สิงหาคม2562",
"rect": [
726,
1028,
248,
66
],
"rect_norm": [
0.2926239419588875,
0.2928774928774929,
0.09995969367190649,
0.018803418803418803
],
"confidence": 0.9999041557312012
},
{
"key": "CAR_POLICY_END_DATE",
"value": "19สิงหาคม2563",
"rect": [
1605,
1028,
258,
66
],
"rect_norm": [
0.6469165659008465,
0.2928774928774929,
0.10399032648125756,
0.018803418803418803
],
"confidence": 0.9999589920043945
},
{
"key": "CAR_MAKE_MODEL",
"value": "MERCEDESBENZE200",
"rect": [
409,
1288,
389,
42
],
"rect_norm": [
0.1648528819024587,
0.36695156695156694,
0.15679161628375654,
0.011965811965811967
],
"confidence": 0.9998294115066528
},
{
"key": "CAR_LICENSE_NO",
"value": "4กก9999",
"rect": [
962,
1288,
133,
52
],
"rect_norm": [
0.38774687625957277,
0.36695156695156694,
0.053607416364369206,
0.014814814814814815
],
"confidence": 0.9999599456787109
},
{
"key": "CAR_LICENSE_NO",
"value": "กรุงเทพมหานคร",
"rect": [
908,
1347,
238,
59
],
"rect_norm": [
0.365981459089077,
0.3837606837606838,
0.09592906086255543,
0.01680911680911681
],
"confidence": 0.5205637216567993
},
{
"key": "CAR_CHASSIS_NO",
"value": "WDD1111346L056969",
"rect": [
1265,
1291,
339,
38
],
"rect_norm": [
0.5098750503829101,
0.3678062678062678,
0.13663845223700122,
0.010826210826210826
],
"confidence": 0.9999720454216003
},
{
"key": "CAR_CHASSIS_NO",
"value": "27492030396969",
"rect": [
1309,
1351,
258,
49
],
"rect_norm": [
0.5276098347440548,
0.3849002849002849,
0.10399032648125756,
0.01396011396011396
],
"confidence": 0.9999278783798218
}
],
"request_id": "996b3cf298d546adb97c719711504e11"
}
{
"response_id": "996b3cf298d546adb97c719711504e58",
"status": "0",
"error_list": [
{
"code": "1001",
"message": "Too low image resolution (image must be base64 and image size must between 500x500 and 10000x10000)"
}
],
"request_id": "996b3cf298d546adb97c719711504e11"
}
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
{
"response_id": "996b3cf298d546adb97c719711504e58",
"status": "0",
"error_list": [
{
"code": 1002,
"message": "Image quality not acceptable"
}
],
"request_id": "996b3cf298d546adb97c719711504e11"
}
Example code
- Python
- Nodejs
import requests
import json
api = "https://apis.aigen.online/aiscript/vehicle-insurance-policy/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/vehicle-insurance-policy/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);
});