数据提取
开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v2/ocr/data_extraction
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v2/ocr/data_extraction' \
--header 'Authorization;' \
--header 'content-type: application/json' \
--data-raw '{
"response_as_dict": true,
"attributes_as_list": false,
"show_original_response": false,
"convert_to_pdf": false
}'
响应示例响应示例
200 - 成功示例
{
"amazon": {
"fields": [
{
"key": "Classification",
"value": "Post",
"bounding_box": {
"left": 0.6780509948730469,
"top": 0.8059332370758057,
"width": 0.02771328017115593,
"height": 0.008247338235378265
},
"confidence_score": 1
}
]
},
"base64": {
"fields": [
{
"key": "Company name",
"value": "SC AUCHAN ROMANIA SA",
"bounding_box": {
"left": 83,
"top": 90,
"width": 137,
"height": 18
},
"confidence_score": 0.99
},
{
"key": "Company address",
"value": "1 BUC X 3,60\nPATE DE",
"bounding_box": {
"left": 10,
"top": 470,
"width": 164,
"height": 37
},
"confidence_score": 1
},
{
"key": "Phone number",
"value": "021-9141",
"bounding_box": {
"left": 193,
"top": 1373,
"width": 56,
"height": 15
},
"confidence_score": 0.92
},
{
"key": "Card number",
"value": "168,95",
"bounding_box": {
"left": 13,
"top": 831,
"width": 271,
"height": 21
},
"confidence_score": 0.99
},
{
"key": "Date",
"value": "2022-04-02",
"bounding_box": {
"left": 11,
"top": 1087,
"width": 120,
"height": 17
},
"confidence_score": 1
},
{
"key": "Time",
"value": "12:29:23",
"bounding_box": {
"left": 230,
"top": 1083,
"width": 59,
"height": 16
},
"confidence_score": 1
},
{
"key": "Receipt no",
"value": "1081-00024",
"bounding_box": {
"left": 15,
"top": 1486,
"width": 278,
"height": 18
},
"confidence_score": 0.53
},
{
"key": "Card type",
"value": "Mastercard",
"bounding_box": {
"left": 217,
"top": 1026,
"width": 70,
"height": 14
},
"confidence_score": 0.99
},
{
"key": "Tax",
"value": "24.52",
"bounding_box": {
"left": 14,
"top": 1297,
"width": 145,
"height": 17
},
"confidence_score": 0.99
},
{
"key": "Total",
"value": "168.95",
"bounding_box": {
"left": 13,
"top": 784,
"width": 271,
"height": 33
},
"confidence_score": 0.99
}
]
}
}
请求参数
Header 参数
content-type
string
必需
示例值:
application/json
Authorization
string
必需
默认值:
Bearer <your_key>
Body 参数application/json
返回响应
修改于 2024-04-11 07:13:26