{
    "openapi": "3.0.0",
    "info": {
        "title": "图像标签 - API文档",
        "version": "1.0.0",
        "description": "支持识别图片中出现的各种物体或场景，覆盖绝大部分日常物品、动植物、商品、城市建筑、山川湖海等等，可用于相册智能分析分类等。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/imgtag\/index": {
            "post": {
                "summary": "图像标签",
                "tags": [
                    "图像标签"
                ],
                "description": "传递图像资源返回图像分类标签",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "img": {
                                        "type": "string",
                                        "example": "base64",
                                        "description": "图片base64编码（与imgurl参数二选一）"
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "imgurl": {
                                        "type": "string",
                                        "example": "https:\/\/www.tianapi.com\/static\/img\/ocr\/nxxy.jpg",
                                        "description": "图片URL地址（支持jpg\/png\/bmp格式）"
                                    }
                                },
                                "required": [
                                    "img",
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "name": {
                                            "type": "string",
                                            "example": "晚霞",
                                            "description": "标签名称"
                                        },
                                        "first": {
                                            "type": "string",
                                            "example": "场景",
                                            "description": "一级分类"
                                        },
                                        "trust": {
                                            "type": "int",
                                            "example": 98,
                                            "description": "置信度，1-100"
                                        },
                                        "second": {
                                            "type": "string",
                                            "example": "天气现象",
                                            "description": "二级分类"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "name": "房屋",
                                                "first": "场景",
                                                "trust": 62,
                                                "second": "生活居住场所"
                                            },
                                            {
                                                "name": "公寓",
                                                "first": "场景",
                                                "trust": 85,
                                                "second": "生活居住场所"
                                            },
                                            {
                                                "name": "天空",
                                                "first": "场景",
                                                "trust": 99,
                                                "second": "自然风光"
                                            },
                                            {
                                                "name": "晚霞",
                                                "first": "场景",
                                                "trust": 98,
                                                "second": "天气现象"
                                            },
                                            {
                                                "name": "人",
                                                "first": "人物",
                                                "trust": 97,
                                                "second": "人像"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}