tencent cloud

ImageRecognitionV2

フォーカスモード
フォントサイズ
最終更新日: 2026-04-24 16:15:46

1. API Description

Domain name for API request: faceid.intl.tencentcloudapi.com.

This API is used to judge whether the image passed in and the ID photo in the authoritative database belong to the same person based on the identity information.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ImageRecognitionV2.
Version Yes String Common Params. The value used for this API: 2018-03-01.
Region No String Common Params. This parameter is not required for this API.
IdCard Yes String

Identity card number.

Name Yes String

Name.

  • For Chinese, please use UTF-8 encode.
ImageBase64 Yes String

Image for face comparison, the Base64 value of the image.
The size of the Base64-encoded image data should be no more than 3M. Only jpg and png formats are supported.
Please use the standard Base64 encoding type (with = padding). Refer to RFC4648 for the coding specification.

Optional No String

This parameter is not required for this API.

Encryption No Encryption

Sensitive data encryption information.

  • Users with encryption requirements for incoming information (name, identity card number) can use this parameter. For details, please click the left-side link.
Extra No String

Customized description field.

  • For description of invoke business info. This description field will return in the output.
  • Each customized description field supports [1,10] characters.

3. Output Parameters

Parameter Name Type Description
Sim Float

Similarity. - Value ranges from 0.00 to 100.00. - Recommend at least 70 to be determined as the same person. You can self-adjust the threshold based on specific scenarios (the pass rate for false matches at threshold 70 is 0.01%).

Result String

Business error code.

  • Success case returns Success.
  • For error conditions, refer to the FailedOperation part in the error code list below.
Description String

Business result description.

Extra String

Custom description field in the API call.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Photo Face Verification Successful Example

Input Example

https://faceid.intl.tencentcloudapi.com/?Action=ImageRecognitionV2
&IdCard=11204416541220243X
&Name=Wei Xiaobao
&ImageBase64=/9j/4AAQSkZJRg.....s97n//2Q==
&<Common request parameters>

Output Example

{
    "Response": {
        "Result": "Success",
"Description": "Success"
        "Sim": 89.88,
        "RequestId": "f904f4cf-75db-4f8f-a5ec-dc4f942c7f7a"
    }
}

Example2 Photo Face Verification Similarity Substandard Example

Input Example

https://faceid.intl.tencentcloudapi.com/?Action=ImageRecognitionV2
&IdCard=11204416541220243X
&Name=Wei Xiaobao
&ImageBase64=/9j/4AAQSkZJRg.....s97n//2Q==
&<Common request parameters>

Output Example

{
    "Response": {
"Description": "Similarity comparison does not reach the pass standard"
        "RequestId": "e9e198e4-4fa8-49f0-a67e-f8053bc49201",
        "Result": "FailedOperation.CompareLowSimilarity",
        "Sim": 26.04
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.CompareFail Comparison failed.
FailedOperation.CompareLibServiceUnavailable Comparison library source maintaining, temporarily unavailable
FailedOperation.CompareLowSimilarity The comparison similarity did not reach the passing standard.
FailedOperation.CompareSystemError Error calling the comparison engine API.
FailedOperation.DecryptSystemError Decryption failed.
FailedOperation.IdFormatError Input identity card number error.
FailedOperation.IdNameMisMatch Name and ID card number mismatch. Please verify and try again after.
FailedOperation.IdNoExistSystem The number is not found in the database. Please go to the place of household registration to verify.
FailedOperation.IdPhotoNoExist The photo of this number is not found in the database. Please go to the place of household registration to verify.
FailedOperation.IdPhotoPoorQuality Document image is of poor quality. Please update and try again.
FailedOperation.IdPhotoSystemNoanswer The customer database, self-built database, or authentication center failed to return the photo. Try again later.
FailedOperation.IdentityAuthLimitExceeded Name/ID card number authentication attempts exceed the daily limit. Please retry the next day.
FailedOperation.LifePhotoDetectFaces Multiple faces are detected.
FailedOperation.LifePhotoDetectFake Real person comparison failed.
FailedOperation.LifePhotoDetectNoFaces Failed to detect a full face.
FailedOperation.LifePhotoPoorQuality The resolution of the image passed in is too low. Please upload a new one.
FailedOperation.LifePhotoSizeError The image passed in is too large or too small.
FailedOperation.NameFormatError Input name error.
FailedOperation.StsUnAuthErrError STS unauthorized.
FailedOperation.UnKnown Unknown internal error.
InvalidParameter Invalid parameter.
InvalidParameter.UnsupportEncryptField Unencrypted fields exist. Refer to the documentation to modify.
InvalidParameterValue Incorrect parameter value.
UnauthorizedOperation Unauthorized operation.
UnauthorizedOperation.Arrears The account is in arrears.
UnauthorizedOperation.NonAuthorize Identity verification has not been completed for the account.
UnauthorizedOperation.Nonactivated The service has not been activated.
UnsupportedOperation Unsupported operation.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック