Face Match API

MATCH FACES FROM PHOTOS AND DOCUMENTS TO ESTABLISH IDENTITY

Description

Attestr’s Face Match API offers a reliable and precise solution for identity verification by using facial recognition to match a user’s face with stored images or profiles. The API works by analyzing key facial features such as the distance between eyes, nose shape, and overall face structure, ensuring high accuracy even in varying lighting or angles. It can be integrated seamlessly into mobile apps, websites, and security systems to verify identities in real-time. Whether for user authentication during login, payment validation, or reducing fraud, Attestr's Face Match API is designed to offer a simple, scalable, and secure method for verifying users quickly.

API Details

Request

TypeURLCurrent API Version
Posthttps://api.attestr.com/api/{version}/public/facex/matchv2

Request Body Parameters

TypeNameDescriptionOptional (Default)Min VersionMax Version
StringsrcInput source face image media Id, typically a selfie or the user photo. To upload the file and generate media Id, refer to Image Media UploadRequiredv2
StringtargetFrontInput image media Id of the front side of the document. To generate a media Id, refer to Image Media UploadRequiredv2
StringtargetBackOptional. Media Id for the back side image of the document.Optionalv2
StringtypeDocument type. Following values are permitted. UIDAI - For Aadhaar document DL - For Driver's License document PAN - For PAN document VOTER - For Voter Card document PASSPORT - For Passports GOV - Generic for any ID documentsRequiredv2
NumberthresholdA match threshold value between 1 and 100 must be set. This value determines whether the match is valid or invalid based on the percentage of similarity detected when comparing the source and target images.Requiredv2

Request Header Parameters

TypeNameValue / DescriptionOptional (Default)Min VersionMax Version
StringContent-Typeapplication/jsonRequiredv2
StringAuthorizationBasic {authToken}Requiredv2

If you do not have the authentication token, please refer to Register App to generate one.

Sample Request

JSON
Copy

Response

Http Status Code 200

Please note that the valid key decides the availability of rest of the keys in the response. If provided PAN image is invalid or low quality, then all keys except valid and message are omitted. If true, remaining keys will have appropriate data.

KeyDescriptionTypeMin VersionMax Version
validTrue | false if a valid match is found in the target front or the target back imageBooleanv2
status

Status indicating the outcome. Possible values are - FACE_MATCHED

FACE_NOT_MATCHED

Stringv2
messageMessage string populated for non matching casesStringv2
srcValidTrue if a face is detected in the source image else falseBooleanv2
targetFrontValidTrue if a face is detected in the target front image else falseBooleanv2
targetBackValidTrue if a face is detected in the target back image else falseBooleanv2
srcHeightHeight of the bounding box containing the face in the source image. See bounding box definition below.Numberv2
srcWidthWidth of the bounding box containing the face in the source image. See bounding box definition below.Numberv2
srcLeftX co-ordinate of the position of top left corner of the bounding box containing the face in the source image. See bounding box definition below.Numberv2
srcTopY co-ordinate of the position of top left corner of the bounding box containing the face in the source image. See bounding box definition below.Numberv2
srcConfidenceConfidence percentage if a face is detected in the source image.Numberv2
targetFrontHeightHeight of the bounding box containing the face in the target front image. See bounding box definition below.Numberv2
targetFrontWidthWidth of the bounding box containing the face in the target front image. See bounding box definition below.Numberv2
targetFrontLeftX co-ordinate of the position of top left corner of the bounding box containing the face in the target front image. See bounding box definition below.Numberv2
targetFrontTopY co-ordinate of the position of top left corner of the bounding box containing the face in the target front image. See bounding box definition below.Numberv2
targetFrontConfidenceConfidence percentage if a face is detected in the target front image.Numberv2
targetFrontMatchMatch ratio if a match is found after comparing source and target front image. This is populated only if the match ratio is higher than the threshold specified in the input.Numberv2
targetBackHeightHeight of the bounding box containing the face in the target back image. See bounding box definition below.Numberv2
targetBackWidthWidth of the bounding box containing the face in the target back image. See bounding box definition below.Numberv2
targetBackLeftX co-ordinate of the position of top left corner of the bounding box containing the face in the target back image. See bounding box definition below.Numberv2
targetBackTopY co-ordinate of the position of top left corner of the bounding box containing the face in the target back image. See bounding box definition below.Numberv2
targetBackConfidenceConfidence percentage if a face is detected in the target back image.Numberv2
targetBackMatchMatch ratio if a match is found after comparing source and target back image. This is populated only if the match ratio is higher than the threshold specified in the input.Numberv2

Bounding Box

A bounding box around a face in an image is a rectangular frame used to identify the region containing the face. It is defined by four key attributes:

  1. Left: The x-coordinate of the left edge of the bounding box, indicating how far it is from the image’s left side.
  2. Top: The y-coordinate of the top edge of the bounding box, showing how far it is from the top of the image.
  3. Height: The vertical size of the bounding box, representing the distance between the top and bottom edges, which indicates the face's height in the image.
  4. Width: The horizontal size of the bounding box, measuring the distance between the left and right edges, which defines the face's width in the image.

These four attributes (left, top, height, and width) together pinpoint the exact area where the face is located in the image.

Sample Response

Sample response if a valid match is found either in the front image or the back image.

JSON
Copy

Sample response for invalid document image

JSON
Copy

Sample response if an unsupported document media is passed in the input. Only images are supported.

JSON
Copy

Error Response

ParameterTypeDescription
codeNumberUnique error codes for different errors. Always available.
messageStringError message describing the error. Always Available.
detailsStringDetail error message. Available only for certain types of errors.

Error Codes

HTTP StatusError CodeError Message
4004001Malformed data or missing required parameter values
4004005Operation could not be performed due to low credits balance
4014016Invalid client authorization
4034031Unauthorized access
4034035Requested service is not provisioned for your account
4034039Client's IP address is not whitelisted
4034035Requested service is not provisioned for your account
4294291Maximum account rate limit exceeded
4294292Maximum API rate limit exceeded
4294293Maximum account daily limit exceeded
4294294Maximum API daily limit exceeded
5005001Request could not be processed

Sample Error Response

JSON
Copy

Constraints

  • Only JPEG, PNG images are supported.
  • Minimum image size is 200x200 png for better identification and parsing.
  • Maximum allowed image size is 10 MB.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Face Match APIFacial Recognition APIReal-time Face AuthenticationFace Recognition for LoginImage Comparison APIAI Face Matching TechnologyFace Detection and MatchingFace Authentication SolutionSeamless Face Recognition IntegrationReal-time Face Identity Verification