Vehicle Registration Book OCR
Extract Vehicle Registration Book Information
Response Definition
200
-
-
OCR success.
206
partial_content
Partial content
Some page of request is invalid
400
1001
Too low image resolution (image must be base64 and image size must between 500x500 and 10000x10000)
Image is too small (Should be greater than 500x500)
400
1002
Image quality not acceptable (image must be base64 and image size must between 500x500 and 10000x10000)
Image is too large (Should not exceed 10000x10000).
400
can_not_find_vehicle_registration_on_image
can not find vehicle registration on image
The API cannot recognize the request’s image as a vehicle registration book document.
206/400*
internal_server_error
Page <#no page> : Internal Server Error
The page specified in the error message caused an undefined error.
Parameters
Body
image
String
Base64 image encoded stringBase64 image encoded string
Extract Vehicle Registration Book Information
POST
https://apis.aigen.online/aiscript/vehicle-registration-book/v2
Request Body
image*
String
Input base64 images encoded utf-8
```json
{
"status": "success",
"error": [],
"data": [
{
"ownership": {
"value": "นาง เสลา สระตันติ์",
"bboxes": [
[
[
289,
1305
],
[
571,
1305
],
[
571,
1351
],
[
289,
1351
]
]
],
"bboxes_norm": [
[
[
0.1748,
0.5579
],
[
0.3454,
0.5579
],
[
0.3454,
0.5776
],
[
0.1748,
0.5776
]
]
],
"confidence": 0.986044474570928
},
"model": {
"value": "BAYARFAY10EHA1",
"bboxes": [
[
[
747,
575
],
[
1014,
575
],
[
1014,
607
],
[
747,
607
]
]
],
"bboxes_norm": [
[
[
0.4519,
0.2458
],
[
0.6134,
0.2458
],
[
0.6134,
0.2595
],
[
0.4519,
0.2595
]
]
],
"confidence": 0.9977917852163927
}
}
]
}
```
```json
{
"status": "error",
"error": [
{
"object": "error",
"code": "can_not_find_vehicle_registration_on_image",
"message": "can not find vehicle registration on image"
},
{
"object": "error",
"code": "partial_content",
"message": "Partial content"
}
],
"data": [
{
"ownership": {
"value": "นาง เสลา สระตันติ์",
"bboxes": [
[
[
289,
1305
],
[
571,
1305
],
[
571,
1351
],
[
289,
1351
]
]
],
"bboxes_norm": [
[
[
0.1748,
0.5579
],
[
0.3454,
0.5579
],
[
0.3454,
0.5776
],
[
0.1748,
0.5776
]
]
],
"confidence": 0.986044474570928
},
"model": {
"value": "BAYARFAY10EHA1",
"bboxes": [
[
[
747,
575
],
[
1014,
575
],
[
1014,
607
],
[
747,
607
]
]
],
"bboxes_norm": [
[
[
0.4519,
0.2458
],
[
0.6134,
0.2458
],
[
0.6134,
0.2595
],
[
0.4519,
0.2595
]
]
],
"confidence": 0.9977917852163927
}
}
]
}
```
```json
{
"status": "error",
"error": [
{
"object": "error",
"code": "1001",
"message": "Too low image resolution (image must be base64 and image size must between 500x500 and 10000x10000)"
},
{
"object": "error",
"code": "bad_request",
"message": "Bad Request"
}
],
"data": [
{}
]
}
```// Some code
```json
{
"status": "error",
"error": [
{
"object": "error",
"code": "1002",
"message": "Image quality not acceptable (image must be base64 and image size must between 500x500 and 10000x10000)"
},
{
"object": "error",
"code": "bad_request",
"message": "Bad Request"
}
],
"data": [
{}
]
}
```
```json
{
"status": "error",
"error": [
{
"object": "error",
"code": "can_not_find_vehicle_registration_on_image",
"message": "can not find vehicle registration on image"
},
{
"object": "error",
"code": "bad_request",
"message": "Bad Request"
}
],
"data": [
{}
]
}
```
```json
{
"status": "error",
"error": [
{
"object": "error",
"code": "internal_server_error",
"message": "Page <#no page> : Internal Server Error"
},
{
"object": "error",
"code": "internal_server_error",
"message": "Page <#no page> : Internal Server Error"
}
],
"data": [
{}
]
}
```
import requests
api = "https://apis.aigen.online/aiscript/vehicle-registration-book/v2"
headers = {"x-aigen-key": "<key>"}
data = {"image": "<base64_string>"}
res = requests.post(api, json=data, headers=headers)
print(res.json())
const axios = require("axios");
const api = "https://apis.aigen.online/aiscript/vehicle-registration-book/v2";
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);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://apis.aigen.online/aiscript/vehicle-registration-book/v2',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"image": "<base64_string>",
}',
CURLOPT_HTTPHEADER => array(
'X-AIGEN-KEY: <aigen-key>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
curl --location 'https://apis.aigen.online/aiscript/vehicle-registration-book/v2' \
--header 'X-AIGEN-KEY: <aigen-key>' \
--header 'Content-Type: application/json' \
--data '{
"image": "<base64_string>",
}'
Last updated