API Documentation

Thai National ID Card Front Side

post
https://api.iapp.co.th
/thai-national-id-card/v3/front
Thai National ID Card Front Side

Sample Requests

CURL
Java - Unirest
C#
NodeJS - Request
Objective C
PHP
Python
1
curl --location --request POST 'https://api.iapp.co.th/thai-national-id-card/v3/front' \
2
--header 'apikey: {Your API Key}'\
3
--form '[email protected]"APIs/Thai National ID Card OCR v3/id-card-front.jpg"'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/thai-national-id-card/v3/front")
3
.header("apikey", "{Your API Key}")
4
.field("file", new File("APIs/Thai National ID Card OCR v3/id-card-front.jpg"))
5
.asString();
Copied!
1
HttpClient client = new HttpClient();
2
//Change API Key
3
client.DefaultRequestHeaders.Add("apikey", "R7**Ujq");
4
var requestContent = new MultipartFormDataContent();
5
byte[] fileContents = File.ReadAllBytes(@"C:***\Picture1.PNG");
6
requestContent.Add(new StreamContent(new MemoryStream(fileContents)), "file", "Picture1.PNG");
7
var response = await client.PostAsync("https://api.iapp.co.th/thai-national-id-card/v3/front", requestContent);
8
var contents = await response.Content.ReadAsStringAsync();
9
10
Console.Write(contents);
Copied!
1
var request = require('request');
2
var fs = require('fs');
3
var options = {
4
'method': 'POST',
5
'url': 'https://api.iapp.co.th/thai-national-id-card/v3/front',
6
'headers': {
7
'apikey': '{Your API Key}'
8
},
9
formData: {
10
'file': {
11
'value': fs.createReadStream('APIs/Thai National ID Card OCR v3/id-card-front.jpg'),
12
'options': {
13
'filename': 'id-card-front.jpg',
14
'contentType': null
15
}
16
}
17
}
18
};
19
request(options, function (error, response) {
20
if (error) throw new Error(error);
21
console.log(response.body);
22
});
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/thai-national-id-card/v3/front"]
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": @"file", @"fileName": @"APIs/Thai National ID Card OCR v3/id-card-front.jpg" }
15
];
16
17
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
18
NSError *error;
19
NSMutableString *body = [NSMutableString string];
20
21
for (NSDictionary *param in parameters) {
22
[body appendFormat:@"--%@\r\n", boundary];
23
if (param[@"fileName"]) {
24
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
25
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
26
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
27
if (error) {
28
NSLog(@"%@", error);
29
}
30
} else {
31
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
32
[body appendFormat:@"%@", param[@"value"]];
33
}
34
}
35
[body appendFormat:@"\r\n--%@--\r\n", boundary];
36
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
37
[request setHTTPBody:postData];
38
39
[request setHTTPMethod:@"POST"];
40
41
NSURLSession *session = [NSURLSession sharedSession];
42
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
43
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
44
if (error) {
45
NSLog(@"%@", error);
46
dispatch_semaphore_signal(sema);
47
} else {
48
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
49
NSError *parseError = nil;
50
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
51
NSLog(@"%@",responseDictionary);
52
dispatch_semaphore_signal(sema);
53
}
54
}];
55
[dataTask resume];
56
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('https://api.iapp.co.th/thai-national-id-card/v3/front');
5
$request->setMethod(HTTP_Request2::METHOD_POST);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
$request->setHeader(array(
10
'apikey' => '{Your API Key}'
11
));
12
$request->addUpload('file', 'APIs/Thai National ID Card OCR v3/id-card-front.jpg', 'id-card-front.jpg', '<Content-Type Header>');
13
try {
14
$response = $request->send();
15
if ($response->getStatus() == 200) {
16
echo $response->getBody();
17
}
18
else {
19
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
20
$response->getReasonPhrase();
21
}
22
}
23
catch(HTTP_Request2_Exception $e) {
24
echo 'Error: ' . $e->getMessage();
25
}
Copied!
1
import requests
2
3
url = "https://api.iapp.co.th/thai-national-id-card/v3/front"
4
5
payload={}
6
files=[
7
('file',('id-card-front.jpg',open('APIs/Thai National ID Card OCR v3/id-card-front.jpg','rb'),'image/jpeg'))
8
]
9
headers = {
10
'apikey': '{Your API Key}'
11
}
12
13
response = requests.request("POST", url, headers=headers, data=payload, files=files)
14
15
print(response.text)
Copied!

Use Options and fields parameter

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
1
curl --location --request POST 'https://api.iapp.co.th/thai-national-id-card/v3/front' \
2
--header 'apikey: {Your API Key}'\
3
--form '[email protected]"APIs/Thai National ID Card OCR v3/id-card-front.jpg"' \
4
--form 'fields="id_number"' \
5
--form 'options="fast,grey_check,id_check,spell_check"'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/thai-national-id-card/v3/front")
3
.header("apikey", "{Your API Key}")
4
.field("file", new File("APIs/Thai National ID Card OCR v3/id-card-front.jpg"))
5
.field("fields", "id_number")
6
.field("options", "fast,grey_check,id_check,spell_check")
7
.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/thai-national-id-card/v3/front',
6
'headers': {
7
'apikey': '{Your API Key}'
8
},
9
formData: {
10
'file': {
11
'value': fs.createReadStream('APIs/Thai National ID Card OCR v3/id-card-front.jpg'),
12
'options': {
13
'filename': 'id-card-front.jpg',
14
'contentType': null
15
}
16
},
17
'fields': 'id_number',
18
'options': 'fast,grey_check,id_check,spell_check'
19
}
20
};
21
request(options, function (error, response) {
22
if (error) throw new Error(error);
23
console.log(response.body);
24
});
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/thai-national-id-card/v3/front"]
6
cachePolicy:NSURLRequestUseProtocolCachePolicy
7
timeoutInterval:10.0];
8
9
NSDictionary *headers = @{
10
@"apikey": @"{Your API Key}"
11
};
12
13
NSArray *parameters = @[
14
@{ @"name": @"file", @"fileName": @"APIs/Thai National ID Card OCR v3/id-card-front.jpg" } ,
15
@{ @"name": @"fields", @"value": @"id_number" },
16
@{ @"name": @"options", @"value": @"fast,grey_check,id_check,spell_check" }
17
];
18
19
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
20
NSError *error;
21
NSMutableString *body = [NSMutableString string];
22
23
for (NSDictionary *param in parameters) {
24
[body appendFormat:@"--%@\r\n", boundary];
25
if (param[@"fileName"]) {
26
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
27
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
28
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
29
if (error) {
30
NSLog(@"%@", error);
31
}
32
} else {
33
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
34
[body appendFormat:@"%@", param[@"value"]];
35
}
36
}
37
[body appendFormat:@"\r\n--%@--\r\n", boundary];
38
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
39
[request setHTTPBody:postData];
40
41
[request setHTTPMethod:@"POST"];
42
43
NSURLSession *session = [NSURLSession sharedSession];
44
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
45
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
46
if (error) {
47
NSLog(@"%@", error);
48
dispatch_semaphore_signal(sema);
49
} else {
50
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
51
NSError *parseError = nil;
52
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
53
NSLog(@"%@",responseDictionary);
54
dispatch_semaphore_signal(sema);
55
}
56
}];
57
[dataTask resume];
58
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('https://api.iapp.co.th/thai-national-id-card/v3/front');
5
$request->setMethod(HTTP_Request2::METHOD_POST);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
10
$request->setHeader(array(
11
'apikey' => '{Your API Key}'
12
));
13
14
$request->addPostParameter(array(
15
'fields' => 'id_number',
16
'options' => 'fast,grey_check,id_check,spell_check'
17
));
18
$request->addUpload('file', 'APIs/Thai National ID Card OCR v3/id-card-front.jpg', 'id-card-front.jpg', '<Content-Type Header>');
19
try {
20
$response = $request->send();
21
if ($response->getStatus() == 200) {
22
echo $response->getBody();
23
}
24
else {
25
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
26
$response->getReasonPhrase();
27
}
28
}
29
catch(HTTP_Request2_Exception $e) {
30
echo 'Error: ' . $e->getMessage();
31
}
Copied!
1
import requests
2
url = "https://api.iapp.co.th/thai-national-id-card/v3/front"
3
payload = {
4
'fields': 'id_number',
5
'options': 'fast,grey_check,id_check,spell_check'
6
}
7
8
files = [
9
('file',('id-card-front.jpg',open('APIs/Thai National ID Card OCR v3/id-card-front.jpg','rb'),'image/jpeg'))
10
]
11
12
headers = {
13
'apikey': '{Your API Key}'
14
}
15
16
response = requests.request("POST", url, headers=headers, data=payload, files=files)
17
print(response.text)
Copied!

Optional Parameter

fields
options
fields
Description
address
Address on the ID Card
id_number
ID Number on the ID Card
th_name
Thai first name and Thai Surname on the ID Card
en_name
English first name and English Surname on the ID Card
en_fname
English first name on the ID Card
en_lname
English Surname on the ID Card
th_dob
Thai birthday on the ID Card
en_dob
English birthday on the ID Card
th_expire
Thai expire date on the ID Card
en_expire
English expire date on the ID Card
th_issue
Thai issue date on the ID Card
en_issue
English issue date on the ID Card
religion
Religion on the ID Card
Options
Description
fast
Tool for up speed to process in ID Card field
*May reduce the accuracy of ID Number
grey_check
Tool for check color of image
id_check
Tool for check correctness of ID Card Number
spell_check
Tool for check correctness of data in ID Card
*Please filled “grey_check”, ” id_check” , “ spell_check” If use “options” Parameter

Return Values

Name
Type
Description
address
String
Address on the ID card
detection_score
float
Detection score of a related field
district
String
District name on the ID card
en_dob
String
Date of birth, in English
en_expire
String
Date of expiry, in English
en_fname
String
English given name
en_init
String
Name title, in English
en_issue
String
Date of issue, in Thai
en_lname
String
English surname
en_name
String
English given name and surname
error_message
String
Error message
face
String
Base64 character string converted from the image. The size cannot exceed 10 MB.
gender
String
Gender
home_address
String
Home address on the ID card
id_number
String
National ID number
postal_code
String
Postal Code
process_time
String
Processing time (Sec.)
province
String
Province name on the ID card
religion
String
Religion on the ID card

Thai National ID Card Back Side

post
https://api.iapp.co.th
/thai-national-id-card/v3/back
Thai National ID Card Back Side

Sample Requests

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
1
curl --location --request POST 'https://api.iapp.co.th/thai-national-id-card/v3/back' \
2
--header 'apikey: {Your API Key}'\
3
--form '[email protected]"APIs/Thai National ID Card OCR v3/id-card-back.jpg"'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/thai-national-id-card/v3/back")
3
.header("apikey", "{Your API Key}")
4
.field("file", new File("APIs/Thai National ID Card OCR v3/id-card-back.jpg"))
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/thai-national-id-card/v3/back',
6
'headers': {
7
'apikey': '{Your API Key}'
8
},
9
formData: {
10
'file': {
11
'value': fs.createReadStream('APIs/Thai National ID Card OCR v3/id-card-back.jpg'),
12
'options': {
13
'filename': 'id-card-back.jpg',
14
'contentType': null
15
}
16
}
17
}
18
};
19
request(options, function (error, response) {
20
if (error) throw new Error(error);
21
console.log(response.body);
22
});
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/thai-national-id-card/v3/back"]
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": @"file", @"fileName": @"APIs/Thai National ID Card OCR v3/id-card-back.jpg" }
15
];
16
17
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
18
NSError *error;
19
NSMutableString *body = [NSMutableString string];
20
21
for (NSDictionary *param in parameters) {
22
[body appendFormat:@"--%@\r\n", boundary];
23
if (param[@"fileName"]) {
24
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
25
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
26
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
27
if (error) {
28
NSLog(@"%@", error);
29
}
30
} else {
31
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
32
[body appendFormat:@"%@", param[@"value"]];
33
}
34
}
35
[body appendFormat:@"\r\n--%@--\r\n", boundary];
36
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
37
[request setHTTPBody:postData];
38
39
[request setHTTPMethod:@"POST"];
40
41
NSURLSession *session = [NSURLSession sharedSession];
42
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
43
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
44
if (error) {
45
NSLog(@"%@", error);
46
dispatch_semaphore_signal(sema);
47
} else {
48
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
49
NSError *parseError = nil;
50
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
51
NSLog(@"%@",responseDictionary);
52
dispatch_semaphore_signal(sema);
53
}
54
}];
55
[dataTask resume];
56
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('https://api.iapp.co.th/thai-national-id-card/v3/back');
5
$request->setMethod(HTTP_Request2::METHOD_POST);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
$request->setHeader(array(
10
'apikey' => '{Your API Key}'
11
));
12
$request->addUpload('file', 'APIs/Thai National ID Card OCR v3/id-card-back.jpg', 'id-card-back.jpg', '<Content-Type Header>');
13
try {
14
$response = $request->send();
15
if ($response->getStatus() == 200) {
16
echo $response->getBody();
17
}
18
else {
19
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
20
$response->getReasonPhrase();
21
}
22
}
23
catch(HTTP_Request2_Exception $e) {
24
echo 'Error: ' . $e->getMessage();
25
}
Copied!
1
import requests
2
3
url = "https://api.iapp.co.th/thai-national-id-card/v3/back"
4
5
payload={}
6
files=[
7
('file',('id-card-back.jpg',open('APIs/Thai National ID Card OCR v3/id-card-back.jpg','rb'),'image/jpeg'))
8
]
9
headers = {
10
'apikey': '{Your API Key}'
11
}
12
13
response = requests.request("POST", url, headers=headers, data=payload, files=files)
14
15
print(response.text)
Copied!

Used Options and fields parameter

