API Reference
中文

Face Comparison API - Global

Face Comparison API Integration Guide

Overview

The face comparison API is utilized to determine whether the faces in two images are the same, providing a measure of similarity between them.

API Method

Base URL

API Endpoint

URLRequest MethodsContent-TypeOutput FormatCharacter Set
api-base-url?partner_code=xxx&partner_key=xxxPOSTapplication/jsonJSONUTF-8

Authentication Parameters

ParameterTypeDescriptionRequiredNotes
partner_codeStringPartner CodeRequiredAssigned by TD
partner_keyStringPartner KeyRequiredAssigned by TD

Request Parameters

ParameterTypeDescriptionRequiredNotes
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). In capital letters. Eg. "PH" for Philippines.

Response Parameters

ParameterTypeDescriptionNotes
resultStringPortrait comparison resultsEnumeration value: pass, fail. Pass: similarity greater than or equal to 75, which means the same person. Fail: similarity less than 75, which means different person.
similarityDoubleSimilarity percentage for portrait comparisonRange 0 to 100, can choose your own similarity threshold based on risk appetite

API Status Codes

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

Response Examples

Success Response

{
    "code": 200,
    "message": "success",
    "result": "pass",
    "sequence_id": "c7920f4a23264ed0a376f8647e14e34b",
    "similarity": 89.7134
}

Failure Response

{
    "code": 11304,
    "message": "The country partner located is not open",
    "sequence_id": "d2b38289a10f48d487ee7317260078c0"
}