---
title: Face Extraction
slug: api-marketplace/face-extraction
description: The Face Match API allows users to easily perform face recognition and face mask detection, determining if two images belong to the same person. With authenticated access and multiple endpoints, this documentation provides comprehensive guidelines for API
createdAt: 2023-06-12T12:57:33.000Z
---

## Introduction

This API accepts ID card or document images as input and adeptly extracts the face, returning a URL of the cropped face image. Users submit the image URL, and the API utilizes sophisticated image processing techniques to isolate and retrieve the facial image. The outcome is a convenient and accurate URL link to the extracted face, streamlining integration into various digital verification and security systems.

***

## API details

### Endpoint

:::CodeblockTabs
Production Endpoint

```text
POST https://api.signzy.app/api/v3/face/get-face
```
:::

:::CodeblockTabs
UAT/Testing environment

```jsx
POST https://api-preproduction.signzy.app/api/v3/face/get-face
```
:::

***

### Request Body Parameters

| **Parameter** | **Data Type** | **Description**                                                     | **Required** |
| ------------- | ------------- | ------------------------------------------------------------------- | ------------ |
| url           | String        | URL of the ID card/document from which the face is to be extracted. | Mandatory    |

```json
{
    "url": ["img_url"]
}
```

***

### Request Headers

| **Name**      | **Value**        | **Required** | **Description**                                                                                            |
| ------------- | ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Mandatory    | The type of content that the request body contains.                                                        |
| Authorization | XXXXXXXXXXXXXXX  | Mandatory    | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

***

### Code Samples

:::CodeblockTabs
```curl
curl --location 'https://api.signzy.app/api/v3/face/get-face' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Access-Token>' \
--data '{
    "url": "---input-image-url---"
}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "url": "---input-image-url---"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.signzy.app/api/v3/face/get-face',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '<Access-Token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

```python
import http.client
import json

conn = http.client.HTTPSConnection("api.signzy.app")
payload = json.dumps({
  "url": "---input-image-url---"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '<Access-Token>'
}
conn.request("POST", "/api/v3/face/get-face", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.signzy.app/api/v3/face/get-face"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "---input-image-url---"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "<Access-Token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

### Response body parameters

| **Parameter** **Name** | **Description**                                      |
| ---------------------- | ---------------------------------------------------- |
| faceUrl                | URL of the extracted face from the ID card/document. |

:::CodeblockTabs
200

```json
{
    "faceUrl": "--cropped-face-url---"
}
```

400

```json
{
    "error": {
        "statusCode": "400",
        "name": "URL is mandatory, please refer to docs",
        "message": "Error",
        "status": "400"
    }
}

// Invalid image URL
{
    "error": {
        "statusCode": "400",
        "name": "Error",
        "message": "Only images & PDFs are allowed, one of the urls does not respond like an image or pdf"
    }
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

409

```json
{
    "error": {
        "reason": "Error From Upstream",
        "status": 409,
        "message": "Upstream Down",
        "type": "Conflict",
        "statusCode": 409,
        "name": "error"
    }
}
```
:::

### Document related Constraints

:::hint{type="info"}
The size of the document should not exceed **10 MB**.

For best results, ensure the image you use fits tightly in the camera view and horizontally aligned.

Supported document types:

- Image - JPEG, JPG, PNG and TIFF/TIF.
- PDF - Maximum 2-page PDF is supported.
:::

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!
