使用人数:123人
国内城市街道查询

  1. 接口介绍:给定国内坐标,查询所在的城市和附近街道
  2. 接口地址: http://open-api-location.luzhi.online/SearchLocation
  3. 请求方式: GET
  4. 返回格式: JSON
  5. 请求参数说明:
    名称 必须 类型 说明
    token String 接口调用授权签名
    lat 必须 String 维度
    log 必须 String 经度
  6. 请求示例:
    http://open-api-location.luzhi.online/SearchLocation?lat=30.59108&log=114.303603&token=***
  7. 返回参数:
    名称 类型 说明
    code int 响应码。成功为200,其余参见接口调用响应码表
    msg String 返回消息。成功返回Succeed。其余错误消息为对应错误码的提示。
    data Object 返回数据。数据类型为Json格式的Object
    data数据说明:
    address String 坐标地址描述
    nation String 国家
    province String 省份
    city String 城市
    district String 区县
    street String 街道
    street_number String 街道号码
    pois_info [] 附近主要建筑
  8. 正确返回示例:
    {
      "code": 200,
      "message": "OK",
      "data": {
        "address": "湖北省武汉市江岸区洞庭街139号",
        "nation": "中国",
        "province": "湖北省",
        "city": "武汉市",
        "district": "江岸区",
        "street": "洞庭街",
        "street_number": "洞庭街139号",
        "pois_info": [
          {
            "title": "武汉江城明珠豪生大酒店",
            "category": "酒店宾馆/星级酒店",
            "address": "湖北省武汉市江岸区汉口沿江大道182号粤汉码头(近两江游览及江滩公园)"
          },
          {
            "title": "沫亭",
            "category": "美食/中餐厅/其它中餐厅",
            "address": "湖北省武汉市江岸区洞庭街135号2楼"
          },
          {
            "title": "靓靓蒸虾(江滩明珠豪生店)",
            "category": "美食/海鲜",
            "address": "湖北省武汉市江岸区沿江大道明珠豪生大酒店旁"
          },
          {
            "title": "汉口江滩",
            "category": "旅游景点/公园",
            "address": "湖北省武汉市江岸区汉口武汉客运港旁"
          },
          {
            "title": "武汉市政府",
            "category": "机构团体/政府机关",
            "address": "湖北省武汉市江岸区沿江大道188号"
          },
          {
            "title": "小贝壳花园餐厅",
            "category": "美食/中餐厅/湖北菜",
            "address": "湖北省武汉市江岸区洞庭街129号"
          },
          {
            "title": "蔡锷路",
            "category": "地名地址/道路名",
            "address": "湖北省武汉市江岸区一元路"
          },
          {
            "title": "巴厘龙虾(洞庭街店)",
            "category": "美食/中餐厅/其它中餐厅",
            "address": "湖北省武汉市江岸区洞庭街125号"
          },
          {
            "title": "洞庭苑",
            "category": "房产小区/住宅区/住宅小区",
            "address": "湖北省武汉市江岸区沿江大道187正西方向49米"
          },
          {
            "title": "怡东大厦",
            "category": "房产小区/商务楼宇",
            "address": "湖北省武汉市江岸区洞庭街107号"
          },
          {
            "title": "乔叶龙老武汉烧烤(蔡锷路店)",
            "category": "美食/烧烤",
            "address": "湖北省武汉市江岸区胜利街257正北方向63米"
          },
          {
            "title": "再续酒店",
            "category": "酒店宾馆/酒店宾馆",
            "address": "湖北省武汉市江岸区沿江大道181号"
          },
          {
            "title": "汉口江滩-码头文化广场",
            "category": "旅游景点/城市广场",
            "address": "湖北省武汉市江岸区蔡锷路和沿江大道交叉口对面汉口江滩内"
          }
        ]
      }
    }
  9. 错误返回示例:
    {
      "code": 401,
      "message": "Sign is error",
      "data": null
    }
  10. 参考代码:

    
            //using System.IO;
            //using System.Text;
            //using System.Net;
            //using System.Net.Security;
            static void Main(string[] args)
            {
                String method = "GET";
                String url = "http://open-api-location.luzhi.online/SearchLocation?lat=30.59108&log=114.303603&token=***";
                HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(url); 
                httpRequest.Method = method;
                try
                {
                    HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
                    Stream st = httpResponse.GetResponseStream();
                    StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
                    Console.WriteLine(reader.ReadToEnd());
                    Console.WriteLine("\n");
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
                                                 

     
         
        public static void main(String[] args) throws IOException
        { 
            String url = "http://open-api-location.luzhi.online/SearchLocation?lat=30.59108&log=114.303603&token=***";
        
            HttpClient httpClient = HttpClients.custom().build();
            HttpGet get = new HttpGet(url);
        
            HttpResponse response = httpClient.execute(get);
            HttpEntity resp_entity = response.getEntity();
            resp_entity.getContent();
        
            String resp_content = EntityUtils.toString(resp_entity,StandardCharsets.UTF_8);
        
            System.out.println(resp_content);
        } 
                                             

    
        import json, urllib
        from urllib import urlencode
    
        url = "http://*****"
        params = { 
            "token": "*************",     # 授权签名 
            "param1":"……"               # 参数1                                       
        }
        params = urlencode(params)
        f = urllib.urlopen(url, params)
        content = f.read()
        res = json.loads(content)
        if res:
            print(res)
        else:
            print("请求异常")