{
    "openapi": "3.0.0",
    "info": {
        "title": "条形码识别 - API文档",
        "version": "1.0.0",
        "description": "支持快速、准确的识别各种类型的条形码，包括一维码、二维码、PDF417码等，图片base64或图片url实际大小不超过6M。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/ocrbarcode\/index": {
            "get": {
                "summary": "条形码识别",
                "tags": [
                    "条形码识别"
                ],
                "description": "OCR条形码识别，场景应用助手",
                "parameters": [
                    {
                        "name": "img",
                        "in": "query",
                        "description": "条形码图片base64编码",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "base64",
                            "description": "条形码图片base64编码"
                        }
                    },
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "imgurl",
                        "in": "query",
                        "description": "条形码图片地址(二选一)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "https:\/\/www.tianapi.com\/static\/img\/ocr\/barcode.jpg",
                            "description": "条形码图片地址(二选一)"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "text": {
                                            "type": "string",
                                            "example": "6232878723987956",
                                            "description": "识别内容"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "text": "6232878723987956"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "条形码识别",
                "tags": [
                    "条形码识别"
                ],
                "description": "OCR条形码识别，场景应用助手",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "img": {
                                        "type": "string",
                                        "example": "base64",
                                        "description": "条形码图片base64编码"
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "imgurl": {
                                        "type": "string",
                                        "example": "https:\/\/www.tianapi.com\/static\/img\/ocr\/barcode.jpg",
                                        "description": "条形码图片地址(二选一)"
                                    }
                                },
                                "required": [
                                    "key",
                                    "imgurl"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "text": {
                                            "type": "string",
                                            "example": "6232878723987956",
                                            "description": "识别内容"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "text": "6232878723987956"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}