小小API是一个稳定 快速 的 API 接口服务   点击加入QQ群

OCR图片识别接口

GEThttps://v2.xxapi.cn/api/ocr

接口描述

能够从图像中提取文本信息。用户只需上传包含文本的图像,系统将自动识别并返回提取的文本内容。

请求参数

广告
广告
广告
广告

请求示例

< !--导入JQ -->
  <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>

  <script>
    $.ajax({
      url: 'https://v2.api-m.com/api/ocr?url=https://cdn.xxhzm.cn/api/wenchangdijun/lq_lqwc_1.jpg',
      type: 'get',
      beforeSend: function () {
        //请求中执行的代码
      },
      complete: function () {
        //请求完成执行的代码
      },
      error: function () {
        //请求成功失败执行的代码
      },
      success: function (res) {
        // 状态码 200 表示请求成功
        if (res.code === 200) {
          console.log(res)
        } else {
          console.log(res)
        }
      }
    })
  </script>

返回示例

{
    "code": 200,
    "msg": "数据请求成功",
    "data": {
        "height": 800,
        "pic": "https://cdn.xxhzm.cn/v2api/ocr/06d2c00dbb6bf547a94744d6129adbdc.jpg",
        "result": [
            {
                "text": "签层",
                "x0": 211,
                "x1": 418,
                "x2": 417,
                "x3": 210,
                "y0": 678,
                "y1": 680,
                "y2": 760,
                "y3": 758
            },
            {
                "text": "富",
                "x0": 28,
                "x1": 200,
                "x2": 208,
                "x3": 36,
                "y0": 672,
                "y1": 659,
                "y2": 770,
                "y3": 783
            },
            {
                "text": "山汝班间",
                "x0": 66,
                "x1": 270,
                "x2": 270,
                "x3": 66,
                "y0": 436,
                "y1": 434,
                "y2": 471,
                "y3": 473
            },
            {
                "text": "如付一",
                "x0": 62,
                "x1": 235,
                "x2": 235,
                "x3": 62,
                "y0": 388,
                "y1": 386,
                "y2": 430,
                "y3": 432
            },
            {
                "text": "云",
                "x0": 236,
                "x1": 269,
                "x2": 269,
                "x3": 236,
                "y0": 390,
                "y1": 390,
                "y2": 427,
                "y3": 427
            },
            {
                "text": "寿天第向",
                "x0": 66,
                "x1": 270,
                "x2": 270,
                "x3": 66,
                "y0": 345,
                "y1": 345,
                "y2": 382,
                "y3": 382
            },
            {
                "text": "海华官步",
                "x0": 65,
                "x1": 270,
                "x2": 270,
                "x3": 65,
                "y0": 299,
                "y1": 297,
                "y2": 334,
                "y3": 336
            },
            {
                "text": "东荣干独",
                "x0": 65,
                "x1": 272,
                "x2": 272,
                "x3": 65,
                "y0": 251,
                "y1": 251,
                "y2": 291,
                "y3": 291
            },
            {
                "text": "如贵殿巍",
                "x0": 65,
                "x1": 271,
                "x2": 271,
                "x3": 65,
                "y0": 204,
                "y1": 204,
                "y2": 245,
                "y3": 245
            },
            {
                "text": "签文",
                "x0": 300,
                "x1": 341,
                "x2": 341,
                "x3": 300,
                "y0": 187,
                "y1": 187,
                "y2": 297,
                "y3": 297
            },
            {
                "text": "第一签甲甲大吉签",
                "x0": 385,
                "x1": 431,
                "x2": 433,
                "x3": 387,
                "y0": 163,
                "y1": 163,
                "y2": 561,
                "y3": 561
            },
            {
                "text": "福富玉巍",
                "x0": 67,
                "x1": 269,
                "x2": 269,
                "x3": 67,
                "y0": 160,
                "y1": 162,
                "y2": 196,
                "y3": 194
            },
            {
                "text": "文昌帝君灵签",
                "x0": 142,
                "x1": 358,
                "x2": 358,
                "x3": 142,
                "y0": 76,
                "y1": 76,
                "y2": 110,
                "y3": 110
            },
            {
                "text": ":",
                "x0": 34,
                "x1": 48,
                "x2": 48,
                "x3": 34,
                "y0": 39,
                "y1": 39,
                "y2": 51,
                "y3": 51
            },
            {
                "text": "P",
                "x0": 446,
                "x1": 467,
                "x2": 467,
                "x3": 446,
                "y0": 34,
                "y1": 34,
                "y2": 51,
                "y3": 51
            }
        ],
        "width": 500
    }
}