API Reference
中文

Face Comparison API

The face comparison API is used to verify whether the user's photo information is consistent.

API Method

Base URL

API

URLRequest MethodsContent-TypeOutput FormatCharacter Set
api-base-url?partner_code=xxx&partner_key=xxxPOSTapplication/jsonJSONUTF-8
Authentication
ParameterTypeDescriptionRequired/OptionalNotes
partner_codeStringPartner CodeRequiredAssigned by TD
partner_keyStringPartner KeyRequiredAssigned by TD

Request

ParameterTypeDescriptionRequired/OptionalNotes
face_imageStringFace imageRequiredBase64 (NO WRAP) of face or selfie photo in JPG, JPEG or PNG format, within 3M
id_imageStringID card portrait page imageRequiredBase64 (NO WRAP) of ID photo in JPG, JPEG or PNG format, within 3M
countryStringCountryRequired2-digit ISO country code (ISO 3166 standard)

Response Parameter

ParameterTypeDescriptionNotes
resultStringPortrait comparison resultsEnumeration value: pass, fail
similarityDoubleSimilarity percentage for portrait comparison0~100, default ≥75 means the same person

API Status Code

CodeMessageCharged
200SuccessYES
12404Face has not been detectedYES
12405Image feature extraction processing failedNO
11301{parameter} emptyNO
11304The country partner located is not openNO
11340{parameter} errorNO
11350Internal errorNO
301Service not purchasedNO
302Service has been suspendNO
303Not enough balanceNO
304Service expiredNO
305Daily maximum volume reachedNO

Response Example

  • Success
{
"code": 200,
"result": "pass",
"sequence_id": "c7920f4a23264ed0a376f8647e14e34b",
"similarity": 89.7134
}
  • Failed
{
"code": 11304,
"message": "The country partner located is not open.",
"sequence_id": "d2b38289a10f48d487ee7317260078c0"
}