Call the CredentialRecognition operation to extract key information from credential images and detect forgery. This synchronous operation returns results immediately
API information
API operation name: CredentialRecognition
Description: Extracts key information from a credential image and detects forgery using AI.
Request method: POST
Protocol: HTTPS
QPS limit: Each API has a dedicated QPS limit. For details, see QPS limits of ID Verification server-side APIs.
Endpoints:
NoteBenefits of internal network access: An internal network enables private communication between Alibaba Cloud services in the same region. If your application server is also in the same region, use the internal network endpoint to access the ID Verification service for a more secure and stable connection.
Optimization for overseas access: Network conditions outside the Chinese mainland can be complex. To reduce latency and minimize request failures, optimize your integration by following the best practices in Server-side Network Latency Analysis and Optimization.
Singapore
Public endpoint:
cloudauth-intl.ap-southeast-1.aliyuncs.comInternal endpoint:
cloudauth-intl-vpc.ap-southeast-1.aliyuncs.com
Credential forgery detection is AI-based and achieves 90% accuracy on internal test datasets. Actual accuracy may vary across sample scenarios.
Detection is more effective for native camera images than for digitally synthesized or software-edited images.
Do not rely on forgery detection as the sole verification method. Use it as an auxiliary tool to improve manual review efficiency.
Forgery detection applies to electronic document review scenarios such as financial payment acquisition and e-commerce merchant onboarding. For other scenarios, contact your account manager.
Online debugging and integration
Before you debug or integrate, read the Debug and integrate server-side APIs with OpenAPI guide to understand how to call APIs on the OpenAPI platform and how to obtain the SDK.
You can debug this operation directly in OpenAPI Explorer, and generate SDK sample code for this operation.
Request parameters
Images for the CredentialOcrPictureBase64 or CredentialOcrPictureUrl parameter must meet these requirements:
Image format: PNG, JPG, JPEG, BMP, and WebP.
Image dimensions: Width and height must each be greater than 15 pixels and less than 8192 pixels. Aspect ratio must be less than 50.
NoteFor optimal results, use images with width and height greater than 500 pixels.
Image size: Maximum 10 MB for
CredentialOcrPictureUrl, or 3 MB forCredentialOcrPictureBase64.NoteLarge images increase response time. Use images smaller than 3 MB when possible.
Name | Type | Required | Description | Example |
ProductCode | string | Yes | The value is fixed to CREDENTIAL_RECOGNITION. | CREDENTIAL_RECOGNITION |
CredentialOcrPictureBase64 | string | No | The Base64-encoded image. Verify the image size before encoding. | - |
CredentialOcrPictureUrl | string | No | The publicly accessible HTTP or HTTPS URL of the image. | https://*** |
DocType | string | Yes | The credential type:
| 01 |
OcrArea | string | Yes | The extraction type:
| 0101 |
FraudCheck | string | Yes | Whether to enable tampering detection.
| true |
Response parameters
Name | Type | Description | Example | |
HTTP Status Code | Integer | The HTTP status code. | 200 | |
HTTP Body | RequestId | String | The request ID. | 130A2C10-B9EE-4D84-88E3-5384FF039**** |
Result.TransactionId | String | The unique transaction ID. | hksb7ba1b28130d24e015d694361b**** | |
Code | String | Return code: For more information, see Server-side HTTP status codes. Important
| Success | |
Message | String | The response message. | success | |
Result.Success | String | The extraction result:
| S | |
Result.SubCode | String | The verification result description. ResultObject.SubCode error codes. | 200 | |
Result.ExtIdInfo | String | JSON format as shown in the example. Result.ExtIdInfo. |
| |
ResultObject.SubCode error codes
Error code | Billed | Description and suggestion |
200 | Yes | Extraction successful. |
213 | Yes | No text was extracted. |
Result.ExtIdInfo
Name | Type | Description | Example |
recInfo | String | The extracted key information. Note If the extraction fails, this field is empty. |
|
spoofInfo | String | The credential anti-spoofing check result, including risk assessment and risk type:
| Returned when tampering detection is enabled ( |