import com.baidubce.http.ApiExplorerClient; import com.baidubce.http.AppSigner; import com.baidubce.http.HttpMethodName; import com.baidubce.model.ApiExplorerRequest; import com.baidubce.model.ApiExplorerResponse; // IPv4区县级API Java示例代码 public class RequestDemo { public static void main(String[] args) { String path = "http://ipqxk.api.bdymkt.com/ip/geo/v1/district/"; ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.GET, path); request.setCredentials("您的 access key", "您的 secret key"); request.addHeaderParameter("Content-Type", "application/json;charset=UTF-8"); request.addQueryParameter("ip", ""); request.addQueryParameter("coordsys", ""); ApiExplorerClient client = new ApiExplorerClient(new AppSigner()); try { ApiExplorerResponse response = client.sendRequest(request); // 返回结果格式为Json字符串 System.out.println(response.getResult()); } catch (Exception e) { e.printStackTrace(); } } }
点击复制代码
{
"code":"Success",
"data": {
"continent":"亚洲",
"country":"中国",
"zipcode":"100005",
"timezone":"UTC+8",
"accuracy":"区县",
"owner":"北京维瑞智盛软件开发有限公司",
"isp": "北京海迅达通信有限责任公司",
"source":"数据挖掘",
"areacode":"CN",
"adcode":"110101",
"asnumber":"45083",
"lat":"39.930941",
"lng":"116.409243",
"radius":"6.9215",
"prov":"北京市",
"city":"北京市",
"district":"东城区",
},
"charge":true,
"msg":"查询成功"
"ip":"1.45.124.145",
"coordsys":"WGS84",
}
{
"code":"Fail",
"data":
"charge":false,
"msg":"系统错误"
"ip":"1.45.124.145",
"coordsys":"WGS84",
}
IP归属地-IPv4区县级通过输入IP,输出该IP的详细地理位置信息及附属信息,地理位置信息包含大洲、国家、省份、城市、区县和经纬度,附属信息包含所属运营商、定位精度、定位方式、定位准确度和定位一致性。该产品定位最高达区县级别。
IP问问广泛应用于网络安全攻防位置定位、互联网在线广告精准投放、互联网金融征信及反欺诈风险控制、位置大数据分析等领域。
功能介绍:
为您在互联网安全行业、互联网金融行业、互联网在线广告、大数据行业等领域提供强有力的数据支撑。