Domain name for API request: ocr.intl.tencentcloudapi.com.
This API is used to recognize the coordinates of four corners of cards.
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: RecognizeDetectCardCoords. |
| Version | Yes | String | Common Params. The value used for this API: 2018-11-19. |
| Region | No | String | Common Params. This parameter is not required. |
| ImageUrl | No | String | The Url of the image. supported image formats: PNG, JPG, JPEG. GIF format is not currently supported. supported image size: the downloaded image should be no more than 7M after Base64 encoding. image download time should be no more than 3 seconds. images stored in tencent cloud's urls guarantee higher download speed and stability. it is recommended to store images in tencent cloud. the speed and stability of non-tencent cloud storage urls may be impacted. |
| ImageBase64 | No | String | The Base64 value of the image. supported image formats: PNG, JPG, JPEG. GIF format is not currently supported. supported image size: no more than 7M after the downloaded image is encoded in Base64. image download time is not more than 3 seconds. either ImageUrl or ImageBase64 must be provided. if both are provided, only use ImageUrl. |
| Parameter Name | Type | Description |
|---|---|---|
| ItemList | Array of CoordsItem | Detected coordinate information. |
| 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: RecognizeDetectCardCoords
<Common request parameters>
{
"ImageUrl": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/card/IDCardOCR/IDCardOCR1.jpg"
}{
"Response": {
"ItemList": [
{
"Coords": {
"Height": 388,
"Width": 607,
"X": 93,
"Y": 204
},
"Polygon": {
"LeftBottom": {
"X": 93,
"Y": 592
},
"LeftTop": {
"X": 95,
"Y": 204
},
"RightBottom": {
"X": 700,
"Y": 592
},
"RightTop": {
"X": 700,
"Y": 204
}
}
}
],
"RequestId": "27ca3357-3cfe-4cb2-9996-0120241211b1"
}
}
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 | File download failed. |
| FailedOperation.ImageDecodeFailed | Image decoding failed. |
| FailedOperation.OcrFailed | OCR failed. This error may be caused by unstable network connections,service anomalies or other issues. |
| FailedOperation.UnKnowError | Unknown error. |
| FailedOperation.UnOpenError | The service is not activated. |
| InvalidParameterValue.InvalidParameterValueLimit | Incorrect parameter value. |
| LimitExceeded.TooLargeFileError | The file is too large. |
| ResourceUnavailable.InArrears | The account is in arrears. |
| ResourceUnavailable.ResourcePackageRunOut | The account resource package is exhausted. |
| ResourcesSoldOut.ChargeStatusException | Exceptional billing status. |
Feedback