tencent cloud

APIs

GetNFCResult

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-09-18 16:45:20

1. API Description

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

This API verifies NFC data. Pass in the NFCToken returned by the SDK, along with the document fields and portrait photo to be verified.The service automatically compares the information to verify with the decrypted document NFC data and outputs the verification result. The NFCToken generated by the SDK is valid for 10 minutes. The service is billed per query.
The service currently supports NFC recognition and verification of the following fields and portrait photos on Chinese mainland second-generation resident identity cards, exit-entry permits for traveling to and from Hong Kong and Macao, and international passports with an NFC chip:

-Chinese mainland second-generation resident identity card: identity card number, name, sex, ethnicity, date of birth, address, issuing authority, validity start time, validity end time, portrait photo
-Exit-Entry Permit for Traveling to and from Hong Kong and Macao: ID number, name, sex, English name, issuing place, issuing authority, validity end time, date of birth, portrait photo, machine-readable code
-International passports with an NFC chip: passport number, name, nationality, sex, country or region code, validity start time, validity end time, date of birth, birth place, issuing place, issuing authority, portrait photo, machine-readable code

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: GetNFCResult.
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.
NFCToken Yes String Unique ID returned by the frontend NFC SDK
IdNum No String Identity card number / passport number / Hong Kong and Macao travel permit
Name No String Name
Picture No String Base64 value of the portrait photo
BirthDate No String Date of birth (format: YYYYMMDD)
BeginTime No String Validity start time of the document (format: YYYYMMDD)
EndTime No String Document validity end time (format: YYYYMMDD)
Address No String Address
Nation No String Ethnicity
Sex No String Sex
EnName No String English name
SigningOrganization No String Issuing authority
Nationality No String Nationality
CountryCode No String Country code
MachineReadCode No String Machine-readable code of the passport

3. Output Parameters

Parameter Name Type Description
ChargeCode String Billing result code. Each successful NFC read is billed once. Permissible range:

0: Read successful, billed.
-1: Read failed, not billed.
IdType String Document type. Value range:

01: ID card.
02: Passport.
03: Hong Kong and Macao travel permit.
99: Other document.
Note: This field may return null, indicating that no valid value can be obtained.
CheckMRTD String Document verification result. The items for NFC verification are as follows:
{"result_issuer ":"Issuer certificate legitimacy verification result ","result_paper":"Document security object legitimacy verification result ","result_data" :"Data tampering prevention verification result ","result_chip" :"Document chip replication prevention verification result"}
Value range: 0: verification passed 1: verification failed 2: unverified 3: partially passed
When all four verification results are 0, the document is genuine.
IdNumCompareResult String Comparison result of the passed-in identity card number, passport number, or Hong Kong, China and Macao, China travel permit with the identity card number recognized by NFC.

0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
NameCompareResult String Comparison result of the passed-in name and the name recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
PictureCompareSim Float Similarity score between the passed-in face image and the portrait photo recognized by NFC.
- Value range: [0.00, 100.00].
- It is recommended to determine the same person when the similarity is equal to or greater than 70. Customers can also self-adjust the threshold based on specific scenarios (with a threshold of 70, the false pass rate is one in a thousand; with a threshold of 80, the false pass rate is one in ten thousand).
PictureCompareResult String Comparison result of the passed-in face image and the portrait photo recognized by NFC.

0: Same person (similarity equal to or greater than 70 points)
1: Not the same person (similarity less than 70 points)
2: Comparison failed (the input image quality is too low)
3: Comparison failed (the input image contains no human face, an incomplete face, or multiple faces)
4: Comparison failed (input image too large or too small)
5: Comparison failed (NFC cannot read the portrait photo)
6: Comparison failed (no input image data)
7: Comparison failed (other reason)
BirthDateCompareResult String Comparison result of the passed-in date of birth and the date of birth recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
BeginTimeCompareResult String Comparison result of the passed-in validity start time and the validity start time recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
EndTimeCompareResult String Comparison result of the passed-in validity end time and the validity end time recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
AddressCompareResult String Comparison result of the passed-in address and the address recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
NationCompareResult String Comparison result of the passed-in ethnicity and the ethnicity recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
SexCompareResult String Comparison result of the passed-in sex and the sex recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
EnNameCompareResult String Comparison result of the passed-in English name and the English name recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
SigningOrganizationCompareResult String Comparison result of the passed-in issuing authority and the issuing authority recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
NationalityCompareResult String Comparison result of the passed-in nationality and the nationality recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
CountryCodeCompareResult String Comparison result of the passed-in country code and the country code recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
MachineReadCodeCompareResult String Comparison result of the passed-in machine-readable code and the machine-readable code recognized by NFC.
0: Consistent
-1: Not the same
-2: NFC recognition failed, unable to compare
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 NFC Comparison

Input Example

POST / HTTP/1.1
Host: faceid.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: GetNFCResult
<Common request parameters>

{
    "NFCToken": "a1cfec70-4b29-11f0-bce7-c66e37472b33",
    "IdNum": "111111111111111111",
"Name": "Wei Xiaobao",
    "EnName": "",
    "Picture": "base64",
    "BirthDate": "19460815",
"Address": "xxxx, Beijing",
Nation: Han
"Sex": "Male",
    "SigningOrganization": "",
    "BeginTime": "",
    "EndTime": "",
    "CountryCode": "",
    "Nationality": "",
    "MachineReadCode": "343dasd"
}

Output Example

{
    "Response": {
        "IdType": "0",
        "CheckMRTD": "0",
        "IdNumCompareResult": "0",
        "NameCompareResult": "0",
        "PictureCompareSim": 85.5,
        "BirthDateCompareResult": "0",
        "BeginTimeCompareResult": "0",
        "EndTimeCompareResult": "0",
        "AddressCompareResult": "0",
        "NationCompareResult": "0",
        "SexCompareResult": "0",
        "EnNameCompareResult": "0",
        "SigningOrganizationCompareResult": "0",
        "NationalityCompareResult": "0",
        "CountryCodeCompareResult": "0",
        "MachineReadCodeCompareResult": "0",
        "PictureCompareResult": "0",
        "ChargeCode": "0",
        "RequestId": "fb2675fb-40e6-42ce-a958-d72413197ad1"
    }
}

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.CompareLowSimilarity The similarity does not reach the pass threshold.
FailedOperation.CompareSystemError Error calling the comparison engine API.
FailedOperation.InvalidTokenParameter Token not found
FailedOperation.LifePhotoDetectFaces Multiple faces detected.
FailedOperation.LifePhotoDetectFake Real person comparison failed.
FailedOperation.LifePhotoDetectNoFaces Full face not detected.
FailedOperation.LifePhotoPoorQuality The uploaded image resolution is too low. Upload it again.
FailedOperation.LifePhotoSizeError Uploaded image too large or too small.
InternalError Internal error.
InternalError.UnKnown Internal unknown error.
InvalidParameter Invalid parameter.
InvalidParameterValue Incorrect parameter value.

ヘルプとサポート

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

フィードバック