{
    "openapi": "3.0.0",
    "info": {
        "title": "垃圾分类 - API文档",
        "version": "1.0.0",
        "description": "<p>垃圾分类成为城市生活新时尚，但也成为大家的新烦恼。本接口支持查询绝大部分生活中常见或不常见的废弃物垃圾类型，支持精确搜索和模糊搜索，并给出分类建议。目前已有近万条废弃物种类数据，针对用户输入的复杂长尾词也有智能预判机制。同时系统会根据查询结果不断增加新的数据，以及根据政策和指导建议优化分类。相关新闻：<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/apiview\/188\">垃圾分类新闻接口<\/a>、环保新闻：<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/apiview\/168\">环保资讯接口<\/a><\/p>\n\n<p>其他相关：<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/apiview\/101\">垃圾分类图像识别接口<\/a>、<a target=\"_blank\" href=\"https:\/\/www.tianapi.com\/apiview\/107\">垃圾分类搜索热点接口<\/a>、示例小程序下载：<a href=\"https:\/\/www.tianapi.com\/article\/97\" target=\"_blank\">垃圾分类小程序升级版分享，支持下拉联想选择<\/a><\/p>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/lajifenlei\/index": {
            "get": {
                "summary": "垃圾分类查询",
                "tags": [
                    "垃圾分类"
                ],
                "description": "根据物品名称查询垃圾分类",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "num",
                        "in": "query",
                        "description": "返回数量",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 10,
                            "description": "返回数量"
                        }
                    },
                    {
                        "name": "mode",
                        "in": "query",
                        "description": "查询模式，0模糊查询[默认]、1精确查询",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "查询模式，0模糊查询[默认]、1精确查询"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "翻页",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "翻页"
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "废弃物名称",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "眼镜",
                            "description": "废弃物名称"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tip": {
                                            "type": "string",
                                            "example": "轻投轻放；清洁干燥，避免污染，费纸尽量平整......",
                                            "description": "投放提示"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "智能眼镜",
                                            "description": "废弃物名称"
                                        },
                                        "type": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "垃圾分类，0为可回收、1为有害、2为厨余(湿)、3为其他(干)"
                                        },
                                        "aipre": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "智能预判，0为正常结果，1为预判结果"
                                        },
                                        "contain": {
                                            "type": "string",
                                            "example": "各类废金属、玻璃瓶、易拉罐、饮料瓶......",
                                            "description": "包含类型"
                                        },
                                        "explain": {
                                            "type": "string",
                                            "example": "适宜回收、可循环利用的生活废弃物",
                                            "description": "分类解释"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "tip": "尽量沥干水分；难以辨识类别的生活垃圾都可以投入干垃圾容器内",
                                                "name": "隐形眼镜",
                                                "type": 3,
                                                "aipre": 0,
                                                "contain": "常见包括砖瓦陶瓷、渣土、卫生间废纸、猫砂、污损塑料、毛发、硬壳、一次性制品、灰土、瓷器碎片等难以回收的废弃物",
                                                "explain": "干垃圾即其它垃圾，指除可回收物、有害垃圾、厨余垃圾（湿垃圾）以外的其它生活废弃物。"
                                            },
                                            {
                                                "tip": "尽量沥干水分；难以辨识类别的生活垃圾都可以投入干垃圾容器内",
                                                "name": "眼镜",
                                                "type": 3,
                                                "aipre": 0,
                                                "contain": "常见包括砖瓦陶瓷、渣土、卫生间废纸、猫砂、污损塑料、毛发、硬壳、一次性制品、灰土、瓷器碎片等难以回收的废弃物",
                                                "explain": "干垃圾即其它垃圾，指除可回收物、有害垃圾、厨余垃圾（湿垃圾）以外的其它生活废弃物。"
                                            },
                                            {
                                                "tip": "轻投轻放；清洁干燥，避免污染，费纸尽量平整；立体包装物请清空内容物，清洁后压扁投放；有尖锐边角的、应包裹后投放",
                                                "name": "智能眼镜",
                                                "type": 0,
                                                "aipre": 0,
                                                "contain": "常见包括各类废金属、玻璃瓶、易拉罐、饮料瓶、塑料玩具、书本、报纸、广告单、纸板箱、衣服、床上用品、电子产品等",
                                                "explain": "可回收垃圾是指适宜回收、可循环利用的生活废弃物。"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "垃圾分类查询",
                "tags": [
                    "垃圾分类"
                ],
                "description": "根据物品名称查询垃圾分类",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "num": {
                                        "type": "int",
                                        "example": 10,
                                        "description": "返回数量"
                                    },
                                    "mode": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "查询模式，0模糊查询[默认]、1精确查询"
                                    },
                                    "page": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "翻页"
                                    },
                                    "word": {
                                        "type": "string",
                                        "example": "眼镜",
                                        "description": "废弃物名称"
                                    }
                                },
                                "required": [
                                    "key",
                                    "word"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tip": {
                                            "type": "string",
                                            "example": "轻投轻放；清洁干燥，避免污染，费纸尽量平整......",
                                            "description": "投放提示"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "智能眼镜",
                                            "description": "废弃物名称"
                                        },
                                        "type": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "垃圾分类，0为可回收、1为有害、2为厨余(湿)、3为其他(干)"
                                        },
                                        "aipre": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "智能预判，0为正常结果，1为预判结果"
                                        },
                                        "contain": {
                                            "type": "string",
                                            "example": "各类废金属、玻璃瓶、易拉罐、饮料瓶......",
                                            "description": "包含类型"
                                        },
                                        "explain": {
                                            "type": "string",
                                            "example": "适宜回收、可循环利用的生活废弃物",
                                            "description": "分类解释"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "tip": "尽量沥干水分；难以辨识类别的生活垃圾都可以投入干垃圾容器内",
                                                "name": "隐形眼镜",
                                                "type": 3,
                                                "aipre": 0,
                                                "contain": "常见包括砖瓦陶瓷、渣土、卫生间废纸、猫砂、污损塑料、毛发、硬壳、一次性制品、灰土、瓷器碎片等难以回收的废弃物",
                                                "explain": "干垃圾即其它垃圾，指除可回收物、有害垃圾、厨余垃圾（湿垃圾）以外的其它生活废弃物。"
                                            },
                                            {
                                                "tip": "尽量沥干水分；难以辨识类别的生活垃圾都可以投入干垃圾容器内",
                                                "name": "眼镜",
                                                "type": 3,
                                                "aipre": 0,
                                                "contain": "常见包括砖瓦陶瓷、渣土、卫生间废纸、猫砂、污损塑料、毛发、硬壳、一次性制品、灰土、瓷器碎片等难以回收的废弃物",
                                                "explain": "干垃圾即其它垃圾，指除可回收物、有害垃圾、厨余垃圾（湿垃圾）以外的其它生活废弃物。"
                                            },
                                            {
                                                "tip": "轻投轻放；清洁干燥，避免污染，费纸尽量平整；立体包装物请清空内容物，清洁后压扁投放；有尖锐边角的、应包裹后投放",
                                                "name": "智能眼镜",
                                                "type": 0,
                                                "aipre": 0,
                                                "contain": "常见包括各类废金属、玻璃瓶、易拉罐、饮料瓶、塑料玩具、书本、报纸、广告单、纸板箱、衣服、床上用品、电子产品等",
                                                "explain": "可回收垃圾是指适宜回收、可循环利用的生活废弃物。"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}