1. 接口信息

1.1. 调用地址

https://api.regenai.com/v1/table_words/fetch

1.2. 请求方式

POST

1.3. 请求数据类型

multipart/form-data

1.4. 返回类型

JSON

2. 请求参数

名称 变量名 必填 类型 示例值 描述
Key app_key true String c5ed72329fece2fe0010a437505b01cb 分配的key
令牌 token true String 7007bd1257dce8d47489166a7c77a926 授权令牌
时间戳 timestamp true String 1522374165 timestamp 为January 1 1970 00:00:00 GMT 到现在的秒数
图片链接 image_url false String http://t.cn/EbhjOOq 图片链接地址
图片文件 image_file false Binary   图片文件
图片Base64数据 image_data false String   图片Base64数据
识别结果返回类型 result_type false String "json" or "docx" 默认json, docx(word文档)

2.1. 请求说明

  • 支持的图片类型: jpg, jpeg, png及pdf, doc, docx. 图片最大支持8M.
  • token 的值计算方式为:md5($appkey+$timestamp+$appSecret)
    • token=md5("c5ed72329fece2fe0010a437505b01cb+1522374165+5c9597f3c8245907ea71a89d9d39d08e")=7007bd1257dce8d47489166a7c77a926
  • 生成token时,字符串连接中的“+”是必需的,缺少这个符号会无法验证通过验证

3. 返回值

3.1. 正确返回参数

名称 变量名 必填 类型 示例值 描述
返回状态码 result true int 0或1 请求状态. 1:成功, 0:失败
回复 response true json    

3.2. 正确返回样例

{
    "result": 1,
    "message": "success",
    "response": {
        "data": {
            "version": "20201023",
            "timestamp": 1662714064,
            "message": "success",
            "id": "3b014f2973e21e19553517a820b3b2f214129e8eabf3d04a8ad5abd18715cd2e",
            "sha1": "ab0461fa64be3d7133f1839ea502f3e7e1b35812",
            "time_cost": "1245",
            "result": 1,
            "identify_results": [
                {
                    "page":0 --页码
                    "orientation": 0, -- 旋转角度(顺时针): 0/90/180/270
                    "region": [ -- 识别图片坐标
                            0,
                            0,
                            1800,
                            1326
                    ],
                    "details": {
                        "tables": [
                            {
                              "region": [ --第N个表格在图片上的四个顶点的X/Y坐标
                                4, --左上角x坐标
                                9, --左上角y坐标
                                180, --右上角x坐标
                                8, --右上角Y坐标
                                180, --右下角x坐标
                                23, --右下角Y坐标
                                4, --左下角x坐标
                                23 --左下角y坐标
                              ],
                              "row_num": 10, --行数
                              "column_num": 2, --列数
                              "cells": [
                                {
                                  "startrow": 0, --起始位置
                                  "endrow": 1, --结束位置
                                  "startcol": 0, --起始位置
                                  "endcol": 1, --结束位置
                                  "region": [ --cell的坐标
                                      158,
                                      261,
                                      283,
                                      262,
                                      283,
                                      308,
                                      158,
                                      307
                                     ],  
                                  "lines": [
                                    {
                                      "text": "aaabbbccc", --cell中的文字
                                    }
                                  ],
                                  "text_rects": [
                                    [
                                      {
                                        "raw_text": "", --当单独cell中有多行文字时,每行的文字信息
                                        "confidence": 0.999, --字块内文字置信度
                                        "region": [
                                          4, --左上角x坐标
                                          9, --左上角y坐标
                                          180, --右上角x坐标
                                          9, --右上角Y坐标
                                          180, --右下角x坐标
                                          23, --右下角Y坐标
                                          4, --左下角x坐标
                                          23 --左下角y坐标
                                        ]
                                      }
                                    ]
                                  ]
                                }
                              ]
                            }
                        ],
                        "print": [ // 打印体数据列表
                            {
                                "confidence": 0.99,  --行置信度
                                "region": [ --第N个表格在图片上的四个顶点的X/Y坐标
                                    0, --左上角x坐标
                                    1, --左上角y坐标
                                    2, --右上角x坐标
                                    3, --右上角Y坐标
                                    4, --右下角x坐标
                                    5, --右下角Y坐标
                                    6, --左下角x坐标
                                    7 --左下角y坐标
                                ],
                                "result":"识别结果" --行识别结果
                                "words":[
                                    {
                                        "confidence": 0.999, --单字置信度
                                        "region":[0,1,2,3,4,5,6,7], --单字坐标
                                        "result":"识" --单字识别结果
                                    }
                                ]
                            }
                        ],
                        "handwritten": [ -- 手写数据列表
                            {
                                "confidence": 0.99,  --行置信度
                                "region":[0,1,2,3,4,5,6,7], --行坐标
                                "result":"手写结果" --行识别结果
                                "words":[
                                    {
                                        "confidence": 0.999, --单字置信度
                                        "region":[0,1,2,3,4,5,6,7], --单字坐标
                                        "result":"手" --单字识别结果
                                    }
                                ]
                            }
                        ],
                         "stamp": [      -- 章信息
                            {
                                "confidence": 0.9986,    --置信度
                                "result": "国家税务总局",   --章识别结果
                                "region": [               --章坐标
                                    407,
                                    112,
                                    559,
                                    112,
                                    559,
                                    213,
                                    407,
                                    213
                                ]
                            }]
                    }

                }
            ]
        }
    }
}

results matching ""

    No results matching ""