百度云-文字识别
连接器

百度云-文字识别

连接器

需两次购买:①订购原厂商接口 ②订购易源会员包代理转发;覆盖多种通用场景、多种语言的高精度整图文字检测和识别服务,包括各类印刷和手写文档、网络图片、表格、数字、二维码等;可用于纸质文档电子化、办公文档/报表识别、图像内容审核、快递面单识别等场景。

会员资源包统一计费,无需单独购买,开通会员包后可直接调用。
试卷分析与识别
接入点说明
可对文档版面进行分析,输出图、表、标题、文本的位置,并输出分版块内容的OCR识别结果,支持中、英两种语言,手写、印刷体混排多种场景。原接口订购地址:https://cloud.baidu.com/product/ocr_education
接口地址
https://connector.showapi.com/2568-32?appKey={your_appKey}查看密钥调用帮助
返回格式JSON
请求方式POST
案例截图
案例
请求参数
Header 参数
参数名称类型示例值必须描述
content-typeString
application/x-www-form-urlencoded
Post 表单
参数名称类型示例值必须描述
ds_idString
-
数据源
imageString
-
图像数据,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式
优先级:image > url > pdf_file,当image字段存在时,url、pdf_file字段失效
urlString
http://showapi-pub-shanghai.oss-cn-shanghai.aliyuncs.com/api/2568/2568-32.jpg
图片完整url,url长度不超过1024字节,url对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式
优先级:image > url > pdf_file,当image字段存在时,url字段失效
请注意关闭URL防盗链
pdf_fileString
-
PDF文件,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px
优先级:image > url > pdf_file,当image、url字段存在时,pdf_file字段失效
pdf_file_numString
-
需要识别的PDF文件的对应页码,当 pdf_file 参数有效时,识别传入页码的对应页面内容,若不传入,则默认识别第 1 页
language_typeString
-
识别语言类型,默认为CHN_ENG
可选值包括:
= CHN_ENG:中英文
= ENG:英文
result_typeString
-
返回识别结果是按单行结果返回,还是按单字结果返回,默认为big。
= big:返回行识别结果
= small:返回行识别结果之上还会返回单字结果
detect_directionString
-
	是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。其中,
0 :正向
1:逆时针旋转90度
2:逆时针旋转180度
3:逆时针旋转270度
line_probabilityString
-
是否返回每行识别结果的置信度。默认为false
words_typeString
-
文字类型。
默认:印刷文字识别
= handwring_only:手写文字识别
= handprint_mix: 手写印刷混排识别
layout_analysisString
-
是否分析文档版面:包括layout(图、表、标题、段落、目录);attribute(栏、页眉、页脚、页码、脚注)的分析输出
recg_formulaString
-
是否检测并识别公式,默认为false,公式以 Latex 格式文本返回。
=true:检测并识别公式
=false:不检测识别公式
返回参数
该接口返回经 showapi_res_body 系统封装,业务数据均位于该对象内;系统级字段见
返回体
cURL
curl -X POST "https://connector.showapi.com/2568-32?appKey=YOUR_APPKEY" \
  -H "content-type: application/x-www-form-urlencoded" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "ds_id=&image=&url=http%3A%2F%2Fshowapi-pub-shanghai.oss-cn-shanghai.aliyuncs.com%2Fapi%2F2568%2F2568-32.jpg&pdf_file=&pdf_file_num=&language_type=&result_type=&detect_direction=&line_probability=&words_type=&layout_analysis=&recg_formula="
返回示例
JSON
{
  "showapi_res_error": "",
  "showapi_res_code": 0,
  "showapi_res_id": "6030b5a48d57bad81f6139bb",
  "showapi_res_body": {
    "layouts_num": 0,
    "ret_code": 0,
    "results_num": 74,
    "img_direction": 0,
    "results": [
      {
        "words": {
          "words_location": {
            "height": 20,
            "width": 158,
            "left": 69,
            "top": 20
          },
          "line_probability": {},
          "word": "更多免费试题下载"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 20,
            "width": 271,
            "left": 258,
            "top": 20
          },
          "line_probability": {},
          "word": "武汉奥数网http:/wh.aoshu ..com"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 23,
            "width": 362,
            "left": 94,
            "top": 67
          },
          "line_probability": {},
          "word": "北师大版二年级上册语文期中试卷"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 40,
            "left": 113,
            "top": 110
          },
          "line_probability": {},
          "word": "班级"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 39,
            "left": 225,
            "top": 110
          },
          "line_probability": {},
          "word": "姓名"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 38,
            "left": 340,
            "top": 110
          },
          "line_probability": {},
          "word": "成绩"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 346,
            "left": 21,
            "top": 143
          },
          "line_probability": {},
          "word": "要仔细认真,读懂题目要求,按要求答题,书写要工整"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 169,
            "left": 21,
            "top": 162
          },
          "line_probability": {},
          "word": "一、基础知识。(63分)"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 552,
            "left": 22,
            "top": 183
          },
          "line_probability": {},
          "word": "1、在大写字母后面写上小写字母,并按字母表的顺序排列下面的大写字母。(5"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 25,
            "left": 21,
            "top": 204
          },
          "line_probability": {},
          "word": "分)"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 28,
            "left": 20,
            "top": 226
          },
          "line_probability": {},
          "word": "D ("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 21,
            "width": 401,
            "left": 67,
            "top": 224
          },
          "line_probability": {},
          "word": "H()B()Q()L()"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 43,
            "left": 96,
            "top": 225
          },
          "line_probability": {},
          "word": ")H("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 43,
            "left": 187,
            "top": 225
          },
          "line_probability": {},
          "word": ")B("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 44,
            "left": 277,
            "top": 225
          },
          "line_probability": {},
          "word": ")Q("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 55,
            "left": 367,
            "top": 225
          },
          "line_probability": {},
          "word": ")L("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 16,
            "width": 27,
            "left": 20,
            "top": 246
          },
          "line_probability": {},
          "word": "N ("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 43,
            "left": 97,
            "top": 245
          },
          "line_probability": {},
          "word": ")G("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 43,
            "left": 188,
            "top": 246
          },
          "line_probability": {},
          "word": ")R("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 33,
            "left": 278,
            "top": 247
          },
          "line_probability": {},
          "word": ")J("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 32,
            "left": 372,
            "top": 249
          },
          "line_probability": {},
          "word": ")A("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 12,
            "left": 458,
            "top": 249
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 78,
            "left": 485,
            "top": 267
          },
          "line_probability": {},
          "word": "2、看拼音,"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 163,
            "left": 22,
            "top": 287
          },
          "line_probability": {},
          "word": "写词语和句子。(15分)"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 12,
            "width": 64,
            "left": 20,
            "top": 312
          },
          "line_probability": {},
          "word": "wen nuon "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 49,
            "left": 132,
            "top": 310
          },
          "line_probability": {},
          "word": "tu Jin "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 66,
            "left": 243,
            "top": 311
          },
          "line_probability": {},
          "word": "jin zhang "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 68,
            "left": 388,
            "top": 311
          },
          "line_probability": {},
          "word": "rong y "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 6,
            "left": 80,
            "top": 333
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 6,
            "left": 127,
            "top": 331
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 7,
            "left": 195,
            "top": 332
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 8,
            "left": 326,
            "top": 332
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 7,
            "left": 481,
            "top": 332
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 58,
            "left": 22,
            "top": 353
          },
          "line_probability": {},
          "word": "chi tang "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 53,
            "left": 134,
            "top": 353
          },
          "line_probability": {},
          "word": "lin ju "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 67,
            "left": 395,
            "top": 353
          },
          "line_probability": {},
          "word": "zhuongjia "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 8,
            "left": 28,
            "top": 371
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 8,
            "left": 92,
            "top": 371
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 8,
            "left": 212,
            "top": 370
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 8,
            "left": 259,
            "top": 373
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 8,
            "left": 335,
            "top": 374
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 7,
            "left": 491,
            "top": 374
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 37,
            "left": 46,
            "top": 396
          },
          "line_probability": {},
          "word": "que "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 12,
            "width": 43,
            "left": 136,
            "top": 395
          },
          "line_probability": {},
          "word": "tu ron "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 13,
            "width": 61,
            "left": 257,
            "top": 396
          },
          "line_probability": {},
          "word": "nong cuo "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 13,
            "width": 45,
            "left": 398,
            "top": 395
          },
          "line_probability": {},
          "word": "kou ke "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 6,
            "left": 21,
            "top": 415
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 8,
            "left": 89,
            "top": 414
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 6,
            "left": 128,
            "top": 414
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 9,
            "left": 195,
            "top": 415
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 9,
            "left": 248,
            "top": 411
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 9,
            "left": 391,
            "top": 412
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 16,
            "width": 529,
            "left": 36,
            "top": 435
          },
          "line_probability": {},
          "word": "yo xi huan ting ting de ,le hu li de dang ."
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 7,
            "left": 28,
            "top": 453
          },
          "line_probability": {},
          "word": "("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 9,
            "left": 36,
            "top": 474
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 300,
            "left": 20,
            "top": 495
          },
          "line_probability": {},
          "word": "3、给下面的多音字、形近字组词。(12分)"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 23,
            "left": 44,
            "top": 516
          },
          "line_probability": {},
          "word": "i "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 13,
            "width": 42,
            "left": 21,
            "top": 519
          },
          "line_probability": {},
          "word": "wei "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 7,
            "left": 132,
            "top": 515
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 38,
            "left": 292,
            "top": 517
          },
          "line_probability": {},
          "word": "mei ("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 7,
            "left": 390,
            "top": 515
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 15,
            "width": 14,
            "left": 22,
            "top": 537
          },
          "line_probability": {},
          "word": "为"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 17,
            "left": 284,
            "top": 537
          },
          "line_probability": {},
          "word": "没"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 7,
            "left": 133,
            "top": 556
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 33,
            "left": 292,
            "top": 560
          },
          "line_probability": {},
          "word": "mo ("
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 8,
            "left": 385,
            "top": 557
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 7,
            "left": 133,
            "top": 579
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 17,
            "width": 8,
            "left": 388,
            "top": 579
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 16,
            "width": 16,
            "left": 21,
            "top": 600
          },
          "line_probability": {},
          "word": "都"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 16,
            "width": 17,
            "left": 283,
            "top": 601
          },
          "line_probability": {},
          "word": "难"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 13,
            "width": 38,
            "left": 22,
            "top": 622
          },
          "line_probability": {},
          "word": "dou "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 7,
            "left": 133,
            "top": 619
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 14,
            "width": 37,
            "left": 291,
            "top": 622
          },
          "line_probability": {},
          "word": "nan "
        },
        "chars": [],
        "words_type": "print"
      },
      {
        "words": {
          "words_location": {
            "height": 18,
            "width": 8,
            "left": 396,
            "top": 619
          },
          "line_probability": {},
          "word": ")"
        },
        "chars": [],
        "words_type": "print"
      }
    ],
    "log_id": 1363022928421060600
  }
}
MCP 服务集成接口级

在 Cherry Studio、ChatBox 等支持 MCP 的客户端中配置,将 {your_appKey} 替换为真实 AppKey(AppKey 管理)。该服务覆盖本接口全部接入点。

MCP JSON
{
  "mcpServers": {
    "showapi-mcp-2568": {
      "url": "http://www.showapi.com.cn/mcp/2568/{your_appKey}"
    }
  }
}
OpenAPI 文档接口级

标准 OpenAPI 3.0 文档,覆盖本接口全部接入点,可导入 Apifox / Postman / Swagger UI,或供 AI Agent 直接消费。