Search

This method helps you search face from enrolled images.

🎈Endpoint

🎈Request

Headers

KeyTypeNotesDescription
App-IDStringRequiredApplication ID that generated from Application Menu in Verihubs Client Dashboard.
To hit in Testing and Live mode you need a Production Application ID.
API-KeyStringRequiredAPI-Key that generated from Application Menu in Verihubs Client Dashboard that related to specific Application ID.

You can generate your Application ID and API-Key in the Application page in Verihubs Client Dashboard..

Body Parameters

ParameterTypeNotesDefaultDescription
imageStringRequired-- A base64 or URL image file. - Image Type JPEG, JPG, PNG - Max File size: 5MB - Recommended image ratio 4:3 - If the photo is not a face image, it will return “face not detected”.
limitnumberoptional1- Number indicating search limit (1 to 10).
- If the search results match greater than (>) limit images, then the results returned are only the top n with the highest similarity value.
- If the search result match less than (<) limit images, then all existing results will be returned.
- Determining whether two images match or not will depend on the given threshold.
return_imagebooleanoptionalfalse- A flag to return base64 image in matches
- If return_image set to false, matches subject_id and the similarity status will be returned.
- If return_image set to true, matches subject_id, the similarity status, as well as the base64 image will be returned.
thresholdnumberoptional 82A number indicating threshold for confidence (0 to 100).
The threshold is used to determine whether two images match or not.
is_qualitybooleanoptionaltrueDetermines whether Image Quality (blur and dark) will be computed and return as result
is_attributebooleanoptionaltrueDetermines whether Image Attribute (sunglasses, mask, veil, hat) will be detected and return as result
is_livenessbooleanoptionaltrueDetermines whether Passive Liveness will be computed and return as result
validate_qualitybooleanoptionalfalse- Determines whether Quality validation will be executed. - The validation consists of checking blur and dark - validate_quality can be TRUE only when is_quality is TRUE.
validate_attributebooleanoptionalfalse- Determines whether Attribute validation will be executed. - The validation consists of checking whether sunglasses or mask is detected in the input image. - validate_attribute can be TRUE only when is_attribute is TRUE.
validate_livenessbooleanoptionalfalse- Determines whether Liveness validation will be executed. - The validation checks whether input image is live / spoof. - validate_liveness can be TRUE only when is_liveness is TRUE.
validate_nfacebooleanoptionalfalse- Determines whether the number of faces validation will be executed. - The validation checks whether the input image consists of more than one face.

🎈Responses

Response Code

CodeDescription
200Successful Response
400Bad Request
401Unauthorized
500Internal Server Error

Details for 200 and 201

KeyTypeDescription
messagestringMessage that describe the overall response.
status_codestringStatus that indicate the billing calculation. See status code list in this link.
image_qualityobjectDescribes image quality detail, consist of blur and dark
blurbooleanDescribes whether input image is considered as blur (If it exceeds the threshold, it will detected as blur)
darkbooleanDescribes whether input image is considered as dark (If it exceeds the threshold, it will detected as dark)
attributesobjectDescribes image attributes detail
sunglasses_onbooleanDescribes whether sunglasses is detected on input image
mask_onbooleanDescribes whether mask is detected on input image
veil_onbooleanDescribes whether veil is detected on input image
hat_onbooleanDescribes whether hat is detected on input image
livenessobjectDescribes liveness detail
statusbooleanDescribes whether the input image is considered as real or spoof
probabilitystringDescribes the liveness score (0 or 100)
rotationintegerShows rotation degrees need to be done to detect face in image
bounding_boxobjectShows result of bounding box
TopLeftXstring
TopLeftYstring
BottomRightXstring
BottomRightYstring
Widthstring
Heightstring
face_landmarkobjectShows result of face landmark
LeftEyeXstring
LeftEyeYstring
RightEyeXstring
RightEyeYstring
NoseXstring
NoseYstring
MouthLeftXstring
MouthLeftYstring
MouthRightXstring
MouthRightYstring
nfaceintegerShows how many faces are detected in the input image.
timestampnumberShows time when the process is successfully done
matchesarray of objectsShow similar face matches as limit
subject_idstringShows respected subject_id of similar matches
similaritynumberShows result of confidence
imagestringShows respected image of similar matches in base64 format

Error Code

Response CodeError MessageDescription
400INVALID_PAYLOADno value in payload or empty string more than 1
400INVALID_PAYLOAD_IMAGE_MISSINGinvalid payload image not a standard b64/url or image empty string
400INVALID_PAYLOAD_IMAGE_SIZEinvalid payload image size too large
400MISSING_PAYLOAD_IMAGEmissing payload image
400INVALID_PAYLOAD_IMAGE_TIMEOUTtimeout getting image from url in 15 seconds
400INVALID_PAYLOAD_THRESHOLDthreshold cannot lower than 0 or more than 100
400INVALID_PAYLOAD_LIMITlimit cannot lower than 1 or more than 10
400FACE_NOT_DETECTEDface not detected from image
400INVALID_PAYLOAD_QUALITY_VALIDATION_DEPENDENCYis_quality must be true if validate_quality true
400INVALID_PAYLOAD_ATTRIBUTE_VALIDATION_DEPENDENCYis_attribute must be true if validate_attribute true
400INVALID_PAYLOAD_LIVENESS_VALIDATION_DEPENDENCYis_liveness must be true if validate_liveness true
200FAIL_ON_1fail on liveness
200FAIL_ON_2fail on attribute
200FAIL_ON_3fail on liveness and attribute
200FAIL_ON_4fail on quality
200FAIL_ON_5fail on liveness and quality
200FAIL_ON_6fail on attribute and quality
200FAIL_ON_7fail on liveness, attribute, and quality
200FAIL_ON_8fail on number of face (nface)
200FAIL_ON_9fail on number of face (nface) and liveness
200FAIL_ON_10fail on number of face (nface) and attribute
200FAIL_ON_11fail on number of face (nface), attribute, and liveness
200FAIL_ON_12fail on number of face (nface) and quality
200FAIL_ON_13fail on number of face (nface), quality, and liveness
200FAIL_ON_14fail on number of face (nface), quality, and attribute
200FAIL_ON_15fail on number of face (nface), quality, attribute, and liveness
403INSUFFICIENT_QUOTA_SEARCHusage reach it quota limit for search (only appears on testing mode)
403INSUFFICIENT_QUOTA_LIVENESSusage reach it quota limit for liveness (only appears on testing mode)
500INTERNAL_SERVER_ERRORinternal server error

Sample Responses

Response CodeResponseDescription
200{
"message": "Request Success",
"session_id": "d469c0f8-ecb2-416b-8cdb-28a962a44778",
"timestamp": 1660185524.239292,
"status_code": "FACE-201",
"matches": [
{
"subject_id": "d88dfa96-4773-405a-ad3e-2cc78c68744c",
"similarity": 88.72248459764083,
},
{
"subject_id": "fd3942ba-fd67-4680-af43-05db546061d8",
"similarity": 88.01798647665044,
}
],
"bounding_box": {
"TopLeftX": "512.7863159179688",
"TopLeftY": "211.16729736328125",
"BottomRightX": "773.9642944335938",
"BottomRightY": "564.0575561523438",
"Width": "261.177978515625",
"Height": "352.8902587890625"
},
"face_landmark": {
"LeftEyeX": "582.6261596679688",
"LeftEyeY": "348.43548583984375",
"RightEyeX": "706.4561767578125",
"RightEyeY": "345.0014953613281",
"NoseX": "644.9620361328125",
"NoseY": "408.7439880371094",
"MouthLeftX": "600.63330078125",
"MouthLeftY": "488.4865417480469",
"MouthRightX": "689.9041748046875",
"MouthRightY": "485.948486328125"
},
"rotation": 1,
"nface": 1,
}
Request data parameter is valid
400{
"message": "Invalid Payload",
"data": {
"message": "Syntax error"
}
}
Invalid Payload. Transaction that is considered failed due to validation errors, an error_field will appear explaining the error.
400{
"message": "Face not detected in image",
"error_code": "FACE_NOT_DETECTED"
}
Request image is invalid (not a face image).
401{
"message": "Authorization failed"
}
Authorization Failed; Transaction that unauthorized due to Application ID or API-Key issue. To hit in Testing and Live mode you need a Production Application ID and API-Key.
403{
"message": "Insufficient search quota",
"error_code": "INSUFFICIENT_QUOTA_SEARCH"
}
The transaction is in Testing mode and not enough remaining quota. Please contact Verihubs Customer Support.
500{
"message": "Internal server error"
}
Internal server error.