tencent cloud

ExtractDocMulti
Last updated: 2025-09-02 17:05:01
ExtractDocMulti
Last updated: 2025-09-02 17:05:01

1. API Description

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.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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.

3. Output Parameters

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.

4. Example

Example1 Document Extraction Multimodal

Multimodal document extraction

Input Example

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"
}

Output Example

{
    "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"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

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.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback