Face Static Liveness Detection (High Precision Version) API Integration Instructions

This document will introduce the Face Static Liveness Detection (High Precision Version) API integration instructions, which can be used for anti-counterfeiting liveness detection on static images uploaded by users to determine whether they are counterfeit images.

Application Process

To use Face Static Liveness Detection (High Precision Version) API, first open the Ace Data Cloud Console and copy your API Token.

If you are not logged in, you will be redirected to sign in and brought back to this page automatically.

A single API Token works across every service on the platform — no need to subscribe per service. New accounts receive free starter credit; when it runs low you can top up your shared balance in the console.

📘 Full documentation: Face Static Liveness Detection (High Precision Version) API →

Basic Usage

First, understand the basic usage method, which is to input the image link to obtain the processed result image. You need to simply pass a image_url field, and the face image is shown below:

Next, we can fill in the corresponding content on the interface, as shown in the image below:

Here we can see that we have set the Request Headers, including:

  • accept: the format of the response result you want to receive, here filled in as application/json, which is in JSON format.
  • authorization: the key to call the API, which can be directly selected after application.

Additionally, we set the Request Body, including:

  • image_url: the link to the face image that needs to be processed.
  • face_model_version: the algorithm model version used for the face recognition service. Currently, the input supports "3.0".

After selection, you can find that the corresponding code is also generated on the right side, as shown in the image below:

Click the "Try" button to conduct a test, as shown in the image above, and we obtained the following result:

{
  "score": 0,
  "face_model_version": "3.0"
}

At this point, we have obtained the result of the face static liveness detection, including the content of the liveness score.

Field descriptions are as follows:

  • score: the liveness score, with a range of [0,100], used to determine whether it is a counterfeit image based on the threshold range corresponding to the liveness score. Currently, the thresholds can be divided into [5,10,40,70,90], with a recommended threshold of 40.
  • face_model_version: the algorithm model version used for face recognition.

If you want to generate the corresponding integration code, you can directly copy it, for example, the CURL code is as follows:

curl -X POST 'https://api.acedata.cloud/face/detect-live' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "image_url": "https://cdn.acedata.cloud/lrbtcn.jpg"
}'

The integration code in Python is as follows:

import requests

url = "https://api.acedata.cloud/face/detect-live"

headers = {
    "accept": "application/json",
    "authorization": "Bearer {token}",
    "content-type": "application/json"
}

payload = {
    "image_url": "https://cdn.acedata.cloud/lrbtcn.jpg"
}

response = requests.post(url, json=payload, headers=headers)
print(response.text)

Error Handling

When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:

  • 400 token_mismatched: Bad request, possibly due to missing or invalid parameters.
  • 400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.
  • 401 invalid_token: Unauthorized, invalid or missing authorization token.
  • 429 too_many_requests: Too many requests, you have exceeded the rate limit.
  • 500 api_error: Internal server error, something went wrong on the server.

Error Response Example

{
  "success": false,
  "error": {
    "code": "api_error",
    "message": "fetch failed"
  },
  "trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}

Conclusion

Through this document, you have learned how to use the Face Static Liveness Detection (High Precision Version) API for anti-counterfeiting liveness detection on static images uploaded by users to determine whether they are counterfeit images. We hope this document can help you better integrate and use the API. If you have any questions, please feel free to contact our technical support team.