TableOCR

Last updated: 2020-09-17 18:12:02

1. API Description

Domain name for API request: ocr.tencentcloudapi.com.

This API is used to detect and recognize Chinese and English forms in images. It can return the text content of each cell and save the recognition result as Excel.

This API is not fully available for the time being. For more information, please contact your Tencent Cloud sales rep.

A maximum of 10 requests can be initiated per second for this API.

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 parameter. The value used for this API: TableOCR.
Version Yes String Common parameter. The value used for this API: 2018-11-19.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product. This API only supports: ap-beijing, ap-guangzhou, ap-hongkong, ap-shanghai, na-toronto
ImageBase64 No String Base64-encoded value of image.
Supported image formats: PNG, JPG, JPEG. GIF is not supported at present.
Supported image size: the downloaded image cannot exceed 3 MB in size after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
Either ImageUrl or ImageBase64 of the image must be provided; if both are provided, only ImageUrl will be used.
ImageUrl No String URL address of image.
Supported image formats: PNG, JPG, JPEG. GIF is not supported at present.
Supported image size: the downloaded image cannot exceed 3 MB in size after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
We recommend storing 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.

3. Output Parameters

Parameter Name Type Description
TextDetections Array of TextTable Recognized text. For more information, please click the link on the left.
Data String Base64-encoded Excel data.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Recognizing form

Input Example

https://ocr.tencentcloudapi.com/?Action=TableOCR
&ImageUrl=http%3A%2F%2Fimg3.redocn.com%2Ftupian%2F20180301%2Fkongbaiqiuzhijianlibiaogesheji_9230633.jpg
&<Common request parameters>

Output Example

{
  "Response": {
    "TextDetections": [
      {
        "ColTl": 2,
        "RowTl": 11,
        "ColBr": 4,
        "RowBr": 12,
        "Text": "",
        "Type": "body",
        "Confidence": 0,
        "Polygon": [
          {
            "X": 171,
            "Y": 415
          },
          {
            "X": 296,
            "Y": 415
          },
          {
            "X": 296,
            "Y": 446
          },
          {
            "X": 171,
            "Y": 446
          }
        ],
        "AdvancedInfo": "{}"
      },
      {
        "ColTl": 1,
        "RowTl": 7,
        "ColBr": 6,
        "RowBr": 8,
        "Text": "",
        "Type": "body",
        "Confidence": 0,
        "Polygon": [
          {
            "X": 91,
            "Y": 251
          },
          {
            "X": 401,
            "Y": 251
          },
          {
            "X": 401,
            "Y": 276
          },
          {
            "X": 91,
            "Y": 276
          }
        ],
        "AdvancedInfo": "{}"
      }
    ],
    "Data": "UEsDBBQAAA......",
    "RequestId": "436d209b-a3ad-4491-b3bf-185f217bf191"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

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.EmptyImageError The image is empty.
FailedOperation.ImageDecodeFailed Image decoding failed.
FailedOperation.ImageNoText No text is detected in the image.
FailedOperation.LanguageNotSupport The input language is not supported.
FailedOperation.OcrFailed OCR failed.
FailedOperation.UnKnowError Unknown error.
FailedOperation.UnOpenError The service is not activated.
InvalidParameterValue.InvalidParameterValueLimit Incorrect parameter value.
LimitExceeded.TooLargeFileError The file is too large.
ResourcesSoldOut.ChargeStatusException Exceptional billing status.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help