IDcard Fraud Detection
API Documentation for IDcard Fraud Detection
Description
The ID-card fraud detection API is able to detect anomaly physical thai ID card documents. There are several detectable fraud aspects.
- Forgery
- Copy
- Screen capture
- Unmatched barcode and ID-code
- Date of Expiry
- ID No. pattern
- Redline detection
Response Schema
Key | Type | Description |
---|---|---|
status | str | The fraud detection processing status. "success or error " |
error | list[Dict of error details] | Error details during processing fraud detection. |
Data | list[Data] | IDcard Fraud Detection results. |
Data Schema
Key | Type | Description |
---|---|---|
is_overall_fraud | bool | The overall detection results. Ether fraud aspect detected. The overall classified as fraud |
confidence | float | The confidence of overall fraud detection |
fraud_details | list[Fraud-Object] | Fraud detection details. |
Fraud Object
Key | Type | Description |
---|---|---|
detail | str | Fraud detection detail |
is_fraud | bool | Fraud detection result. |
confidence | float | Confidence value. |
Response Definition
HTTP Status | Code | Message | Description |
---|---|---|---|
success | 200 | success | IDcard Fraud Detection API works successfully. |
Bad Request | 400 | Bad Request | Not a valid base64 image request (must be .jpg, .jpeg, .png, .pdf) or invalid size, request schema. The api can not retrieve information on any image. |
Unprocessable Content | 422 | Unprocessable Content | The request body is not valid. |
Request Body too large | 413 | Request entity too large | The request image base64 size is larger than the specified image size. |
Error | 500 | Internal server error | There is some error in the internal servers. |
Requests IDcard Fraud Detection.
POST https://apis.aigen.online/aiscript/idcard-fraudcheck/v2
Requests Body
Name | Type | Description |
---|---|---|
image* | String | Base64 image encoded string |
API Response Examples.
- 200: OK Success
- 400: Bad Request Bad Request
- 500: Internal Server Error Internal Server Error
View Response
{"status": "success",
"error": [],
"data": {"is_overall_fraud": false,
"confidence": 0.8339,
"fraud_detail": {
"card_detector": {"is_fraud": false,
"detail": "The card localize model classify as GENUIEN",
"confidence": 0.9613},
"barcode": {"is_fraud": null,
"detail": "Cannot read barcode by input image. High quality image is required.",
"confidence": 0.8467},
"pattern_verification": {"is_fraud": false,
"datail": "The ID pattern is corresponding to DOPA",
"confidence": 1.0},
"expiry_date_verification": {"is_fraud": null,
"datail": "The ID card has expired and is no longer valid.",
"confidence": 0.0},
"classification": {"is_fraud": false,
"detail": "The classification model detecting input as GENUIEN",
"confidence": 1.0},
"classification_entired_image": {"is_fraud": false,
"detail": "The classification model detecting input as GENUIEN",
"confidence": 1.0},
"face_forgery_classification": {"is_fraud": false,
"detail": "The classification model detecting input as GENUIEN",
"confidence": 1.0},
"red_line_detection": {"is_fraud": false,
"detail": "Red-line is detected",
"confidence": 0.8632}
}
}
}
{
"request_id": "",
"error": [
{ "object": "error", "code": "bad_request", "message": "Bad Request" }
],
"data": [{}],
"status": "error"
}
{
"request_id": "",
"error": [
{
"object": "error",
"code": "internal_server_error",
"message": "Page 1 : Internal Server Error"
}
],
"data": [{}],
"status": "error"
}
API Request Examples.
- Python
- Javascript
- PHP
- CURL
import requests
api = "https://apis.aigen.online/aiscript/idcard-fraudcheck/v2"
headers = {"x-aigen-key": "<key>"}
data = {"image": "<base64_string>"} #optional
res = requests.post(api, json=data, headers=headers)
print(res.json())
const axios = require("axios");
const api = "https://apis.aigen.online/aiscript/idcard-fraudcheck/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/idcard-fraudcheck/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/idcard-fraudcheck/v2' \
--header 'X-AIGEN-KEY: <aigen-key>' \
--header 'Content-Type: application/json' \
--data '{
"image": "<base64_string>"
}'