Skip to content

Liveness Detection

There are 2 steps for Liveness Detection Service.

1 Integrate the SDK

For Android

2 Liveness Detection V1

Code Sample:

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

Example of Success Response:

{
"status": "OK",
"message": {
"live_score": 100
}
}

Example of success response (detail = 1):

{
"status": "OK",
"message": {
"is_liveness": true,
"live_score": 100,
"reason": "success"
}
}

Example of multiple faces (detail = 1):

{
"status": "OK",
"message": {
"is_liveness": false,
"live_score": 0,
"reason": "multiple faces"
}
}

Example of no liveness face (detail = 1):

{
"status": "OK",
"message": {
"is_liveness": false,
"live_score": 0,
"reason": "no liveness face"
}
}

Example of eyes closed (detail = 1):

{
"status": "OK",
"message": {
"is_liveness": false,
"live_score": 0,
"reason": "eyes closed"
}
}

Example of age dissatisfaction (detail = 1):

{
"status": "OK",
"message": {
"is_liveness": false,
"live_score": 0,
"reason": "age dissatisfaction"
}
}

Example of image error Response:

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

Example of request parameter error Response:

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

Example of image format error Response:

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

Example of image larger than 2M error Response:

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

Example of server error Response:

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

Request Url

POST https://api.ekycpro.com/v1/picturelive

Request Parameters:

ParameterDescription
imgstring, Base64 encoded image, the picture from the live video
countrystring, Country abbreviation. Mexico: MX, India: IN, Thailand:TH , Indonesia:ID
detailoptional,string, when detail=1 return the no pass reason.

Defautl Response Description:

ParameterDescription
statusstatus code
messagelive_score:Liveness Detection Score[0-100]

Detail Response Description

parameterdescription
statusstatus code
messageis_liveness:whether the liveness detection passed
live_score:liveness score [0-100]
reason:success、eyes closed、no liveness face、face incomplete、face dark、face blur、no face detected、multiple faces

Status Code:

StatusMessage
OKcharge,Recognize success
FAILcharge,Image error
INVALID_REQUESTfree,Wrong request parameter
IMAGE_INVALID_FORMATfree,Image format is not supported, only PNG, JPG, JPEG, BMP are supported
IMAGE_INVALID_SIZEfree,The image size should be less than 2M after base64 encoding
INNER_ERRORfree,System error