ID Card Recognition and Information Verification API Integration Guide
This article introduces an ID Card Recognition and Information Verification API integration guide, which can verify the authenticity and consistency of a name and ID card number using an ID card image or a name and ID card number. This API is used to verify the authenticity and consistency of a name and ID card number. You can provide the required verification information by entering a name and ID card number or submitting a photo of the portrait side of an ID card.
¶ Application Process
To use the ID Card Recognition and Information Verification API, first go to the Ace Data Cloud Console to obtain your API Token for later use.

If you have not logged in or registered, you will be automatically redirected to the login page to register and log in. Once completed, you will be automatically returned to the current page.
The API Key for a general application can be used for services enabled for the account; the Key for a dedicated application can be used within that application's service scope. Please check the Key's permissions, validity period, and limits, and confirm that the application balance is sufficient to pay for this request. Available trial credits are subject to the amount shown in your account. If the balance is insufficient, click the "Recharge" button.
📘 Full documentation: ID Card Recognition and Information Verification API →
¶ Basic Usage
First, let's look at the basic usage: enter an ID card image link to obtain the processed verification result. First, you only need to pass an image_url field, and then you can fill in the corresponding content in the interface, as shown below:

As you can see, we have set the Request Headers here, including:
accept: The format in which you want to receive the response. Here it is set toapplication/json, meaning JSON format.authorization: The key for calling the API. After applying, you can select it directly from the drop-down list.
We have also set the Request Body, including:
image_url: The link to the ID card image to be processed.encryption: Optional sensitive field encryption parameter (if you need to submit ciphertext).
After making the selection, you can see that the corresponding code has also been generated on the right, as shown below:

Click the "Try" button to test it. As shown above, we obtained the following result:
{
"result": "0",
"description": "姓名和身份证号一致",
"name": "身份证姓名",
"id_card": "身份证号码",
"sex": "身份证性别",
"nation": "身份证民族",
"birth": "身份证生日",
"address": "身份证家庭住址"
}
The returned result contains several fields, described as follows:
result, the verification result code. The charging details are as follows.- Chargeable result codes:
- 0: The name and ID card number match
- -1: The name and ID card number do not match
- Non-chargeable result codes:
- -2: Invalid ID card number (incorrect length, check digit, etc.)
- -3: Invalid name (incorrect length, format, etc.)
- -4: Identity document database service error
- -5: No record of this ID card exists in the identity document database
- -6: The authoritative comparison system is being upgraded; please try again later
- -7: The number of verifications has exceeded the daily limit.
- Chargeable result codes:
description, the result of verifying the name and ID card number.name, the name on the ID card. This is empty if no ID card image was uploaded.id_card, the ID card number on the ID card. This is empty if no ID card image was uploaded.sex, the sex on the ID card. This is empty if no ID card image was uploaded.nation, the ethnicity on the ID card. This is empty if no ID card image was uploaded.birth, the date of birth on the ID card. This is empty if no ID card image was uploaded.address, the home address on the ID card. This is empty if no ID card image was uploaded.
As you can see, the name and ID card number on the ID card are consistent and valid. OCR technology was also used to extract and display other information.
Additionally, if you want to generate the corresponding integration code, you can copy the generated code directly. For example, the CURL code is as follows:
curl -X POST 'https://api.acedata.cloud/identity/idcard/ocr' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"image_url": {image_url}
}'
The Python integration code is as follows:
import requests
url = "https://api.acedata.cloud/identity/idcard/ocr"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"image_url": {image_url}
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
¶ Custom Information Verification
We also provide a verification method that does not expose ID card image information. You can pass only the name name and ID card number id_card to verify the authenticity and consistency of the name and ID card number. The specific information entered is shown below:

After clicking run, the following result is returned:
{
"address": "",
"birth": "",
"description": "姓名和身份证号一致",
"id_card": "身份证号码",
"name": "身份证姓名",
"nation": "",
"result": "0",
"sex": ""
}
As the result shows, other private information is not exposed, and this also completes the verification of the authenticity and consistency of the name and ID card number.
¶ 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 ID Card Recognition and Information Verification API to verify the authenticity and consistency of a name and ID card number using an input image or name and ID card number information. We hope this document helps you better integrate and use the API. If you have any questions, please feel free to contact our technical support team.
