{
  "openapi": "3.0.3",
  "info": {
    "title": "地址与经纬度互转",
    "description": "该接口专为解决地址与经纬度之间的转换问题而设计，它能够便捷地在线上发货地址、收货地时间预测、GPS定位以及各大地图服务（如Google地图、Sogou地图、百度地图等）中实现地理位置与经纬度的互换。适用于需要精确地理位置信息的所有场景，确保用户在各种应用中的地理定位准确无误。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/238-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 60,
      "x-connect-timeout": 60,
      "post": {
        "summary": "经纬度转地址",
        "description": "由经纬度查询得到结构化的地址信息，支持多种坐标 \n1：GPS设备获取的角度坐标;\n2：GPS获取的米制坐标、sogou地图所用坐标; \n3：google地图、soso地图、aliyun地图、mapabc地图和amap地图所用坐标 4：3中列表地图坐标对应的米制坐标 \n5：百度地图采用的经纬度坐标 \n6：百度地图采用的米制坐标 \n7：mapbar地图坐标; \n8：51地图坐标",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "addressComponent": {
                              "type": "object",
                              "properties": {
                                "direction": {
                                  "type": "string",
                                  "description": "和当前坐标点的方向"
                                },
                                "street": {
                                  "type": "string",
                                  "description": "街道名（行政区划中的街道层级）"
                                },
                                "country_code_iso2": {
                                  "type": "string",
                                  "description": "国家英文缩写（两位）"
                                },
                                "country_code": {
                                  "type": "number",
                                  "description": "国家编码"
                                },
                                "city_level": {
                                  "type": "number",
                                  "description": "城市所在级别（仅国外有参考意义。国外行政区划与中国有差异，城市对应的层级不一定为『city』。country、province、city、district、town分别对应0-4级，若city_level=3，则district层级为该国家的city层级）"
                                },
                                "country": {
                                  "type": "string",
                                  "description": "国家"
                                },
                                "city": {
                                  "type": "string",
                                  "description": "城市名"
                                },
                                "distance": {
                                  "type": "string",
                                  "description": "相对当前坐标点的距离，当有门牌号的时候返回数据"
                                },
                                "province": {
                                  "type": "string",
                                  "description": "省"
                                },
                                "adcode": {
                                  "type": "string",
                                  "description": "行政区划代码"
                                },
                                "street_number": {
                                  "type": "string",
                                  "description": "街道门牌号"
                                },
                                "country_code_iso": {
                                  "type": "string",
                                  "description": "国家英文缩写（三位）"
                                },
                                "town": {
                                  "type": "string",
                                  "description": "乡镇名，需设置extensions_town=true时才会返回"
                                },
                                "district": {
                                  "type": "string",
                                  "description": "区县名"
                                }
                              },
                              "description": "城市所在级别（仅国外有参考意义。国外行政区划与中国有差异，城市对应的层级不一定为『city』。country、province、city、district、town分别对应0-4级，若city_level=3，则district层级为该国家的city层级）"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其余为失败"
                            },
                            "location": {
                              "type": "object",
                              "properties": {
                                "lng": {
                                  "type": "number",
                                  "description": "经度值"
                                },
                                "lat": {
                                  "type": "number",
                                  "description": "纬度值"
                                }
                              },
                              "description": "经纬度坐标"
                            },
                            "formatted_address": {
                              "type": "string",
                              "description": "结构化地址信息"
                            },
                            "business": {
                              "type": "string",
                              "description": "坐标所在商圈信息，如 \"人民大学,中关村,苏州街\"。最多返回3个。"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "238_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "lng": {
                    "type": "string",
                    "description": "经度"
                  },
                  "lat": {
                    "type": "string",
                    "description": "维度"
                  },
                  "from": {
                    "type": "string",
                    "description": "经纬度类型 输入的坐标类型：\n1：GPS设备获取的角度坐标; \n2：GPS获取的米制坐标、sogou地图所用坐标; \n3：google地图、soso地图、aliyun地图、mapabc地图和amap地图所用坐标 \n4：3中列表地图坐标对应的米制坐标 5：百度地图采用的经纬度坐标 \n6：百度地图采用的米制坐标 \n7：mapbar地图坐标; \n8：51地图坐标"
                  }
                },
                "required": [
                  "lng",
                  "lat",
                  "from"
                ]
              }
            }
          }
        }
      }
    },
    "/238-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "post": {
        "summary": "地址转经纬度",
        "description": "由地址查询到结构化的坐标，精确度高，默认返回（GCJ-02坐标系）坐标系",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "confidence": {
                              "type": "string",
                              "description": "可信度"
                            },
                            "level": {
                              "type": "string",
                              "description": "地址类型"
                            },
                            "precise": {
                              "type": "string",
                              "description": "位置的附加信息，是否精确查找。1为精确查找，0为不精确。"
                            },
                            "location": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "lat": {
                                    "type": "number",
                                    "description": "纬度"
                                  },
                                  "lng": {
                                    "type": "number",
                                    "description": "经度"
                                  }
                                }
                              },
                              "description": "位置座标（GCJ-02坐标系）"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "238_1_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "要转换的地址"
                  },
                  "city": {
                    "type": "string",
                    "description": "所在城市"
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/238?tab=book"
  },
  "x-apiCode": "238",
  "x-is-own": false,
  "x-is-op": true
}