• Console

›Identity Verification Premium

FaceID service introduction

  • FaceID
  • FaceID-Pro

Identity Verification Basic

  • App-GetBizToken
  • App-Verify
  • App-Authentication
  • H5-Raw-UploadVideo
  • H5-Raw-Verify

Identity Verification Premium

  • APP_Pro-Access-Guide
  • APP_Pro-Authentication
  • APP_Pro-Encrption-Guide
  • APP_Pro-GetBiztoken
  • APP_Pro-Liveness
  • APP_Pro-Verify
  • H5-Lite_Pro-Access-Guide
  • H5-Lite_Pro-GetToken
  • H5-Lite_Pro-Redirect-To-Liveness-URL
  • H5-Lite_Pro-Callbacks
  • H5-Lite_Pro-GetResult
  • H5-Lite_Pro-UsinginAnApp
  • H5-Lite_Pro-UI-Customization
  • H5-Lite_Pro-RTC-Compatibility
  • H5-RAW_Pro-JS-SDK
  • H5-RAW_Pro-GetToken
  • H5-RAW_Pro-GetResult
  • H5-RAW_Pro-CommonProblem

OCR

  • Indonesian_ID_Card
H5-Lite_RAW-GetResult

Describe

This API returns liveness detection results. You can use biz_id as the index to search for the FaceID H5 verification results. The results are only stored for one day and can only be obtained through this API 3 times. If you call this API to obtain the results the 4th time or the results have expired, an error is returned. Make sure you obtain the data for each service before it expires.

Call URL

Singapore:
https://api-sgp.megvii.com/faceid/lite/raw/get_result

Note:
In production environments, always use HTTPS communication.
HTTP is insecure and poses security risks. Using HTTP in production will void service reliability guarantees.

Calling Method

GET

Parameters

Required/OptionalParameterTypeDescription
Requiredapi_keyStringAPI key for calling this API
Requiredapi_secretStringSecret of the api_key
RequiredtokenStringTokens returned by get_token
Optionalreturn_imageStringDetermines whether to return best quality images:
0 (default): No image
1: Return 1 best quality image
2: Return 2 best quality images

Return Value Description

ParameterTypeDescription
request_idStringAPI call serial number
Example: "1462259763,e2d2f8d6-204b-4c43-92ea-1d62b071f83c"
biz_noStringCustomer business serial number (returned only if set during call, matches input value exactly)
time_usedIntTotal request time in milliseconds (always returned)
statusStringPossible values:
- NOT_STARTED: Live detection not started
- PROCESSING: Verification in progress
- OK: Verification completed
- FAILED: Live detection failed
liveness_resultJsonLive detection result; if the user interrupts the live process midway, this field will not be returned
result: The result of live detection. Possible values:
- PASS: Live detection passed.
- FAIL: Live detection failed.
details: Details of the live detection result. This object records the number of times various issues occurred during the process. Note: The presence of these issues does not necessarily mean the overall result is FAIL. The details object contains the following keys (each key maps to a count of occurrences):
- FACE_NOT_FOUND: Number of times no face was detected.
- SIDE_FACE: Number of times the face was not facing the camera directly (side face).
- UPDOWN_FACE: Number of times the face was not facing the camera directly (looking up or down).
- EYE_OCCLUSION: Number of eye occlusions.
- MOUTH_OCCLUSION: Number of mouth occlusions.
- AWAY_FROM_CAMERA: Number of times the face was too far from the camera.
- CLOSE_TO_CAMERA: Number of times the face was too close to the camera.
- FACE_OUT_OF_CAMERA: Number of times the face was not facing the camera directly.
- HIGH_BRIGHTNESS: Number of times the ambient light was too bright.
- LOW_BRIGHTNESS: Number of times the ambient light was too dim.
- LOW_FACE_QUALITY: Number of times the face quality in the video was too poor.
score: Score of flash sensor face ID live detection.
flash_attack: Flash attack score, reflecting the degree of inconsistency between the lighting color sequence of the uploaded video stream and the sequence issued by the system.
living_attack: Living attack score, indicating the credibility that the user is an attacker.
verify_resultJsonFace comparing result; if the user interrupts the live detection process midway, this field will not be returned
- error_message: An error occurred during face comparing:
- null: indicates that no error has occurred
- NO_FACE_FOUND: : No face was detected in the image
- DATA_SOURCE_ERROR: An error occurred while calling the comparison data, generally indicating a data error. When this error occurs, it is recommended to stop the business and immediately contact FaceID customer service or business personnel. Resume the business after confirmation.
- INTERNAL_ERROR: Internal server error. When such an error occurs, please make another request. If this error persists, please contact FaceID customer service or business personnel promptly.
result_ref[x]: Comparison result between the live-captured portrait and the uploaded image_ref[x];
- "confidence": Confidence Level of the composite score, of Float type, with a value range of [0, 100], where a larger number indicates lower risk.
- "thresholds": A set of confidence level thresholds for reference, of Object type, containing four fields, all of Float type with values in the range [0, 100]:
- "1e-3": Confidence Level Threshold for a One-in-a-Thousand Risk
- "1e-4": Confidence Level Threshold for a One-in-Ten-Thousand Risk
- "1e-5": Confidence Level Threshold for a Risk of One in One Hundred Thousand
- "1e-6": Confidence Level Threshold for a One-in-a-Million Risk
image_bestStringThis field is only returned when the call is successful and the return_image field is configured as 1 or 2, and the returned value will be the highest quality face photo from the video used for face comparing. It is returned as a Base64 string, with the image format being JPEG. In exceptional cases, this field may return null.
image_best_2StringThis field is only returned when the call is successful and the return_image field is configured to 2, returning another live image with the best quality. It is returned as a Base64 string, and the image format is JPEG. In exceptional cases (such as when only one image meets the quality criteria), this field may return null.

Return Examples

When status is "OK":

{
  "request_id": "1462259763,e2d2f8d6-204b-4c43-92ea-1d62b071f83c",
  "biz_no": "your_biz_no",
  "time_used": 100,
  "status": "OK",
  "liveness_result": {
    "score":{
        "flash_attack":0.5,
        "living_attack":0.5
    },
    "result":0.5,
    "details":0.5
    },
    "request_id":"1629684531,ec2fc2a6-01fc-4ecf-82fe-f26c5bf1b2ed",
    "verify_result":
    {
    "result_faceid": {
            "confidence": 68.918,
            "thresholds": {
                "1e-3": 64,
                "1e-4": 69,
                "1e-5": 74,
                "1e-6": 79.9
            }
        },
    "result_ref1": {
        "confidence": 68.918,
        "thresholds": {
            "1e-3": 64,
            "1e-4": 69,
            "1e-5": 74,
            "1e-6": 79.9
        }
    },
    "result_idcard_photo": {
        "confidence": 68.918,
        "thresholds": {
            "1e-3": 64,
            "1e-4": 69,
            "1e-5": 74,
            "1e-6": 79.9
        }
    },
    "result_idcard_datasource": {
        "confidence": 68.918,
        "thresholds": {
            "1e-3": 64,
            "1e-4": 69,
            "1e-5": 74,
            "1e-6": 79.9
        }
    },
    "biz_no":"c22fe4e0-66ba-4078-bd9b-3b1a20628f8d"
}

When status is "Failed":

{
    "status": "Failed",
    "time_used":2,
    "image_best":"data:image/jpeg;base64,",
    "liveness_result":{
        "score":{
            "flash_attack":0.5,
            "living_attack":0.5
        },
        "result":0.5,
        "details":0.5
    },
    "request_id":"1629684531,ec2fc2a6-01fc-4ecf-82fe-f26c5bf1b2ed",
    "verify_result":{
    
    },
    "biz_no":"c22fe4e0-66ba-4078-bd9b-3b1a20628f8d"
}

When status is "NOT_STARTED":

{
    "status": "NOT_STARTED",
    "time_used":2,
    "image_best":"data:image/jpeg;base64,",
    "liveness_result":{
        "score":{
            "flash_attack":null,
            "living_attack":null
            },
        "result":null,
        "details":null
    },
    "request_id":"1629684531,ec2fc2a6-01fc-4ecf-82fe-f26c5bf1b2ed",
    "verify_result":{
    
    },
    "biz_no":"c22fe4e0-66ba-4078-bd9b-3b1a20628f8d"
}

Error Code List

GetResult Specific Errors

HTTP Status CodeError MessageDescription
400RESULT_NOT_FOUNDIncorrect business number provided

Universal Errors

HTTP Status CodeError MessageDescription
403AUTHENTICATION_ERRORInvalid signature
403AUTHORIZATION_ERROR:API key deactivated, call limit exceeded, or insufficient permissions
Example: Denied (no API permission)
403CONCURRENCY_LIMIT_EXCEEDEDConcurrency exceeds limit
400MISSING_ARGUMENTS:Missing required parameter
403DATA_DESTROYEDExceeded queryable time or max query count
400BAD_ARGUMENTS:Parameter parsing error (e.g., invalid type/length)
404API_NOT_FOUNDCalled API does not exist
500INTERNAL_ERRORInternal server error (retry request or contact support)

© 2012-2021 北京旷视科技有限公司 版权所有 | 京ICP备12036813号-6

京公网安备 11010802025957号