Liveness Verification

Introduction

This API allows you to perform liveness verification using a selfie image. It analyzes the provided image and returns information about the detected face, including its liveness score.

Endpoint

https://idv-eu.kairos.com/v0.1/liveness-verification

Parameters

  • selfie (File) - The selfie image file for liveness verification.

  • threshold (Numeric Value) - A numeric value (between 0 and 1) representing the threshold for liveness verification. The API will consider a face as live if its liveness score is greater than or equal to this threshold.

Request

To make a liveness verification request, you can use the following examples:

import requests

url = "https://idv-eu.kairos.com/v0.1/liveness-verification"
files=[
    ('selfie',('file',open('/path/to/selfie_image','rb')))
]
headers = {
    'app_id': '811ed7d1',
    'app_key': '45e4f0a37851a6257f54a8d715a38d98'
}

# Add threshold parameter
payload = {
    'threshold': 0.6
}

response = requests.request("POST", url, headers=headers, files=files, data=payload)

Replace app_id, app_key, and selfie with your actual credentials and the path to your selfie image.

Response (HTTP 200)

If the request is successful, you will receive a response data:

{
  "api_req_uid": "c6bb825f-871c-4323-8c06-8e5fd3517747",
  "processed_at": "2024-04-01 20:05:17",
  "requested_at": "2024-04-01 20:05:17",
  "response_code": 2,
  "response_data": {
    "faces_liveness": 0.0,
    "faces_predicted": [
      {
        "confidence": 0.9885,
        "delta": {
          "x": 18.9982,
          "y": 25.3957
        },
        "top_left": {
          "x": 38.0577,
          "y": 4.0824
        }
      }
    ],
    "img": {
      "height": 71,
      "width": 95
    }
  }
}

Other Responses

  • 5xx: Server errors may occur, and the server will respond with an appropriate 5xx status code. In this case, please check your request and try again later.

  • 4xx: Authentication failures may result in a 4xx status code. Make sure you have provided valid app_id and app_key in the request headers.

  • 403: If limits are exceeded, you may receive a 403 Forbidden status code indicating that you have reached a usage limit. Check your account limits and consider upgrading your plan if needed.

Last updated