This topic describes the API for the Credential Recognition service. You can call this synchronous API to pass a credential image or PDF file, extract key information by using AI, and perform forgery detection. The API returns a result immediately.
API reference
API name: CredentialRecognitionIntlV2
Description: Extracts key information from a credential image or PDF file by using AI and supports forgery detection.
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
The forgery detection feature for Credential Recognition is an AI-powered prediction product. It achieves a 90% accuracy rate on internal test datasets. The actual accuracy may vary across sample scenarios.
Detecting tampering in digitally synthesized images is more difficult. The detection performance is better for images captured with a native camera than for those that are digitally synthesized.
We recommend that you do not use forgery detection as the sole method for verifying credential authenticity. Use it as a supplementary check or as a tool to improve manual review efficiency.
Forgery detection is widely used in electronic material review scenarios, such as financial payment acquiring and e-commerce merchant onboarding, to improve manual review efficiency. If you have requirements for a wider range of 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 use OpenAPI Explorer to directly call this API for debugging, and generate SDK code examples.
Request parameters
The file corresponding to the CredentialOcrPictureBase64, CredentialOcrPictureUrl, or CredentialOcrPictureFile parameter must meet the following requirements:
Submission method: Choose one of the three upload methods.
File format: When
FileInputType=IMAGE(default), the supported formats are PNG, JPG, JPEG, BMP, and WebP. WhenFileInputType=PDF, the supported format is PDF.File dimensions: Both width and height must be greater than 15 pixels and less than 8,192 pixels, and the aspect ratio must be less than 50.
File size: Cannot exceed 10 MB.
For optimal recognition results, we recommend that both the width and height of the image are greater than 500 pixels.
Large files can increase the API response time. We recommend using files smaller than 3 MB.
Parameter | Type | Required | Description | Example |
ProductCode | String | Yes | The value must be CREDENTIAL_RECOGNITION. | CREDENTIAL_RECOGNITION |
CredentialOcrPictureBase64 | String | No. Specify only one of the three upload parameters. | The Base64-encoded image or PDF file. If you use this method, verify the file size and do not pass an excessively large file. | base64 |
CredentialOcrPictureUrl | String | A publicly accessible HTTP or HTTPS URL of the image or PDF file. | https://***.jpg | |
CredentialOcrPictureFile | InputStream | The file stream of the credential. For integration details, see Special Scenarios: File Uploading Through the Advance API. | ||
FileInputType | String | No | The type of the input file.
| IMAGE |
DocType | String | Yes | The credential type:
| 01 |
OcrArea | String | Yes | The extraction type:
| 0101 |
FraudCheck | String | Yes | Enables or disables tampering detection.
| true |
CheckRuleConfig | String | No | A JSON string that specifies the field validation rules. | |
OcrValueStandard | String | No | Specifies whether to enable standardization of OCR results.
| 0 |
OcrTranslation | String | No | Specifies whether to enable translation.
| 0 |
Response parameters
Parameter | Type | Description | Example | |
HTTP Status Code | Integer | The HTTP status code. | 200 | |
HTTP Body | RequestId | String | The Request ID. | 130A2C10-B9EE-4D84-88E3-5384FF039**** |
ResultObject.TransactionId | String | A unique identifier for the verification process. | hksb7ba1b28130d24e015d694361b**** | |
Code | String | The return code. For more information, see Server-side HTTP status codes. Important
| Success | |
Message | String | The response message. | success | |
ResultObject.Success | String | The extraction result:
| S | |
ResultObject.SubCode | String | The description of the verification result. For more information, see ResultObject.SubCode error codes. | 200 | |
ResultObject.ExtIdInfo | String | For the JSON format, see the example on the right. For more information, see ResultObject.ExtIdInfo. |
| |
ResultObject.SubCode error codes
Error code | Billing | Description |
200 | Yes | Extraction successful. |
204 | Yes | Key information failed the validation rules specified in CheckRuleConfig. |
211 | Yes | Poor file quality or resolution. Ensure the file is clear, well-exposed, complete, unobstructed, and not significantly skewed. |
212 | Yes | The anti-spoofing check detected a risk. This may be caused by indicators such as screen photo, tampering, or photocopying. |
213 | Yes | Incorrect file type. Ensure the file type matches the DocType parameter. |
ResultObject.ExtIdInfo
Parameter | Type | Description | Example |
recInfo | String | The extracted key information. Note This field is empty if the extraction fails. |
|
spoofInfo | String | The result of the anti-spoofing check, including the risk assessment and risk type:
| Returned when |