Skip to main content

Find Face API

API Description

Objective

The Find Face API identifies whether a target face exists in a group image and returns data about the closest match.

InputOutput
Target face image and group image containing multiple facesMatch status, similarity score, and face crop of the closest match

API URL

https://ind-faceid.hyperverge.co/v1/photo/findFace

API Endpoint

findFace

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The requests are in form-data format and responses are in JSON format.

Authentication

You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalDescriptionValid Values
content-typeMandatoryThis parameter defines the media type for the request payloadmultipart/form-data
appIdMandatoryThe application ID shared by HyperVergeNot Applicable - this is a unique value
appKeyMandatoryThe application key shared by HyperVergeNot Applicable - this is a unique value
transactionIdOptionalThe unique ID for the customer journeyNot Applicable

Inputs

The following table provides the details of the parameters required for the API's request body:

ParameterMandatory or OptionalDescriptionAllowed ValuesDefault Value
imageMandatoryThe target face image to search forJPEG,PNG, or TIFF formatNot Applicable
groupimageMandatoryThe group image containing multiple facesJPEG, PNG, or TIFF formatNot Applicable
typeOptionalThe type of target imageid or selfieid

Optional Parmaters

The following are optional parameters that can be set as part of the request body:

ParameterAPI Body / HeaderValueDefaultDescription
referenceIdHeaderStringnullreferenceId is an identifier for the API call and is echoed back by the server in the response. This referenceId can be used to create logical grouping of single/multiple API calls based on business logic of the consumer of API. HyperVerge's QC dashboard can be used to fetch logs grouped by the Reference ID.
uuidHeaderStringnullThis is an advanced feature designed to prevent tampering of response by a man in the middle. If uuid is set, the response will include an X-Response-Signature header which will have a checksum of the response body signed with the uuid and a private key.
enableDashboardBody"yes"/"no""no"This will give access to an exclusive dashboard built by HyperVerge for Quality Check and debugging purpose.

Request

The following code snippet demonstrates a standard curl request for the API:

curl --location --request POST 'https://ind-faceid.hyperverge.co/v1/photo/findFace' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'image=@"<path_to_target_image>"' \
--form 'groupimage=@"<path_to_group_image>"' \
--form 'type="<Enter_type_of_target_image>"'

Success Responses

The following code snippets demonstrate success responses from the API:

{
"status": "success",
"statusCode": "200",
"result": {
"match-score": 88,
"face-found": "yes/no",
"to-be-reviewed": "yes/no",
"matching-face-crop": "<Base64_image_of_the_closest_matching_face_crop>"
}
}

Success Response Details

The following table outlines the details of the success response from the API:

ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code of the response
match-scoreintegerThe similarity score between the target face and the closest match in the group image. It is a number between 0 to 100
face-foundstringIndicates whether a match was found above the threshold. Returns 'yes' if the match score is greater than or equal to the determined threshold, and 'no' otherwise
to-be-reviewedstringIndicates whether the match needs manual verification. Returns 'yes' if manual review is required, and 'no' otherwise
matching-face-cropstringThe base64 encoded image of the closest matching face from the group image

Error Responses

The following are some error responses from the API:

{
"status": "failure",
"statusCode": "400",
"error": "Face not detected in image",
"errorCode": "E1033I"
}
{
"status": "failure",
"statusCode": "429",
"error": "Rate limit exceeded"
}

Error Response Details

An error response from the API contains a failure status, with a relevant status code and error message. The following table lists all error responses:

Status CodeError MessageError Description
400Face not detected in imageThe face could not be detected in the individual's image by the AI model
400Face not detected in group imageNo face could be detected in the group image by the AI model
400image size cannot be greater than 6MBThe maximum size of input image is 6MB. Crossing this will result in this error
422FACENOTDETECTEDThe face could not be detected in either the target image or the group image. Please ensure both images contain valid faces
429Rate limit exceededThis error occurs when you have exceeded the configured rate limit for transactions per minute
433BADFACESIZEThe target face image resolution is less than 200x200 pixels. Please use a higher resolution image
500Internal Server ErrorAn internal server error occurred. Please contact the HyperVerge team for resolution
503DEPENDENCY SERVER BUSYThe server is currently overloaded. Please try again later
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: