ID_OCR_MAX is an ID Verification solution that uses the Qwen-VL model to detect and recognize various types of ID certificates from around the world.
Supported document types vary by region due to regional model limitations.
Singapore region: Supports the recognition of all document types listed in the Document types table.
Indonesia region: Supports only Indonesian ID cards and global passports (document type codes
IDN01001andGLB03002).Malaysia region: Supports only Malaysian ID cards and global passports (document type codes
MYS01001andGLB03002).
Endpoints
API operation: DocOcrMax
Description: Uses the Qwen-VL large language model to recognize the document type and extract information from a provided ID certificate image, and then returns the relevant fields.
Request method: POST
Transport protocol: HTTPS
This API operation has a dedicated QPS limit. For more information, see QPS limits for ID Verification server-side API operations.
Service endpoint:
NoteBenefits of internal network access: An internal network is a private communication network between Alibaba Cloud products within the same region. If your business server is deployed in the corresponding Alibaba Cloud region, you can use the internal same-region endpoint to access the ID Verification service. This provides more secure and stable communication.
Optimization suggestions for access from outside China: Network environments outside China can be complex. To optimize your integration solution, reduce network latency, and minimize request failures, see Server-side network latency analysis and optimization.
Singapore
Public network:
cloudauth-intl.ap-southeast-1.aliyuncs.comInternal network:
cloudauth-intl-vpc.ap-southeast-1.aliyuncs.com
Indonesia
Public network:
cloudauth-intl.ap-southeast-5.aliyuncs.comInternal network:
cloudauth-intl-vpc.ap-southeast-5.aliyuncs.com
Malaysia (Kuala Lumpur)
Public network:
cloudauth-intl.ap-southeast-3.aliyuncs.comInternal network:
cloudauth-intl-vpc.ap-southeast-3.aliyuncs.com
Online debugging and integration
Before you debug and integrate an API operation, see Debug and integrate server-side API operations using OpenAPI Explorer for information about how to call API operations and obtain SDKs and sample code in OpenAPI Explorer.
You can run this API operation directly in OpenAPI Explorer to debug it. You can also generate SDK sample code for this API operation.
Image format requirements
To ensure stable model performance, upload images that meet all the following requirements:
Image format: JPG, JPEG, or PNG.
Image size: The recommended size is 50 KB to 100 KB. The maximum size is 10 MB.
NoteConverting an image to Base64 format increases its data size. To ensure that parameters in Base64 format do not exceed the 10 MB data transfer limit, the original image must not exceed 6 MB.
Image resolution: The image height and width must be greater than 200 pixels and less than 8192 pixels. A resolution of 480 × 640 (height × width) is recommended.
Image quality recommendations:
The four corners of the document image must be visible. Avoid holding the document in a way that obstructs the corners, because this can reduce detection accuracy.
The content of the document image must be clear, unobstructed, and without overexposed areas. The document image must be upright and not tilted or upside down.
The document image should occupy more than 60% of the total image area. A smaller document image may reduce recognition accuracy.
Take photos of real documents.
Request parameters
You can upload photos using one of two available methods.
IdOcrPictureBase64
IdOcrPictureUrl
Name | Type | Required | Description | Example |
ProductCode | String | Yes | The product solution to use. Set the value to ID_OCR_MAX. | ID_OCR_MAX |
SceneCode | String | No | A custom authentication scenario ID. You can use this ID to query related records in the console. It can be a combination of letters, digits, and underscores, up to 10 characters long. | 1234567890 |
MerchantBizId | String | Yes | A custom unique business ID. Use it to locate and troubleshoot issues later. It can be a combination of letters and digits, up to 32 characters long. Make sure that the ID is unique. | e0c34a77f5ac40a5aa5e6ed20c35**** |
MerchantUserId | String | No | A custom user ID or another identifier for a specific user, such as a mobile phone number or email address. Desensitize the value of this field in advance. For example, use hashing. | 123456789 |
IdOcrPictureBase64 | String | No | The Base64-encoded image of the ID certificate. If you use IdOcrPictureBase64 to pass the ID certificate image, check the image size. Do not pass an oversized image. | base64 |
IdOcrPictureUrl | String | No | The URL of the ID certificate image. The URL must be an HTTP or HTTPS link accessible over the Internet. | https://***.jpg |
OcrModel | String | No | The OCR recognition mode: Note Modes 1 and 2 do not support document quality inspection or anti-spoofing detection. For more information, see Differences between recognition modes.
| 0 |
DocType | String | No | Note
| GLB03001 |
DocPage | String | No | The page to recognize.
Important If the page detected by the model does not match the specified page, Subcode 213 is returned. | 01 |
IdSpoof | String | No | Specifies whether to enable the document anti-spoofing feature:
| F |
IdThreshold | String | No | The custom threshold mode for OCR quality inspection:
| 3 |
OcrValueStandard | String | No | Specifies whether to return additional OCR fields in a standardized format:
Note For information about the supported document types and standardized fields, see Field standardization. | 0 |
Authorize | String | No | Specifies whether to enable verification against an authoritative data source to enhance certificate anti-spoofing capabilities. This parameter applies only when IdSpoof is enabled.
Note
| T |
Differences between recognition modes
OCR recognition mode | Input differences | Output differences | Recommended scenarios |
0: Specified document recognition mode |
| This mode outputs detailed fields from the document page. For more information, see Document OCR fields. | Recommended for online integration scenarios that use ID Verification. This mode automatically verifies that the document type is permitted for your business and outputs detailed fields from the document face. |
1: Automatic document classification mode Important This recognition mode is supported only in the Singapore region. |
| This mode outputs only the detected document type code. For more information, see Global ID certificate codes. | Recommended for offline business analysis scenarios. You can use this mode for clustering and cleansing of historical ID certificate images. |
2: Automatic document classification and general recognition mode Important This recognition mode is supported only in the Singapore region. |
| This mode outputs the document type and key standardized fields from the document face. For more information, see the table of general recognition fields. Note This mode outputs only the fields that are common to different document types. | Recommended for offline scenarios that require assisted manual review. This mode recognizes the document type and key fields to improve review efficiency. |
Field standardization
To handle the diversity of global ID certificates, ID Verification provides a field standardization feature that produces standardized output formats for the following key document fields.
Supported document types
Currently, only the following document types are supported. Support for additional types will be added based on demand.
Because name rules are complex, Latin-name standardization may be inaccurate. End users should be prompted to verify their names manually.
China | CHN01001 | 01, 02 | |
Taiwan (China) | TWN01001 | 01 | |
South Korea | KOR01001 | 01 | |
KOR02001 | 01 | ||
KOR03001 | 01 |
Supported standardized fields
Field | Type | Description |
surname_s | String | The surname in Latin letters. |
given_name_s | String | The name of the Latin alphabet. |
sex_s | String | The sex, F or M. |
date_of_birth_s | String | The date of birth in the yyyy-mm-dd format. |
date_of_expiry_s | String | The expiration date of the document in the yyyy-mm-dd format. |
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-5384F******** |
Result.TransactionId | String | The unique ID for the entire authentication process. | hksb7ba1b28130d24e015d694******** | |
Code | String | Success | ||
Message | String | A detailed description of the returned Code. | success | |
Result.Passed | String | Indicates whether the recognition is complete. | Y | |
Result.SubCode | String | 200 | ||
Result.ExtIdInfo | String |
|
| |
ExtIdInfo
Name | Type | Description | Example |
ocrIdInfo | String | The OCR field information of the ID certificate. Note If the ID certificate OCR process fails, this field is empty. | |
spoofInfo | String | The result of the anti-spoofing detection for the certificate, including the risk result and risk type. Note Certificate detection is enabled only if you set IdSpoof to Y in the Initialize operation. Otherwise, spoofResult returns N by default and spoofType is empty.
| |
ocrDocType | String | Note This field is returned only when OcrModel is set to 1 or 2. | CHN01 |
ocrStandardData | String | The standardized OCR field information of the ID certificate. Note This field is returned only if the document type is supported and | |
Return codes
HTTP status code | Code | Description |
200 | Success | Request successful. |
400 | MissingParameter | Parameter cannot be empty. |
InvalidParameter | Invalid parameter. | |
401 | UnqualifiedPhoto | The uploaded image is unreadable or the image resolution does not meet requirements. We recommend changing the image. Ensure the photo is clear, has normal exposure, is complete without occlusion, and has no significant angle deviation. |
DataDuplication | Both Base64-encoded image and URL image address are provided. Choose only one of these parameters. | |
ToolargeImage | The image size is too large. We recommend compressing the image or changing the upload method. | |
DownloadTimeout | URL image download timeout. | |
403 | Forbidden.RAMUserAccessDenied | You need to grant the RAM user the AliyunAntCloudAuthFullAccess permission. For more information, see Authorize RAM users to access the service. |
Forbidden.AccountAccessDenied | Ensure that you have activated ID verification and your account has no overdue payment. | |
Throttling.Api | API request is blocked due to throttling. | |
500 | InternalError | Internal system error. Provide feedback to engineers for troubleshooting. |
503 | ServiceUnavailable | The service is unavailable. Contact engineers for troubleshooting. |
ResultObject.SubCode error codes
Subcode is returned based on different product solutions or integration methods. For details, refer to the following table.
Applicable solution | Error code | Is authentication record billed | Description and suggested reasons |
General | 200 | Yes | Authentication passed. |
| 211 | Yes | The quality or resolution of the certificate image does not meet requirements, or the image itself is incomplete. Ensure the photo of the certificate's portrait side is clear, has normal exposure, is complete without occlusion, and has no significant angle deviation. |
| 212 | Yes | Certificate anti-counterfeiting detection indicates risk. There may be high-risk operations such as rephotographing, tampering, or photocopying. |
| 213 | Yes | The specified certificate type was not detected (recognition mode) or the certificate type could not be identified (classification mode). We recommend uploading a clear, complete certificate image with normal angle. |