Domain name for API request: ocr.intl.tencentcloudapi.com.
This API supports identifying and extracting field information in structured scenarios such as complex scenarios and multiple formats. Key scenarios include: finance, health care, transportation, travel, insurance. Click experience now.
This API is used to set the alias SmartStructuralPro.
The default API request rate limit is 5 requests per second.
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: ExtractDocMulti. |
| 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 address of the image. supported image formats: PNG, JPG, JPEG, WORD, EXCEL. GIF format is not currently supported. supported image size: no more than 10M after Base64 encoding. image download time should not exceed 3 seconds. supported image pixels: between 20-10000px. images stored in tencent cloud's Url ensure 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, WORD, EXCEL. GIF format is not currently supported. supported image size: no more than 10M after encoding the downloaded image with Base64. image download time: no more than 3 seconds. supported image pixels: between 20-10000px. either ImageUrl or ImageBase64 must be provided. if both are provided, only use ImageUrl. |
| PdfPageNumber | No | Integer | Specifies the page number of the PDF to be recognized. only single page recognition is supported. valid when uploading a PDF file with the IsPdf parameter set to true. default value is the first 3 pages. |
| ItemNames.N | No | Array of String | Specifies the field names to be returned by the customized structuring feature. for example, if the customer wants to add the recognition result of two fields, name and gender, manually input ItemNames=["name","gender"]. |
| ItemNamesShowMode | No | Boolean | true: only custom field. False: default value field + custom field. Default true. |
| ReturnFullText | No | Boolean | Whether the full-text field recognition is enabled. |
| ConfigId | No | String | Configuration ID support: -- General -- InvoiceEng -- WayBillEng -- CustomsDeclaration -- WeightNote -- MedicalMeter -- BillOfLading -- EntrustmentBook -- Statement -- BookingConfirmation -- AirWayBill -- Table -- SteelLabel -- CarInsurance -- MultiRealEstateCertificate -- MultiRealEstateMaterial -- HongKongUtilityBill -- OverseasCheques -- RegistrationCertificate -- GridPhoto -- SignaturePage |
| EnableCoord | No | Boolean | Whether the full-text field coordinate value recognition is enabled. |
| OutputParentKey | No | Boolean | Whether parent-child key recognition is enabled. the option is selected by default. |
| ConfigAdvanced | No | ConfigAdvanced | Single attribute configuration of a template. |
| OutputLanguage | No | String | When cn, the added key is chinese. When set to en, the added key is english. |
| Parameter Name | Type | Description |
|---|---|---|
| Angle | Float | Image rotation angle (angle system). the text's horizontal direction is 0. clockwise is positive; counterclockwise is negative. |
| StructuralList | Array of GroupInfo | Configures the structured text info. |
| WordList | Array of WordItem | Restore text information. |
| TokenNum | Integer | Number of sample identification fields. |
| 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. |
Multimodal document extraction
POST / HTTP/1.1
Host: ocr.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ExtractDocMulti
<Common request parameters>
{
"ImageUrl": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/document/SmartStructuralOCR/SmartStructuralPro1.png",
"ImageBase64": "/9j/4AAQSkZJRg.....s97n//2Q==",
"PdfPageNumber": 1,
"EnableCoord": false,
"ItemNames": [
number
],
"ReturnFullText": false,
"ConfigId": "General"
}{
"Response": {
"Angle": 0,
"StructuralList": [
{
"Groups": [
{
"Lines": [
{
"Key": {
"AutoName": "Number",
"ConfigName": "number"
},
"Value": {
"AutoContent": "176***101",
"Coord": {
"LeftTop": {
"X": 0,
"Y": 0
},
"RightTop": {
"X": 0,
"Y": 0
},
"RightBottom": {
"X": 0,
"Y": 0
},
"LeftBottom": {
"X": 0,
"Y": 0
}
}
}
}
]
}
]
}
],
"WordList": [
{
"DetectedText": "ORD0****9",
"Coord": {
"LeftTop": {
"X": 0,
"Y": 0
},
"RightTop": {
"X": 0,
"Y": 0
},
"RightBottom": {
"X": 0,
"Y": 0
},
"LeftBottom": {
"X": 0,
"Y": 0
}
}
}
],
"RequestId": "2378****90"
}
}
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