{
  "openapi": "3.0.3",
  "info": {
    "title": "通用综合文字OCR识别",
    "description": "OCR文字识别-表格OCR识别-名片OCR识别-手写体图像OCR识别-通用文字OCR识别。支持将图片上的文字内容，智能识别为可编辑的文本。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/1274-12": {
      "x-pointCode": 12,
      "x-mode": "mapping",
      "x-read-timeout": 20,
      "x-connect-timeout": 20,
      "post": {
        "summary": "通用文字识别",
        "description": "识别图片中的文字,包含单字识别并返回单字坐标、表格识别 可以识别文档上所有表格里面的信息内容，以及旋转功能。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "word": {
                                    "type": "string",
                                    "description": "识别的内容"
                                  },
                                  "rect": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "y": {
                                          "type": "number"
                                        },
                                        "x": {
                                          "type": "number"
                                        }
                                      }
                                    },
                                    "description": "内容在图片中的位置坐标"
                                  },
                                  "prob": {
                                    "type": "number",
                                    "description": "置信度"
                                  },
                                  "angle": {
                                    "type": "number",
                                    "description": "角度"
                                  }
                                }
                              }
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "成功标识，0为成功，成功时计费，其余为失败"
                            },
                            "remark": {
                              "type": "string",
                              "description": "错误描述"
                            },
                            "all_str": {
                              "type": "string",
                              "description": "从左至右，从上至下顺序拼接的文本"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1274_12_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "img_base64": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "图片base64\n同图片url二选一\n"
                  },
                  "img_url": {
                    "type": "string",
                    "description": "图像url地址\n同图片base64二选一\n支持jpg/png/bmp格式"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/1274-8": {
      "x-pointCode": 8,
      "x-mode": "mapping",
      "x-read-timeout": 35,
      "x-connect-timeout": 35,
      "post": {
        "summary": "OCR名片识别",
        "description": "识别各类名片关键字段内容，主要包括：姓名、职位、公司、部门、座机号、手机号、地址、邮箱等信息。\n请保证图片的清晰度，\n建议图片大小不要超过1M。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code": {
                              "type": "number",
                              "description": "0表示识别成功"
                            },
                            "remark": {
                              "type": "string",
                              "description": "错误信息"
                            },
                            "addr": {
                              "type": "string",
                              "description": "地址"
                            },
                            "phone": {
                              "type": "string",
                              "description": "手机号"
                            },
                            "com_name": {
                              "type": "string",
                              "description": "公司名称"
                            },
                            "dep_name": {
                              "type": "string",
                              "description": "部门名称"
                            },
                            "email": {
                              "type": "string",
                              "description": "邮箱地址"
                            },
                            "name": {
                              "type": "string",
                              "description": "姓名"
                            },
                            "career": {
                              "type": "string",
                              "description": "职位信息"
                            },
                            "ext_para_list": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                }
                              },
                              "description": "扩展信息（返回信息不确定）"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1274_8_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "img_base64": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "名片图片生成的base64字符串信息，PHP调用需对该字符串进行URLencode处理，该参数与img_url二选一入参"
                  },
                  "img_url": {
                    "type": "string",
                    "description": "要识别名片图片的URL，该参数与img_base64二选一入参"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/1274-7": {
      "x-pointCode": 7,
      "x-mode": "mapping",
      "x-read-timeout": 60,
      "x-connect-timeout": 60,
      "post": {
        "summary": "手写体图片识别",
        "description": "自动提取及快速识别出图像中手写体内容和文字区域坐标，针对手写字体无规则、字迹潦草、模糊等特点进行了识别能力的增强。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code:": {
                              "type": "number",
                              "description": "成功为0，其实为失败"
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回的描述内容"
                            },
                            "text_results": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "text": {
                                    "type": "string",
                                    "description": "每行的内容"
                                  },
                                  "range": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "x": {
                                          "type": "number",
                                          "description": "该点距离图片左侧的像素"
                                        },
                                        "y": {
                                          "type": "number",
                                          "description": "该点距离图片顶部的像素"
                                        }
                                      }
                                    },
                                    "description": "识别内容所在区域,用四个点来表示"
                                  }
                                }
                              },
                              "description": "内容列表"
                            },
                            "all_str": {
                              "type": "string",
                              "description": "所有识别段落或文字块的长字符串，每个段落或文字块后接\\n"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1274_7_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "img_url": {
                    "type": "string",
                    "description": "图片url"
                  },
                  "img_base64": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "图片base64"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/1274-4": {
      "x-pointCode": 4,
      "x-mode": "mapping",
      "x-read-timeout": 10,
      "x-connect-timeout": 10,
      "post": {
        "summary": "OCR文字识别-V2",
        "description": "自动提取及快速识别出图像中文字内容和文字区域坐标，适用于多场景图像文字识别。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "result": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "text": {
                                    "type": "string"
                                  },
                                  "range": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "y": {
                                          "type": "number"
                                        },
                                        "x": {
                                          "type": "number"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "ret_code": {
                              "type": "number"
                            },
                            "all_str": {
                              "type": "string"
                            },
                            "remark": {
                              "type": "string"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1274_4_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "img_url": {
                    "type": "string",
                    "description": "要识别文字图片的URL地址，img_url和img_base64二选一输入"
                  },
                  "img_base64": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "要识别文字图片的base64字符串编码，img_url和img_base64二选一输入"
                  },
                  "language": {
                    "type": "string",
                    "description": "识别语言类型。\n支持自动识别语言类型，同时支持自选语言种类\n可选值：\nzh\\auto\\jap\\kor\\\nspa\\fre\\ger\\por\\\nvie\\may\\rus\\ita\\\nhol\\swe\\fin\\dan\\\nnor\\hun\\tha\\lat\n可选值分别表示：\n中英文混合、自动识别、日语、韩语、\n西班牙语、法语、德语、葡萄牙语、\n越南语、马来语、俄语、意大利语、\n荷兰语、瑞典语、芬兰语、丹麦语、\n挪威语、匈牙利语、泰语、拉丁语系。"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/1274-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 60,
      "x-connect-timeout": 60,
      "post": {
        "summary": "OCR表格识别",
        "description": "本接口支持中英文图片内常规表格、无线表格、多表格的检测和识别，返回每个单元格的文字内容、坐标（多表格的情况下可能会不太准确，尽量识别单表格）适用于纸质表格文档电子化、数据化，便于存放和管理。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code": {
                              "type": "number"
                            },
                            "results": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "table_index": {
                                    "type": "number",
                                    "description": "表格索引（用来区分多表格）"
                                  },
                                  "table_cells": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "confidence_level": {
                                          "type": "number",
                                          "description": "置信度（0~99.9999之间）"
                                        },
                                        "text": {
                                          "type": "string",
                                          "description": "表格内容"
                                        },
                                        "row_index": {
                                          "type": "number",
                                          "description": "以左上角为基准的列索引"
                                        },
                                        "range": {
                                          "type": "array",
                                          "items": {
                                            "type": "object"
                                          },
                                          "description": "识别内容所在区域,用四个点来表示"
                                        },
                                        "col_num": {
                                          "type": "number",
                                          "description": "所占列数"
                                        },
                                        "row_num": {
                                          "type": "number",
                                          "description": "所占行数"
                                        },
                                        "col_index": {
                                          "type": "number",
                                          "description": "以左上角为基准的行索引"
                                        }
                                      }
                                    },
                                    "description": "表格内容信息数组，包括所有识别信息"
                                  }
                                }
                              },
                              "description": "识别结果"
                            },
                            "all_str": {
                              "type": "string",
                              "description": "所有识别表格中文字块的长字符串，每个表格中文字块后接英文空格"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1274_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "img_url": {
                    "type": "string",
                    "description": "表格的图片下载地址"
                  },
                  "img_base64": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "表格相应图片的base64字符串"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/1274?tab=book"
  },
  "x-apiCode": "1274",
  "x-is-own": false,
  "x-is-op": true
}