Domain name for API request: ocr.intl.tencentcloudapi.com.
This API is used to recognize key fields on the photo side of a Hong Kong (China) identity card, including name in Chinese, name in English, telecode for name, date of birth, gender, document symbol, date of the first issue, date of the last receipt, identity card number, and permanent residency attribute.
This API is not fully available for the time being. For more information, please contact your Tencent Cloud sales rep.
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: HKIDCardOCR. |
| Version | Yes | String | Common Params. The value used for this API: 2018-11-19. |
| Region | No | String | Common Params. This parameter is not required. |
| ReturnHeadImage | No | Boolean | Whether to return identity photo. |
| ImageBase64 | No | String | Base64 string of the image Supported image formats: PNG, JPG, JPEG. GIF is not supported yet. Supported image size: The downloaded image cannot exceed 7 MB after being Base64-encoded, and it cannot take longer than 3 seconds to download the image. |
| ImageUrl | No | String | URL address of image. (This field is not supported outside Chinese mainland) Supported image formats: PNG, JPG, JPEG. GIF is currently not supported. Supported image size: the downloaded image cannot exceed 3 MB after being Base64-encoded. The download time of the image cannot exceed 3 seconds. We recommend you store the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability. The download speed and stability of non-Tencent Cloud URLs may be low. |
| Parameter Name | Type | Description |
|---|---|---|
| CnName | String | Name in Chinese |
| EnName | String | Name in English |
| TelexCode | String | Telecode of the name in Chinese |
| Sex | String | Gender. Valid values: Male, Female |
| Birthday | String | Date of birth |
| Permanent | Integer | Permanent identity card. 0: non-permanent; 1: permanent; -1: unknown. |
| IdNum | String | Identity card number |
| Symbol | String | Document symbol, i.e., the symbol under the date of birth, such as "***AZ" |
| FirstIssueDate | String | Date of first issue |
| CurrentIssueDate | String | Date of last receipt |
| HeadImage | String | Base64-encoded large primary portrait photo from the left side of the new-generation Hong Kong Identity Card. Note: this field may return null, indicating that no valid values can be obtained. |
| SmallHeadImage | String | Base64-encoded small secondary portrait photo from the right side of the new-generation Hong Kong Identity Card. Note: this field may return null, indicating that no valid values can be obtained. |
| WarnCardInfos | Array of Integer | Card Warning Information -9101 Alarm for covered certificate, -9102 Alarm for photocopied certificate, -9103 Alarm for photographed certificate, -9104 Alarm for PS certificate, -9107 Alarm for reflective certificate, -9108 Alarm for blurry image, -9109 This capability is not enabled. |
| WindowEmbeddedText | String | Text information incorporated within the laser-perforated see-through window on the new-generation Hong Kong Identity Card. |
| HKIDVersion | String | Versions of the Hong Kong Identity Card: HKID-2018, HKID-2003. |
| 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. |
HKIDCardOCR
POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: HKIDCardOCR
<Common Request Parameters>
{
"ReturnHeadImage": false,
"ImageUrl": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/***/fakeurl.jpg"
}
{
"Response": {
"TelexCode": "300000000000",
"FirstIssueDate": "(09-99)",
"RequestId": "fba1c9ad-aeb3-4418-9ecf-80ab1b5fc875"
}
}
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.ImageDecodeFailed | Failed to decode the image. |
| FailedOperation.ImageNoSpecifiedCard | The card in the image is not of the specified type. |
| FailedOperation.NoHKIDCard | Not a Hong Kong identity card. |
| 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. |
| FailedOperation.WarningServiceFailed | The general warning service encountered an exception. |
| InvalidParameterValue.InvalidParameterValueLimit | Incorrect parameter value. |
| LimitExceeded.TooLargeFileError | The file size exceeds the limit |
| ResourceUnavailable.InArrears | The account has insufficient balance. |
| ResourcesSoldOut.ChargeStatusException | The billing status is abnormal. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan