Skip to content

Indonesia Card Anti-fake

Use the deep learning algorithm to detect whether the face in the certificate is PS, whether the certificate is a printed certificate, replayAttackd certificate, and the blur of the certificate,the illumination of the certificate

Code example:

curl --location --request POST 'https://api.ekycpro.com/v1/id_card/antifake' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'X-API-Key: AbcdEfgh' \
--data-urlencode 'img=BASE64_ENCODE_VALUE'

Response for the input face is ps

{
"status": "OK",
"message": {
"blur": {
"isBlur": "no",
"score": 0
},
"ps": {
"isPs": "yes",
"score": 95
},
"print": {
"isPrint": "no",
"score": 1
},
"replayAttack": {
"isReplayAttack": "no",
"score": 10
}
}
}

Response for the input card face is not ps

{
"status": "OK",
"message": {
"blur": {
"isBlur": "no",
"score": 0
},
"ps": {
"isPs": "no",
"score": 8
},
"print": {
"isPrint": "no",
"score": 1
},
"replayAttack": {
"isReplayAttack": "no",
"score": 10
}
}
}

Response for the input card is blur image

{
"status": "OK",
"message": {
"blur": {
"isBlur": "yes",
"score": 61
},
"ps": {
"isPs": "no",
"score": 8
},
"print": {
"isPrint": "no",
"score": 1
},
"replayAttack": {
"isReplayAttack": "no",
"score": 10
}
}
}

Response for the input card is print image in black and white

{
"status": "OK",
"message": {
"blur": {
"isBlur": "no",
"score": 1
},
"ps": {
"isPs": "no",
"score": 8
},
"print": {
"isPrint": "yes",
"score": 100
},
"replayAttack": {
"isReplayAttack": "no",
"score": 10
}
}
}

Response for the input card is replayAttackd image

{
"status": "OK",
"message": {
"blur": {
"isBlur": "no",
"score": 1
},
"ps": {
"isPs": "no",
"score": 8
},
"print": {
"isPrint": "no",
"score": 0
},
"replayAttack": {
"isReplayAttack": "no",
"score": 10
}
}
}

Response for the input card is too dark or too bright

{
"status": "OK",
"message": {
"blur": {
"isBlur": "no",
"score": 1
},
"ps": {
"isPs": "no",
"score": 8
},
"print": {
"isPrint": "no",
"score": 0
},
"replayAttack": {
"isReplayAttack": "no",
"score": 10
}
}
}

Response for recognition fail

{
"status": "FAIL",
"message": "check input image and retry"
}

Response for invalid request parameters

{
"status": "INVALID_REQUEST",
"message": "check request params"
}

Response for invalid image format

{
"status": "IMAGE_INVALID_FORMAT",
"message": "image format not support"
}

Response for image size larger than 2M

{
"status": "IMAGE_INVALID_SIZE",
"message": "image larger than 2M"
}

Response for server error

{
"status": "INNER_ERROR",
"message": "Inner error, please retry later"
}

HTTP request

POST https://api.ekycpro.com/v1/id_card/antifake

Request parameters

parameterdescription
imgstring, base64 encoded image. It is recommended that the image be less than 200KB, so it will be returned within 2 seconds, otherwise the return time will be longer.

Response format

The scores below are reference values. It is recommended to adjust the scores in actual use.

fieldsdescription
isPsyes face is ps, no face is not ps
ps scorethis is the confidence level of the ps face, the range is [0, 100]. The default is greater than 80 points is ps face
isBluryes is blur, no is not blur
blur scorethis is the confidence level of the blur card, the range is [0, 100]. The default is greater than 30 points is blur card
isPrintyes is print image in black and white, no is not print image
print scorethis is the confidence level of the print image, the range is [0, 100]. The default is greater than 70 points is print image
isReplayAttackyes is a replayAttackd image, no is not replayAttackd image
replayAttack scorethis is the confidence level of the replayAttack image,the range is [0, 100]. The default is greater than 60 points is replayAttackd image

Status code

statusdescription
OKcharge, success
FAILcharge, image recognition error, please check input image
INVALID_REQUESTfree, invalid request parameters
IMAGE_INVALID_FORMATfree, invalid image format, image format should be one of jpeg/jpg/png/bmp
IMAGE_INVALID_SIZEfree, invalid image size, should be less than 2M
INNER_ERRORfree, server error