IP地址查询接口

给出ip网络的地址,根据ip地址返回该ip所在的国家,省市(州),以及网络运营商等具体信息。

地址:http://www.apix.cn/services/show/24

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://a.apix.cn/tongyu/iplookup/ip?ip=your_value")
  .get()
  .addHeader("accept", "application/json")
  .addHeader("content-type", "application/json")
  .addHeader("apix-key", "您的apix-key")
  .build();

Response response = client.newCall(request).execute();


接口地址:  http://a.apix.cn/tongyu/iplookup/ip
支持格式:  JSON
请求方式:  GET
请求示例:  http://a.apix.cn/tongyu/iplookup/ip?ip=117.89.35.58
请求参数:
名称 类型 位置 必填 说明
apix-key string header 在请求头中设置您的apix-key来通过验证(用户中心查看对应的apix-key)
ip string urlParam ip地址

你可能感兴趣的:(IP地址查询接口)