Links
Comment on page
🇹🇭

API Documentation for Thai LPR

Postman Example:

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/file
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
file
string
Picture consists of a vehicle
Required

Response Explanation

Parameters
Explanation
conf
Confidence score of the license plate recognition in percentage.
infer_time(s)
Time taken for inference in seconds.
is_missing_plate
Indicates if there is a license plate missing in the image. Possible values: "yes" or "no".
is_vehicle
Indicates if a vehicle is present in the image. Possible values: "yes" or "no".
lp_number
License plate number recognized from the image.
message
API response message. Possible values: "success" or "error".
province
Province of the registered vehicle as identified by the license plate.
status
HTTP status code of the API response.
vehicle_body_type
Body type of the recognized vehicle.List of Supported Body Type
vehicle_brand
Brand of the recognized vehicle. List of Supported Vehicle Brand
vehicle_color
Color of the recognized vehicle. List of Supported Color
vehicle_model
Model of the recognized vehicle. List of Supported Vehicle Model
vehicle_orientation
Orientation of the recognized vehicle in the image. List of Supported Orientation
vehicle_year
Year range of the recognized vehicle model. List of Supported Year Ranges

Sample Response

200: OK
404: Not Found
415: Unsupported Media Type
{
"conf": 94.56048584,
"infer_time(s)": 0.1770620346069336,
"is_missing_plate": "no",
"is_vehicle": "yes",
"lp_number": "6กผ40",
"message": "success",
"province": "th-10:Bangkok (กรุงเทพมหานคร)",
"status": 200,
"vehicle_body_type": "sedan-compact",
"vehicle_brand": "nissan",
"vehicle_color": "white",
"vehicle_model": "nissan_sentra",
"vehicle_orientation": "0",
"vehicle_year": "2015-2019"
}
{
"message": "Couldn't recognize the license plate"
"status": 404
}
{
"message": "File Extension is not allowed"
"status": 415
}
{
"message": "Attach one image at a time"
"status": 462
}
{
"message": "Method is not allowed",
"status": 415
}

Sample Request

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

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.
Required
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
{ "lp_number": "มข4320",
"vehicle_type": "car",
"vehicle_brand": "toyata",
"vehicle_color": "unknown",
"province": "กรุงเทพมหานคร",
"date_time": "2021 September 20 Monday at 16:34:34",
"source": "test/book.mp4 is a video file",
"name_source": "book"
}
{
"message": "No vehicle detected."
"status": 404
}
{
"message": "No license plate detected."
"status": 404
}
{
"message": "Couldn't recognize the license plate"
"status": 404
}