{
    "openapi": "3.0.0",
    "info": {
        "title": "地区搜索 - API文档",
        "version": "1.0.0",
        "description": "此接口可搜索某地区（市区县级行政区）行政区划代码、城市天气ID和行政区划类型等信息。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/citylookup\/index": {
            "get": {
                "summary": "地区搜索",
                "tags": [
                    "地区搜索"
                ],
                "description": "通过地区名称搜索上下级关联城市",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "num",
                        "in": "query",
                        "description": "返回数量，取值1-50",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 10,
                            "description": "返回数量，取值1-50"
                        }
                    },
                    {
                        "name": "area",
                        "in": "query",
                        "description": "地区名称",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "西安",
                            "description": "地区名称"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "翻页",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "翻页"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "adcode": {
                                            "type": "string",
                                            "example": "231005",
                                            "description": "地区行政代码"
                                        },
                                        "areacn": {
                                            "type": "string",
                                            "example": "西安",
                                            "description": "地区名称"
                                        },
                                        "areaen": {
                                            "type": "string",
                                            "example": "xian",
                                            "description": "地区拼音"
                                        },
                                        "areaid": {
                                            "type": "string",
                                            "example": "CN101050311",
                                            "description": "地区天气ID"
                                        },
                                        "citycn": {
                                            "type": "string",
                                            "example": "牡丹江",
                                            "description": "归属地市名称"
                                        },
                                        "cityen": {
                                            "type": "string",
                                            "example": "mudanjiang",
                                            "description": "归属地市拼音"
                                        },
                                        "areatype": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "地区类型，地市级1、区县级2"
                                        },
                                        "latitude": {
                                            "type": "float",
                                            "example": "44.58103",
                                            "description": "地区纬度"
                                        },
                                        "longitude": {
                                            "type": "float",
                                            "example": "129.61311",
                                            "description": "地区经度"
                                        },
                                        "provincecn": {
                                            "type": "string",
                                            "example": "黑龙江",
                                            "description": "归属省份名称"
                                        },
                                        "provinceen": {
                                            "type": "string",
                                            "example": "heilongjiang",
                                            "description": "归属省份拼音"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "adcode": "231005",
                                                "areacn": "西安",
                                                "areaen": "xian",
                                                "areaid": "CN101050311",
                                                "citycn": "牡丹江",
                                                "cityen": "mudanjiang",
                                                "areatype": 2,
                                                "latitude": 44.58103,
                                                "longitude": 129.61311,
                                                "provincecn": "黑龙江",
                                                "provinceen": "heilongjiang"
                                            },
                                            {
                                                "adcode": "220403",
                                                "areacn": "西安",
                                                "areaen": "xian",
                                                "areaid": "CN101060705",
                                                "citycn": "辽源",
                                                "cityen": "liaoyuan",
                                                "areatype": 2,
                                                "latitude": 42.920414,
                                                "longitude": 125.15142,
                                                "provincecn": "吉林",
                                                "provinceen": "jilin"
                                            },
                                            {
                                                "adcode": "610100",
                                                "areacn": "西安",
                                                "areaen": "xian",
                                                "areaid": "CN101110101",
                                                "citycn": "西安",
                                                "cityen": "xian",
                                                "areatype": 1,
                                                "latitude": 34.26316,
                                                "longitude": 108.94802,
                                                "provincecn": "陕西",
                                                "provinceen": "shaanxi"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "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": "返回数量，取值1-50"
                                    },
                                    "area": {
                                        "type": "string",
                                        "example": "西安",
                                        "description": "地区名称"
                                    },
                                    "page": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "翻页"
                                    }
                                },
                                "required": [
                                    "key",
                                    "area"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "adcode": {
                                            "type": "string",
                                            "example": "231005",
                                            "description": "地区行政代码"
                                        },
                                        "areacn": {
                                            "type": "string",
                                            "example": "西安",
                                            "description": "地区名称"
                                        },
                                        "areaen": {
                                            "type": "string",
                                            "example": "xian",
                                            "description": "地区拼音"
                                        },
                                        "areaid": {
                                            "type": "string",
                                            "example": "CN101050311",
                                            "description": "地区天气ID"
                                        },
                                        "citycn": {
                                            "type": "string",
                                            "example": "牡丹江",
                                            "description": "归属地市名称"
                                        },
                                        "cityen": {
                                            "type": "string",
                                            "example": "mudanjiang",
                                            "description": "归属地市拼音"
                                        },
                                        "areatype": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "地区类型，地市级1、区县级2"
                                        },
                                        "latitude": {
                                            "type": "float",
                                            "example": "44.58103",
                                            "description": "地区纬度"
                                        },
                                        "longitude": {
                                            "type": "float",
                                            "example": "129.61311",
                                            "description": "地区经度"
                                        },
                                        "provincecn": {
                                            "type": "string",
                                            "example": "黑龙江",
                                            "description": "归属省份名称"
                                        },
                                        "provinceen": {
                                            "type": "string",
                                            "example": "heilongjiang",
                                            "description": "归属省份拼音"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "adcode": "231005",
                                                "areacn": "西安",
                                                "areaen": "xian",
                                                "areaid": "CN101050311",
                                                "citycn": "牡丹江",
                                                "cityen": "mudanjiang",
                                                "areatype": 2,
                                                "latitude": 44.58103,
                                                "longitude": 129.61311,
                                                "provincecn": "黑龙江",
                                                "provinceen": "heilongjiang"
                                            },
                                            {
                                                "adcode": "220403",
                                                "areacn": "西安",
                                                "areaen": "xian",
                                                "areaid": "CN101060705",
                                                "citycn": "辽源",
                                                "cityen": "liaoyuan",
                                                "areatype": 2,
                                                "latitude": 42.920414,
                                                "longitude": 125.15142,
                                                "provincecn": "吉林",
                                                "provinceen": "jilin"
                                            },
                                            {
                                                "adcode": "610100",
                                                "areacn": "西安",
                                                "areaen": "xian",
                                                "areaid": "CN101110101",
                                                "citycn": "西安",
                                                "cityen": "xian",
                                                "areatype": 1,
                                                "latitude": 34.26316,
                                                "longitude": 108.94802,
                                                "provincecn": "陕西",
                                                "provinceen": "shaanxi"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}