1. 接口信息
1.1. 调用地址
https://api.regenai.com/v1/general/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数据 | |
语言 | language | false | String | chs | 默认chs chs-简体中文 cht-繁体中文 eng-英语 jpn-日语 kor-韩语 vie-越南语 tha-泰语 spa-西班牙语 deu-德语 fra-法语 rus-俄语 nld-荷兰语 ita-意大利语 por-葡萄牙语 msa-马来语 ind-印尼语 |
识别结果返回类型 | 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": {
"id": "7c8e31b1bb8b33132e75c6a51d4a8cfb84d51d74",
"message": "success",
"result": 1,
"sha1": "28d3dcc14c7fb1aaf6d65cf4b1708f04492fdd45", --识别图片唯一标识
"time_cost": "1639", --识别所用时间
"timestamp": 1620871622,
"version": "20201023"
"identify_results": [ --识别结果数据
{
"page":0 //页码
"orientation": 0, --旋转角度(顺时针): 0/90/180/270
"region": [ --识别图片坐标
0, --左上角x坐标
0, --左上角y坐标
1800, --左下角x坐标
1326 --左下角y坐标
],
"details": { --文本信息
"lang":"chs", --语言
"stamp": [ --印章数据列表 权限字段
{
"confidence": 0.9287 --置信度
"stamp_color": "1" --印章颜色 0:非红章 1:红章
"result": "xx" --印章识别结果
"region": [ --印章坐标
0: 543
1: 540
2: 797
3: 541
4: 797
5: 717
6: 543
7: 716
]
}
],
"print": [ --打印体数据列表
{
"confidence": 0.99, --行置信度
"region": [ --文字行四个顶点的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":"手" --单字识别结果
}
]
}
]
}
}
}
}
}