{
  "openapi": "3.0.3",
  "info": {
    "title": "二维码-专业版",
    "description": "为用户提供在线二维码生成器及其识别功能，其中二维码识别支持Base64、上传图片及复制图片地址识别等方式。广泛应用于宣传海报、简历、餐桌牌同步点餐、二维码上网、产品溯源及扫码支付等应用场景。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/2343-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 35,
      "x-connect-timeout": 35,
      "post": {
        "summary": "专业二维码识别",
        "description": "对图片中的二维码信息进行识别解码（只能识别二维码），支持一图多码识别，建议识别的图片不要超过1.5M，支持jpg，png，bmp图片",
        "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": "ret_code = 0 无异常\n       10 参数错误\n        20 文件格式错误\n        30 操作失败,请勿重复提交\n        40 文件下载失败\n        50 文件内容过大\n        60 图片解析失败\n        70 OCR识别失败\n         80 服务超时\n         90 未知错误(error_code)"
                            },
                            "result": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "没有找到二维码时返回一个空集合（要扣费），否则这个对象中返回的是二维码解码的结果。"
                            },
                            "remark": {
                              "type": "string",
                              "description": "错误信息"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2343_2_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_base64和img_url两个参数二选一入参"
                  },
                  "img_url": {
                    "type": "string",
                    "description": "要识别图片的URL。base64和img_url两个参数二选一入参"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/2343-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 25,
      "x-connect-timeout": 10,
      "post": {
        "summary": "专业二维码生成",
        "description": "把电子名片、文本、wifi网络、电子邮件、短信、电话号码、网址等信息生成对应的二维码图片。我们生成的二维码链接每日会定期清理，请您及时保存哦。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code": {
                              "type": "string",
                              "description": "0表示成功，其他为失败"
                            },
                            "flag": {
                              "type": "string"
                            },
                            "msg": {
                              "type": "string",
                              "description": "错误信息"
                            },
                            "imgUrl": {
                              "type": "string",
                              "description": "生成的二维码链接，这个链接中的图片每天会定期删除"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2343_1_POST",
        "parameters": [
          {
            "name": "content",
            "in": "query",
            "description": "需要生成二维码的内容",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "图片大小 整数类型:1-10 ,1最小，10最大，值为偶数时生成的二维码边框会比奇数时大一点，content内容较多建议使用小于5的值，content内容较少建议使用大于6的值，二维码图片宽度大约等于content的字节数*size的值，若content实在太少，比如content内容只有1个字节，我们还提供了16，20，30这三个大号size。",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "imgExtName",
            "in": "query",
            "description": "图片格式:jpeg,jpg,png或者gif",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "logo_base64",
            "in": "query",
            "description": "只支持png格式。二维码中间嵌入的logo图片的base64值，传入此参数时建议使用POST方式发起调用，若使用PHP，该值需进行URLencode处理，最大只能上传50KB的图片",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "forecolor_rgb",
            "in": "query",
            "description": "二维码图片前景色的色号，默认#000000（黑色）",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "background_rgb",
            "in": "query",
            "description": "二维码图片背景色的色号#FFFFFF（白色）",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "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/2343?tab=book"
  },
  "x-apiCode": "2343",
  "x-is-own": true,
  "x-is-op": true
}