{
    "openapi": "3.0.0",
    "info": {
        "title": "坐标地址查询 - API文档",
        "version": "1.0.0",
        "description": "支持百度坐标系、GPS设备，经纬度坐标转地理位置信息查询。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/geoconvert\/index": {
            "get": {
                "summary": "查询坐标地址信息",
                "tags": [
                    "坐标地址查询"
                ],
                "description": "根据经纬度查询坐标地理位置信息",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "lat",
                        "in": "query",
                        "description": "维度",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "31.2327951763",
                            "description": "维度"
                        }
                    },
                    {
                        "name": "lng",
                        "in": "query",
                        "description": "经度",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "121.47187138",
                            "description": "经度"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "坐标类型，baidu\/gps，默认baidu",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "baidu",
                            "description": "坐标类型，baidu\/gps，默认baidu"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "city": {
                                            "type": "string",
                                            "example": "上海",
                                            "description": "城市"
                                        },
                                        "town": {
                                            "type": "string",
                                            "example": "南京西路街道",
                                            "description": "城镇商业区"
                                        },
                                        "adcode": {
                                            "type": "string",
                                            "example": "310106",
                                            "description": "身份证编码"
                                        },
                                        "street": {
                                            "type": "string",
                                            "example": "威海路",
                                            "description": "街道名称"
                                        },
                                        "address": {
                                            "type": "string",
                                            "example": "上海市静安区南京西路街道威海路329号东南约68米",
                                            "description": "地址"
                                        },
                                        "country": {
                                            "type": "string",
                                            "example": "中国",
                                            "description": "国家"
                                        },
                                        "distance": {
                                            "type": "string",
                                            "example": "49",
                                            "description": "距离"
                                        },
                                        "district": {
                                            "type": "string",
                                            "example": "静安区",
                                            "description": "行政区"
                                        },
                                        "province": {
                                            "type": "string",
                                            "example": "上海市",
                                            "description": "省级行政区"
                                        },
                                        "direction": {
                                            "type": "string",
                                            "example": "附近",
                                            "description": "位置方向"
                                        },
                                        "town_code": {
                                            "type": "string",
                                            "example": "310106012",
                                            "description": "城镇编码"
                                        },
                                        "city_level": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "城市等级"
                                        },
                                        "country_code": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "国家代码"
                                        },
                                        "street_number": {
                                            "type": "string",
                                            "example": "289弄-2-14号",
                                            "description": "街道编码"
                                        },
                                        "country_code_iso": {
                                            "type": "string",
                                            "example": "CHN",
                                            "description": "国家标准代码"
                                        },
                                        "country_code_iso2": {
                                            "type": "string",
                                            "example": "CN",
                                            "description": "地址国家iso代码"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "city": "上海市",
                                        "town": "南京西路街道",
                                        "adcode": "310106",
                                        "street": "威海路",
                                        "address": "上海市静安区南京西路街道威海路329号东南约68米",
                                        "country": "中国",
                                        "distance": "49",
                                        "district": "静安区",
                                        "province": "上海市",
                                        "direction": "附近",
                                        "town_code": "310106012",
                                        "city_level": 2,
                                        "country_code": 0,
                                        "street_number": "289弄-2-14号",
                                        "country_code_iso": "CHN",
                                        "country_code_iso2": "CN"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "查询坐标地址信息",
                "tags": [
                    "坐标地址查询"
                ],
                "description": "根据经纬度查询坐标地理位置信息",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "lat": {
                                        "type": "string",
                                        "example": "31.2327951763",
                                        "description": "维度"
                                    },
                                    "lng": {
                                        "type": "string",
                                        "example": "121.47187138",
                                        "description": "经度"
                                    },
                                    "type": {
                                        "type": "string",
                                        "example": "baidu",
                                        "description": "坐标类型，baidu\/gps，默认baidu"
                                    }
                                },
                                "required": [
                                    "key",
                                    "lat",
                                    "lng"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "city": {
                                            "type": "string",
                                            "example": "上海",
                                            "description": "城市"
                                        },
                                        "town": {
                                            "type": "string",
                                            "example": "南京西路街道",
                                            "description": "城镇商业区"
                                        },
                                        "adcode": {
                                            "type": "string",
                                            "example": "310106",
                                            "description": "身份证编码"
                                        },
                                        "street": {
                                            "type": "string",
                                            "example": "威海路",
                                            "description": "街道名称"
                                        },
                                        "address": {
                                            "type": "string",
                                            "example": "上海市静安区南京西路街道威海路329号东南约68米",
                                            "description": "地址"
                                        },
                                        "country": {
                                            "type": "string",
                                            "example": "中国",
                                            "description": "国家"
                                        },
                                        "distance": {
                                            "type": "string",
                                            "example": "49",
                                            "description": "距离"
                                        },
                                        "district": {
                                            "type": "string",
                                            "example": "静安区",
                                            "description": "行政区"
                                        },
                                        "province": {
                                            "type": "string",
                                            "example": "上海市",
                                            "description": "省级行政区"
                                        },
                                        "direction": {
                                            "type": "string",
                                            "example": "附近",
                                            "description": "位置方向"
                                        },
                                        "town_code": {
                                            "type": "string",
                                            "example": "310106012",
                                            "description": "城镇编码"
                                        },
                                        "city_level": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "城市等级"
                                        },
                                        "country_code": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "国家代码"
                                        },
                                        "street_number": {
                                            "type": "string",
                                            "example": "289弄-2-14号",
                                            "description": "街道编码"
                                        },
                                        "country_code_iso": {
                                            "type": "string",
                                            "example": "CHN",
                                            "description": "国家标准代码"
                                        },
                                        "country_code_iso2": {
                                            "type": "string",
                                            "example": "CN",
                                            "description": "地址国家iso代码"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "city": "上海市",
                                        "town": "南京西路街道",
                                        "adcode": "310106",
                                        "street": "威海路",
                                        "address": "上海市静安区南京西路街道威海路329号东南约68米",
                                        "country": "中国",
                                        "distance": "49",
                                        "district": "静安区",
                                        "province": "上海市",
                                        "direction": "附近",
                                        "town_code": "310106012",
                                        "city_level": 2,
                                        "country_code": 0,
                                        "street_number": "289弄-2-14号",
                                        "country_code_iso": "CHN",
                                        "country_code_iso2": "CN"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}