API Documentation

1. (On-Cloud, On-Premise) Image License Plate Recognition

  • On cloud - one request at a time.
  • On premise - unlimited requests.
  • API sends external requests to the LPR system.

Input Image (Sample)

Example Input
post
https
://api.iapp.co.th/license-plate-recognition/carcheck
Post Image
This endpoint allows you to send a picture that consists of minimum one vehicle that OCR must be performed. The Response will be the licence plate number of the vehicle(s) on the picture.
Parameter
Type
Description
Required
apikey
string
Your API key to call this API
Required
vehicle_image
string
Picture consists of a vehicle
Required

Sample Response

200: OK
404: Not Found
415: Unsupported Media Type
1
{
2
"message": "success",
3
"lp_number": "กร5539",
4
"province": "th-14:Phra Nakhon Si Ayutthaya (พระนครศรีอยุธยา)",
5
"vehicle_color": "white",
6
"vehicle_brand": "Honda",
7
"vehicle_model": "honda_jazz",
8
"infer_time(s)": 'inference_time',
9
"conf": 'conf',
10
"status": 200
11
}
Copied!
1
{
2
"message": "Couldn't recognize the license plate"
3
"status": 404
4
}
Copied!
1
{
2
"message": "File Extension is not allowed"
3
"status": 415
4
}
5
6
7
{
8
"message": "Attach one image at a time"
9
"status": 462
10
}
11
12
13
{
14
"message": "Method is not allowed",
15
"status": 415
16
}
Copied!

Sample Request

Python
cURL
Java - Unirest
NodeJS - Request
Objective C
1
import requests
2
3
url = "https://api.iapp.co.th/license-plate-recognition/carcheck"
4
path = "path/to/your/input/image"
5
file_name = "your input image name"
6
7
payload={}
8
files=[
9
('file_name',(path, 'rb'), 'image/jpeg'))
10
]
11
headers = {
12
'apikey': '----Your API Key----'
13
}
14
15
response = requests.request("POST", url, headers=headers, data=payload, files=files)
16
17
print(response.text)
Copied!
1
curl --location --request POST 'https://api.iapp.co.th/license-plate-recognition/carcheck' \
2
--header 'apikey: ----Your API Key----' \
3
--form 'your input image [email protected]"/path/to/your/input/image.jpg|jpeg|png"'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/license-plate-recognition/carcheck")
3
.header("apikey", "----Your API Key----")
4
.field("your input image name", new File("/path/to/your/input/image.jpg|jpeg|png"))
5
.asString();
Copied!
1
var request = require('request');
2
var fs = require('fs');
3
var options = {
4
'method': 'POST',
5
'url': 'https://api.iapp.co.th/license-plate-recognition/carcheck',
6
'headers': {
7
'apikey': '----Your API Key----'
8
},
9
formData: {
10
'file': {
11
'value': fs.createReadStream('/path/to/your/input/image.jpg|jpeg|png'),
12
'options': {
13
'filename': 'your input image name',
14
'contentType': null
15
}
16
}
17
}
Copied!
1
#import <Foundation/Foundation.h>
2
3
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
4
5
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.iapp.co.th/license-plate-recognition/carcheck"]
6
cachePolicy:NSURLRequestUseProtocolCachePolicy
7
timeoutInterval:10.0];
8
NSDictionary *headers = @{
9
@"apikey": @"----Your API Key----"
10
};
11
12
[request setAllHTTPHeaderFields:headers];
13
NSArray *parameters = @[
14
@{ @"name": @"your input image name", @"fileName": @"/path/to/your/input/image.jpg|jpeg|png" }
15
];
Copied!

2. (On-Premise only) Live Camera License Plate Recognition

  • On premise only.
  • LPR system post's detection to a specific URL internally.
  • External post requests to LPR system is not available in this version.
post
https
://{URL}/new-detection/license-plate-number/
Post Detection Results
This endpoint allows you to save your detection according to the number of seconds you choose the results to be saved on the GUI or configuration file.
Parameter
Type
Description
Rquired
output_image
object
Vehicle frame printed with detected parameters.
Optional
lp_number
string
License plate number. (Thai letters + Numbers)
Rquired
vehicle_type
string
Bus, truck, car, pickup, van, SUV...
Optional
vehicle_brand
string
Toyota, Nissan, Mazda, Mercedes-Benz...
Optional
vehicle_color
string
RGB Format. (1 sec delay added)
Optional
province
string
License plate registered province.
Rquired
date_time
string
Vehicle detected date and time
Optional
source
string
Camera port or a video file or live stream URL
Rquired
nickname_source
string
Front-camera, Back-camera, My-camera, My-video...
Rquired
200: OK
404: Not Found
1
{ "lp_number": "มข4320",
2
"vehicle_type": "car",
3
"vehicle_brand": "toyata",
4
"vehicle_color": "unknown",
5
"province": "กรุงเทพมหานคร",
6
"date_time": "2021 September 20 Monday at 16:34:34",
7
"source": "test/book.mp4 is a video file",
8
"name_source": "book"
9
}
Copied!
1
{
2
"message": "No vehicle detected."
3
"status": 404
4
}
5
6
7
{
8
"message": "No license plate detected."
9
"status": 404
10
}
11
12
13
{
14
"message": "Couldn't recognize the license plate"
15
"status": 404
16
}
Copied!