Call the CredentialRecognitionIntl operation to extract key information from credential images and detect forgery. This synchronous operation returns results immediately.
API information
API operation name: CredentialRecognitionIntl
Description: Extracts key information from a credential image and detects forgery using AI.
Request method: POST
Protocol: HTTPS
QPS limit: Each API has its own QPS limit. For more information, see QPS limits of ID Verification server-side APIs.
Endpoints:
NoteBenefits of internal network access: An internal network is a private communication network connecting Alibaba Cloud products within the same region. If your application server is deployed in the same region, use the internal endpoint to access the ID Verification service for enhanced security and stability.
Optimizing overseas access: Overseas network environments can be complex. Refer to Optimize server network latency to tune your integration and reduce network latency and request failures.
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 debugging and integration, read the Use OpenAPI document to learn how to call APIs on the OpenAPI platform and 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 |
IdQuality | string | No | Whether to enable quality detection.
| Y |
CheckRuleConfig | string | No | The configuration of field validation rules in the JSON string format. | |
OcrValueStandard | string | No | Whether to enable standardization of OCR results.
| 0 |
OcrTranslation | string | No | Whether to enable translation.
| 0 |
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 | Billing | Description and suggestion |
200 | Yes | Extraction successful. |
204 | Yes | Inconsistent key information. |
211 | Yes | The file quality or resolution does not meet the requirements. Ensure the file is clear, has normal exposure, is complete and unobstructed, and has no significant angular bias. |
212 | Yes | The anti-counterfeiting check detected a threat. This may be due to high-risk operations such as screen recapture, tampering, or photocopying. |
213 | Yes | The file type is incorrect. Ensure the file type matches the specified document type. |
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 ( |