---
title: Face Match API
slug: v2-apis/face-match-api
description: Learn about the Face Match API, a powerful tool for comparing images and verifying if they depict the same individual. Discover how to leverage this API, which supports image uploads and URL inputs. Find recommendations for an optimal threshold value and 
createdAt: 2022-09-15T06:50:56.000Z
---

## Face Match

You will need to **[login](https://docs.signzy.com/sandboxapis)** before sending request. You are required to pass the access token received from the login call, as authorization header in the Face Match request along with essentials.

Face match API is used to ensure that two images belong to same person/individual. In this we need to either upload two images or give URLs of two images to match ,as input to the API.

You can also provide a optional threshold value between 0.05-0.95 to decide which match is False or True. If match percentage is greater than or equal to threshold then True otherwise False.

## Recommended Threshold value for Face Match API

Highlighted part of table shows the threshold at which Precision is high and recall is acceptably low. we recommend to use this threshold (ie. **40**) for best user experience. The **optimum range of threshold should lie between 35-40**. Higher thresholds might increase the precision in the results but decrease the recall i.e. pass rate will decrease.

The below table can help make a decision on the acceptance rate.

![](https://api.archbee.com/api/optimize/w0YdjmC6Uxu0AJ6sPj9OT/k7XwYV12nkomh78Cggp1j_screenshot-289.png)

![](https://api.archbee.com/api/optimize/w0YdjmC6Uxu0AJ6sPj9OT/5hxjiOTXfSY2GTRyZq5dC_image-20220726-191127.png)

1. Precision Rate: Measures ability of the system to classify correctly out of the total successfully classified.
2. Recall: Measures ability of the system to classify the input data.
3. F1 Score: This is the Geometric mean of the Precision rate and Recall rate.

You can also align the image horizontally before face match by setting the value of align Horizontally parameter to 'yes', by default it is 'no'. This is an optional parameter. This operation may increase the response time of the API and will be additionally charged. To use this feature please make sure you have access to reorient API.

It compares two images and gives the ratio of matching between them and match Percentage between them.

In response, it gives three things as mentioned below

1. Verified true or false.
2. A message that says whether the verification completed with positive result or negative result.
3. A match Percentage to signify the percentage of match between the two given images.

Supported file formats are jpeg, jpg, png only.

***

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": " https://preproduction.signzy.tech/api/v2/snoops.com",
  "name": "Face Match",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "Authorization",
        "type": "string",
        "children": [],
        "description": "Contains the id parameter returned from the login step"
      },
      {
        "kind": "required",
        "name": "Content-Type",
        "type": "string",
        "children": [],
        "description": "application/json"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID of the cake to get"
      },
      {
        "kind": "required",
        "name": "essentials",
        "type": "Object",
        "children": [
          {
            "kind": "required",
            "name": "essentials.firstImage",
            "type": "string",
            "description": "url of first image"
          },
          {
            "kind": "required",
            "name": "essentials.secondImage",
            "type": "string",
            "description": "url of second image"
          },
          {
            "kind": "optional",
            "name": "essentials.threshold",
            "type": "string",
            "description": "Contains the threshold value between 0.05 to 0.9"
          },
          {
            "kind": "optional",
            "name": "essentials.alignHorizontally",
            "type": "string",
            "description": "It tells about allignment value need to be pased is yes/no"
          }
        ],
        "description": "Contains all the necessary and optional parameters inside it."
      },
      {
        "kind": "required",
        "name": "result.verified",
        "type": "string",
        "children": [],
        "description": "verified 'true' or 'false"
      },
      {
        "kind": "required",
        "name": "result.message",
        "type": "string",
        "children": [],
        "description": "Displays output message"
      },
      {
        "kind": "required",
        "name": "result.matchPercentage",
        "type": "string",
        "children": [],
        "description": "percentage of match between two images"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "eUWEXJcgoVvXWc2wqYSBi",
        "code": "{\n           \"essentials\": {\n             \"firstImage\": \".....first image URL....\",\n             \"secondImage\": \".....Second image URL....\"\n           },\n           \"id\": \"......id.....\",\n           \"patronId\": \"..patronID....\",\n           \"result\": {\n             \"verified\": \"...verified 'true' or 'false'.....\",\n             \"message\": \".....message.....\",\n             \"matchPercentage\": \".....match %....\"\n           }\n         }",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "eUWEXJcgoVvXWc2wqYSBi"
  },
  "examples": {
    "languages": [
      {
        "id": "sQN2UqaVm4ogBjpRk6Rhk",
        "code": "curl --location --request POST 'https://preproduction.signzy.tech/api/v2/patrons/..patronId../facematches' \\\n\n--header 'Authorization: <token>' \\\n--header 'content-type: application/json' \\\n--data-raw '{\n    \"essentials\": {\n        \"firstImage\": \"...firstImage..\",\n        \"secondImage\": \"...secondImage...\",\n        \"threshold\": \"Contains the threshold value between 0.05 to 0.95\",\n        \"alignHorizontally\" : \"yes/no\"\n    }\n}'",
        "language": "curl",
        "customLabel": "Preproduction"
      },
      {
        "id": "wY6PgEKAqHxEPY3scnKQT",
        "code": "curl --location --request POST 'https://signzy.tech/api/v2/patrons/..patronId../facematches' \\\r\n\r\n--header 'Authorization: <token>' \\\r\n--header 'content-type: application/json' \\\r\n--data-raw '{\r\n    \"essentials\": {\r\n        \"firstImage\": \"...firstImage..\",\r\n        \"secondImage\": \"...secondImage...\",\r\n        \"threshold\": \"Contains the threshold value between 0.05 to 0.95\",\r\n        \"alignHorizontally\" : \"yes/no\"\r\n    }\r\n}'",
        "language": "curl",
        "customLabel": "Production"
      }
    ],
    "selectedLanguageId": "wY6PgEKAqHxEPY3scnKQT"
  },
  "description": "This is used to match the two given images.",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  }
}
```
:::

## Request Schema

```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/patrons/..patronId../facematches' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.8' \
--header 'Authorization: <token>' \
--header 'content-type: application/json' \
--data-raw '{
    "essentials": {
            "firstImage": ".....first image URL....",
             "secondImage": ".....Second image URL....",
             "threshold":"...value between 0.05 to 0.95...(optional)",
             "alignHorizontally":"yes|no....(optional)"
    }
}'
```

## Parameters

| **Parameters**               | **Data Type** | **Description**                                   |
| ---------------------------- | ------------- | ------------------------------------------------- |
| essentials                   | string        | Contains the essential input data                 |
| essentials.firstImage        | string        | Contains the URL of the first image               |
| essentials.secondImage       | string        | Contains the URL of the second image              |
| essentials.threshold         | string        | Contains the threshold value between 0.05 to 0.95 |
| essentials.alignHorizontally | string        | Returns true/false                                |

## Response

```json
{
           "essentials": {
             "firstImage": ".....first image URL....",
             "secondImage": ".....Second image URL...."
           },
           "id": "......id.....",
           "patronId": "..patronID....",
           "result": {
             "verified": "...verified 'true' or 'false'.....",
             "message": ".....message.....",
             "matchPercentage": ".....match %...."
           }
         }
```

## Response Parameter

| **PARAMETER NAME**     | **DESCRIPTION**                                                                |
| ---------------------- | ------------------------------------------------------------------------------ |
| essentials             | Contains the essential input data.                                             |
| essentials.firstImage  | The URL of the first image for comparison,                                     |
| essentials.secondImage | The URL of the second image for comparison,                                    |
| essentials.id          | This parameter contains the unique Id received from the identity request.      |
| essentials.patronId    | This parameter returns the unique ID of the UEN holder.                        |
| result                 | This holds final result of the response.                                       |
| result.verified        | This parameter displays whether the verification done is true/false.           |
| result.message         | The message is displayed to the user regarding the status of the verification. |
| result.matchPercentage | This parameter displays the match percentage between the two uploaded images.  |

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