CURL
Java - Unirest
NodeJS - Request
Objective C
PHP
Python
1
curl --location --request POST 'https://api.iapp.co.th/thai-national-id-card/v3/back' \
2
--header 'apikey: {Your API Key}'\
3
--form '[email protected]"APIs/Thai National ID Card OCR v3/id-card-back.jpg"' \
4
--form 'options="fast,grey_check,id_check,spell_check"'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.post("https://api.iapp.co.th/thai-national-id-card/v3/back")
3
.header("apikey", "{Your API Key}")
4
.field("file", new File("APIs/Thai National ID Card OCR v3/id-card-back.jpg"))
5
.field("options", "fast,grey_check,id_check,spell_check")
6
.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/thai-national-id-card/v3/back',
6
'headers': {
7
'apikey': '{Your API Key}'
8
},
9
formData: {
10
'file': {
11
'value': fs.createReadStream('APIs/Thai National ID Card OCR v3/id-card-back.jpg'),
12
'options': {
13
'filename': 'id-card-back.jpg',
14
'contentType': null
15
}
16
},
17
'options': 'fast,grey_check,id_check,spell_check'
18
}
19
};
20
request(options, function (error, response) {
21
if (error) throw new Error(error);
22
console.log(response.body);
23
});
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/thai-national-id-card/v3/back"]
6
cachePolicy:NSURLRequestUseProtocolCachePolicy
7
timeoutInterval:10.0];
8
9
NSDictionary *headers = @{
10
@"apikey": @"{Your API Key}"
11
};
12
13
NSArray *parameters = @[
14
@{ @"name": @"file", @"fileName": @"APIs/Thai National ID Card OCR v3/id-card-back.jpg" } ,
15
@{ @"name": @"options", @"value": @"fast,grey_check,id_check,spell_check" }
16
];
17
18
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";
19
NSError *error;
20
NSMutableString *body = [NSMutableString string];
21
22
for (NSDictionary *param in parameters) {
23
[body appendFormat:@"--%@\r\n", boundary];
24
if (param[@"fileName"]) {
25
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
26
[body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
27
[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
28
if (error) {
29
NSLog(@"%@", error);
30
}
31
} else {
32
[body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
33
[body appendFormat:@"%@", param[@"value"]];
34
}
35
}
36
[body appendFormat:@"\r\n--%@--\r\n", boundary];
37
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];
38
[request setHTTPBody:postData];
39
40
[request setHTTPMethod:@"POST"];
41
42
NSURLSession *session = [NSURLSession sharedSession];
43
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
44
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
45
if (error) {
46
NSLog(@"%@", error);
47
dispatch_semaphore_signal(sema);
48
} else {
49
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
50
NSError *parseError = nil;
51
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
52
NSLog(@"%@",responseDictionary);
53
dispatch_semaphore_signal(sema);
54
}
55
}];
56
[dataTask resume];
57
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('https://api.iapp.co.th/thai-national-id-card/v3/back');
5
$request->setMethod(HTTP_Request2::METHOD_POST);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
10
$request->setHeader(array(
11
'apikey' => '{Your API Key}'
12
));
13
14
$request->addPostParameter(array(
15
'options' => 'fast,grey_check,id_check,spell_check'
16
));
17
$request->addUpload('file', 'APIs/Thai National ID Card OCR v3/id-card-back.jpg', 'id-card-back.jpg', '<Content-Type Header>');
18
try {
19
$response = $request->send();
20
if ($response->getStatus() == 200) {
21
echo $response->getBody();
22
}
23
else {
24
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
25
$response->getReasonPhrase();
26
}
27
}
28
catch(HTTP_Request2_Exception $e) {
29
echo 'Error: ' . $e->getMessage();
30
}
Copied!
1
import requests
2
url = "https://api.iapp.co.th/thai-national-id-card/v3/back"
3
payload = {
4
'options': 'fast,grey_check,id_check,spell_check'
5
}
6
7
files = [
8
('file',('id-card-back.jpg',open('APIs/Thai National ID Card OCR v3/id-card-back.jpg','rb'),'image/jpeg'))
9
]
10
11
headers = {
12
'apikey': '{Your API Key}'
13
}
14
15
response = requests.request("POST", url, headers=headers, data=payload, files=files)
16
print(response.text)
Copied!

Optional Parameter

Options
Description
fast
Tool for up speed to process in ID Card field
*May reduce the accuracy of ID Number
grey_check
Tool for check color of image
id_check
Tool for check correctness of ID Card Number
spell_check
Tool for check correctness of data in ID Card
*Please filled “grey_check”, ” id_check” , “ spell_check” If use “options” Parameter

Return Values

Name
Type
Description
back_number
String
Laser number
detection_score
Float
Detection score of a related field
process_time
Float
Processing time (Sec.)