Skip to content

Face Comparison

Analyze the possibility of two faces belong to the same person. Using our face matching technology, you will get our judgment about whether it is the same person as well as a similarity score.

Code example:

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

Response example for same person

{
"status": "OK",
"message": {
"similarity": 97.501,
"result": "SAME PERSON"
}
}

Response example for not the same person

{
"status": "OK",
"message": {
"similarity": 27.501,
"result": "NOT SAME PERSON"
}
}

Response example for not sure

{
"status": "OK",
"message": {
"similarity": 50.501,
"result": "NOT SURE"
}
}

Response example for error request

{
"status": "INVALID_REQUEST",
"message": "error message"
}

Response example for uploaded image larger than 2M

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

Response example can not detect face

{
"status": "RETRY_LATER",
"message": "image detect face fail"
}

Response for server error

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

HTTP request

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

Request parameters

parameterdescription
img1string, first image in base64 encoded format
img2string, second image in base64 encoded format

Response format

fieldsdescription
statusstatus code
messagesimilarity: similarity score, 0~100
result: judgment

Status code

statusdescription
OKcharge, success, message.similarity contains the similarity score
RETRY_LATERcharge, image detect face failed
INVALID_REQUESTfree, invalid request parameters
IMAGE_INVALID_SIZEfree, image size larger than 2M
INNER_ERRORfree, server error

Judgment description

The scores below are reference values. To improve the acceptance rate of blurry images in actual use, it is recommended to adjust the scores appropriately.

Judgement ResultDescription
SAME PERSONScore >= 65 and <= 100, indicating that the two images belong to the same person.
NOT SUREScore >= 45 and < 65, indicating that the judgement cannot be made with certainty.
NOT SAME PERSONScore >= 0 and < 45, indicating that the two images belong to different people.