获取解析结果接口
更新时间:2026-09-16
PaddleOCR-VL-1.6-0.9B :多模态文档解析领域的 SOTA 方案,具备全要素精准解析能力,可高效识别印刷文本、手写文本、表格、公式、图表、印章等复杂文档元素;基于人类阅读习惯智能推断内容排列顺序,将零散页面信息转化为有序带标签的结构化元素序列,同时支持行级别坐标精准输出。方案覆盖中、英、日、韩、拉丁文等 100+ 种语言,完美适配全球化多语种文档处理需求;还可攻克不规则布局定位、长文档跨页解析等行业难点,全面覆盖企业级复杂文档处理场景。
POST
https://aip.baidubce.com/rest/2.0/brain/online/v2/paddle-vl-parser/task/query
权限说明
调用本文API,需使用API Key鉴权方式。使用API Key鉴权调用API流程,具体调用流程,请查看认证鉴权
请求参数
Headers 参数
除公共头域外,还包含以下特殊头域
Authorization
string
API Key 鉴权,示例值:Bearer {API-Key}
必选
Content-Type
string
application/x-www-form-urlencoded
必选
Body 参数
task_id
string
发送提交请求时返回的task_id
必选
请求结构
POST /rest/2.0/brain/online/v2/paddle-vl-parser/task HTTP/1.1
Host: aip.baidubce.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
file_data=base64编码的文件内容&file_name=test.pdf
示例代码
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
log_id
integer
唯一的log id,用于问题定位
可选
error_code
integer
错误码
可选
error_msg
string
错误描述信息
可选
result
object {5}
返回的结果
可选
显示子属性
隐藏子属性
task_id
string
任务ID
可选
status
string
任务状态:pending(排队中)、processing(运行中)、success(成功)、failed(失败)
可选
task_error
string
解析报错信息,包含任务失败、额度不够
可选
markdown_url
string
文档解析结果的markdown格式链接,链接有效期30天
可选
parse_result_url
string
文档解析结果的bos链接,有效期30天。可通过parse_result_url下载解析结果的JSON文件,返回参数如下:
- file_name (string):文档名称
- file_id (string):文档ID
- pages (array):单页解析内容列表,每页包含:
- page_id (string):页码ID
- page_num (int):页码数
- page_angle (int):旋转角度值,取值0~359
- text (string):当前页纯文字内容
- layouts (array):版式分析结果,每项包含:
- layout_id (string):layout元素唯一标志,以xxxxx-layout-{global_layout_index}形式,global_layout_index为layout元素整个文档的全局索引
- text (string):layout对应的文本内容,type为table或image时该字段为空,需到tables或images字段查找
- position (array):layout元素在页面中的位置[x, y, w, h],左上角坐标和宽高
- polygon (array):layout元素在页面中的顶点坐标列表,可围合成多边形
- span_boxes (array):行信息,return_span_boxes=true时有值,每项包含:
- text (list):行内文本内容
- location (list):行坐标
- type (string):layout元素类型,可取值:abstract(摘要)、algorithm(算法)、aside_text(旁注文本)、chart(图表)、content(目录)、display_formula(公式)、doc_title(文档标题)、figure_title(图片标题)、footer(页脚)、footer_image(页脚图片)、footnote(脚注)、formula_number(公式编号)、header(页眉)、header_image(页眉图片)、image(图片)、inline_formula(行内公式)、number(页码)、paragraph_title(段落标题)、reference(参考文献)、reference_content(参考文献内容)、seal(印章)、table(表格)、text(文本)、vertical_text(竖排文本)
- sub_type (string):标题层级,relevel_titles=true时有值
- tables (array):表格解析结果,每项包含:
- layout_id (string):layout ID,与layouts中type为table的元素对应
- markdown (string):表格内容的markdown形式
- position (array):边框数据[x, y, w, h],(x,y)为坐标点,w为box宽度,h为box高度,版式格式时有效
- cells (array):单元格的内嵌版面信息,layout类型为表格时有值
- matrix (array):二维数组,表示表格内布局位置信息,每个元素对应cells列表中元素的索引
- merge_table (string):合并表格标识,merge_tables=true时有值,begin(跨页表格开始)、end(跨页表格结束)
- images (array):图片解析结果,每项包含:
- layout_id (string):layout ID,与layouts中type为image的元素对应
- position (array):边框数据[x, y, w, h],(x,y)为坐标点,w为box宽度,h为box高度,版式格式时有效
- data_url (string):图片存储链接
- image_description (string):对统计图表进行内容解析和描述,输出结果为json字符串,可通过json.loads结构化
- meta (object):页面元信息,包含:
- page_width (int):页面宽度
- page_height (int):页面高度
可选
响应示例
# 成功返回示例
{
"log_id": "23596597899286921761579365582373",
"error_code": 0,
"error_msg": "",
"result":
{
"task_id": "task-UnvGsgbYZp9pS3BZRHn11ifzjNvKzTgf",
"status": "success",
"task_error": null,
"markdown_url": "https:xxxxxxxxxxxxxxxxxxx",
"parse_result_url": "https:xxxxxxxxxxxxxxxxxxx"
}
}
# 解析结果示例
{
"file_name": "示例文件1(文字+表格)更新-改-1.pdf",
"file_id": "file-u9kVDu6dtwMyNrizbejMlF8A852aJLm2",
"pages": [
{
"page_id": "2aJLm2-page-0",
"page_num": 0,
"text": "买卖合同\n甲、乙双方根据《中华人民共和国合同法》及其它相关法律、法规的规定,本着平等、自愿、互利的原则,经友好协商,订立本合同,以资共同信守:\n1.合同标的物信息\n| 序号 | 商品名称 | 产品简称 | 单价 | 数量 | 总价 | 税率 | 备注 |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| 1 | 软件-AI | 中台内网-推理平台+训练平台 | 95,000 | 1 | 905,000 | 13% | 第一单元 |\n| 2 | 硬件【A】 | 服务器 | 30,250 | 37 | 1,11950 | 13% | 第一单元 |\n\n本合同一式【2】份,经双方代表签字盖章生效。甲乙双方各执【3】份,具有同等法律效力。\n1 \n",
"layouts": [
{
"layout_id": "2aJLm2-layout-1",
"text": "买卖合同",
"position": [
263,
109,
103,
28
],
"type": "title"
]
},
{
"layout_id": "2aJLm2-layout-2",
"text": "甲、乙双方根据《中华人民共和国合同法》及其它相关法律、法规的规定,本着平等、自愿、互利的原则,经友好协商,订立本合同,以资共同信守:",
"position": [
84,
160,
444,
31
],
"type": "text"
},
{
"layout_id": "2aJLm2-layout-3",
"text": "1.合同标的物信息",
"position": [
79,
206,
110,
14
],
"type": "title"
},
{
"layout_id": "2aJLm2-layout-4",
"text": "",
"position": [
82,
224,
452,
97
],
"type": "table"
},
{
"layout_id": "2aJLm2-layout-5",
"text": "本合同一式【2】份,经双方代表签字盖章生效。甲乙双方各执【3】份,具有同等法律效力。",
"position": [
79,
348,
456,
31
],
"type": "text"
},
{
"layout_id": "2aJLm2-layout-6",
"text": "1",
"position": [
305,
745,
11,
12
],
"type": "head_tail"
}
],
"tables": [
{
"layout_id": "2aJLm2-layout-4",
"markdown": "| 序号 | 商品名称 | 产品简称 | 单价 | 数量 | 总价 | 税率 | 备注 |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| 1 | 软件-AI | 中台内网-推理平台+训练平台 | 95,000 | 1 | 905,000 | 13% | 第一单元 |\n| 2 | 硬件【A】 | 服务器 | 30,250 | 37 | 1,11950 | 13% | 第一单元 |\n",
"position": [
82,
224,
452,
97
],
"cells": [
{
"layout_id": "2aJLm2-layout-4-0",
"text": "序号",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-1",
"text": "商品名称",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-2",
"text": "产品简称"
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-3",
"text": "单价"
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-4",
"text": "数量"
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-5",
"text": "总价",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-6",
"text": "税率",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-7",
"text": "备注",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-8",
"text": "1",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-9",
"text": "软件-AI ",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-10",
"text": "中台内网-推理平台+训练平台",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-11",
"text": "95,000",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-12",
"text": "1",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-13",
"text": "905,000",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-14",
"text": "13% ",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-15",
"text": "第一单元",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-16",
"text": "2",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-17",
"text": "硬件【A】",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-18",
"text": "服务器",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-19",
"text": "30,250",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-20",
"text": "37",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-21",
"text": "1,11950",
"type": "text"
},
{
"layout_id": "2aJLm2-layout-4-22",
"text": "13% ",
"type": "text"
}
],
"matrix": [
[
0,
1,
2,
3,
4,
5,
6,
7
],
[
8,
9,
10,
11,
12,
13,
14,
15
],
[
16,
17,
18,
19,
20,
21,
22,
15
]
]
}
],
"images": [
{
"layout_id": "Kr9RM7-layout-10",
"position":
[
90,
549,
422,
221
],
"data_url": " "
}
],
"meta": {
"page_width": 612,
"page_height": 792
}
]
}
错误码
如果调用失败并返回报错信息,请参见以下错误码进行解决: 公共错误码:查看公共错误码 OCR 错误码:查看 OCR 错误码
评价此篇文章
