Domain name for API request: ocr.intl.tencentcloudapi.com.
This API provides general OCR recognition for overseas identity documents.
The following table lists the supported countries or regions, document types, and whether the back side is required:
| Nationality | CardType | Whether the Back Side is Required |
| Argentina | Driver's License | Yes |
| Argentina | National ID Card | Yes |
| Argentina | Passport | No |
| Australia | Driver's License | Yes |
| Australia | National ID Card | Yes |
| Australia | Passport | No |
| Australia | Residence Permit | Yes |
| Bangladesh | Driver's License | Yes |
| Bangladesh | National ID Card | Yes |
| Bangladesh | Passport | No |
| Cambodia | Driver's License | Yes |
| Cambodia | National ID Card | Yes |
| Cambodia | Passport | No |
| Canada | Driver's License | No |
| Canada | National ID Card | Yes |
| Canada | Passport | Yes |
| Canada | Residence Permit | Yes |
| Chile | Driver's License | Yes |
| Chile | National ID Card | Yes |
| Chile | Passport | No |
| Germany | Driver's License | Yes |
| Germany | National ID Card | Yes |
| Germany | Passport | No |
| Germany | Residence Permit | Yes |
| Mexico | Driver's License | No |
| Mexico | National ID Card | Yes |
| Mexico | Passport | No |
| Myanmar | Driver's License | No |
| Myanmar | National ID Card | Yes |
| Myanmar | Passport | No |
| New Zealand | Driver's License | Yes |
| New Zealand | National ID Card | No |
| New Zealand | Passport | No |
| New Zealand | Residence Permit | No |
| Nigeria | Driver's License | Yes |
| Nigeria | National ID Card | Yes |
| Nigeria | Passport | No |
| Nigeria | Residence Permit | Yes |
| Pakistan | Driver's License | Yes |
| Pakistan | National ID Card | Yes |
| Pakistan | Passport | No |
| Russia | Driver's License | Yes |
| Russia | National ID Card | No |
| Russia | Passport | No |
| Singapore | Driver's License | Yes |
| Singapore | National ID Card | Yes |
| Singapore | Passport | No |
| Singapore | Residence Permit | Yes |
| Indonesia | National ID Card | No |
| Indonesia | Driver's License | No |
| Hong Kong, China | Identity Card | Yes |
| Thailand | National ID Card | No |
| Thailand | Driver's License | Yes |
| Malaysia | National ID Card | Yes |
| Malaysia | Driver's License | Yes |
| Singapore | National ID Card | Yes |
| Singapore | Driver's License | Yes |
| Philippines | National ID Card | Yes |
| Philippines | Driver's License | No |
| Japan | National ID Card | Yes |
| Japan | Driver's License | No |
| Macau, China | Identity Card | Yes |
| Taiwan, China | Identity Card | Yes |
| Bangladesh | National ID Card | Yes |
| Nigeria | National ID Card | Yes |
| Nigeria | Driver's License | Yes |
| Pakistan | National ID Card | Yes |
| Pakistan | Driver's License | Yes |
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: ApplyCardVerificationExternal. |
| Version | Yes | String | Common Params. The value used for this API: 2018-11-19. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-singapore. |
| Nationality | Yes | String | Country/Region of the document. For the full list of supported countries/regions, refer to the API description. |
| CardType | Yes | String | Document type. Supported values: ID_CARD, PASSPORT, DRIVING_LICENSE, RESIDENCE_PERMIT (only supported in certain countries/regions, including Australia, Canada, Germany, New Zealand, Nigeria, Singapore). |
| ImageBase64Front | No | String | Base64-encoded image of the document front. Supported image formats: PNG, JPG/JPEG (GIF not supported). Supported image size: The downloaded image after Base64 encoding must not exceed 2 MB. Image download time must not exceed 5 seconds. Supported image resolution: Between 256256 and 40964096 pixels. Note: You must provide either ImageUrlFront or ImageBase64Front. If both are provided, only ImageUrlFront is used. |
| ImageBase64Back | No | String | The Base64 value of the reverse side of the document. Supported image formats: PNG, JPG/JPEG. Supported image size: the downloaded image after Base64 encoding must be no more than 2M. Image download time must be no more than 5 seconds. Supported image resolution: between 256 * 256 and 4096 * 4096. For some documents, either ImageUrlBack or ImageBase64Back must be provided. If both are provided, only ImageUrlBack is used. |
| ImageUrlFront | No | String | URL of the document front image. Supported image formats: PNG, JPG/JPEG (GIF not supported). Supported image size: The downloaded image after Base64 encoding must not exceed 2 MB. Image download time must not exceed 5 seconds. Supported image resolution: Between 256256 and 40964096 pixels. Note: You must provide either ImageUrlFront or ImageBase64Front. If both are provided, only ImageUrlFront is used. |
| ImageUrlBack | No | String | URL of the document back image. Supported image formats: PNG, JPG/JPEG (GIF not supported). Supported image size: The downloaded image after Base64 encoding must not exceed 2 MB. Image download time must not exceed 5 seconds. Supported image resolution: Between 256256 and 40964096 pixels. Note: For some documents, you must provide either ImageUrlBack or ImageBase64Back. If both are provided, only ImageUrlBack is used. |
| ReturnHeadImage | No | Boolean | Whether to crop and return the face image from the document. Default: false. If set to true, the image constraints are: - Size after Base64 encoding must not exceed 5 MB. - Maximum pixel width/height: 4000 for JPG, 2000 for other formats. - Minimum pixel width/height: 64. - Supported formats: PNG, JPG, JPEG, BMP (GIF not supported). |
| Parameter Name | Type | Description |
|---|---|---|
| CardVerificationToken | String | Unique token for the verification process, used to retrieve the result. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ApplyCardVerificationExternal
<Common request parameters>
{
"Nationality": "ARG",
"CardType": "PASSPORT",
"ImageBase64Front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD//9k="
}
{
"Response": {
"CardVerificationToken": "b76914c0-e1ca-4c36-aede-b64e418d2319",
"RequestId": "1dab853b-0f54-4479-94d8-e94dbd0c6aea"
}
}
POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ApplyCardVerificationExternal
<Common request parameters>
{
"Nationality": "PHL",
"CardType": "PASSPORT",
"ImageUrlFront": "http://demo/demo.jpg"
}
{
"Response": {
"CardVerificationToken": "969af1aa-dbb3-49df-b661-6d952bfdce2d",
"RequestId": "74b25e14-27bc-48fd-a4f2-638066f16e83"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation.DownLoadError | Failed to download the file. |
| FailedOperation.ImageSizeTooLarge | The image size exceeds the limit. Refer to the image size constraints in the input parameter description. |
| FailedOperation.OcrFailed | OCR recognition failed. This error may be caused by unstable network connections, service anomalies, or other issues. |
| FailedOperation.UnKnowError | Unknown error. |
| FailedOperation.UnOpenError | The service has not been activated. |
| InvalidParameter.EngineImageDecodeFailed | Image decoding failed. |
| InvalidParameterValue.InvalidFileContentSize | The image file size is invalid or exceeds the allowed limit. |
| InvalidParameterValue.InvalidParameterValueLimit | Incorrect parameter value. |
| ResourceUnavailable.ImageDownloadError | Image file download failed. |
| ResourceUnavailable.InArrears | The account has insufficient balance. |
| ResourceUnavailable.ResourcePackageRunOut | The resource package has been exhausted. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan