Ip地址查询接口

2022/10/07 Java

Ip地址查询接口

IP地址库查询接口,根据IP地址或经纬度查询归属地/州/国家/省市区/经纬度及网络运营商ISP等信息。

最新可用ip地址查询接口

  • 网易云接口 http://ip.ws.126.net/ipquery?ip=[IP地址]
  • 淘宝 http://ip.taobao.com/service/getIpInfo.php?ip=115.159.152.210
  • 新浪 http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=115.159.152.210
  • 搜狐接口 http://pv.sohu.com/cityjson?ie=utf-8
  • 爱奇艺接口 http://ip.geo.iqiyi.com/cityjson?format=json&ip=[IP地址]
  • ip-api http://ip-api.com/json/[IP地址]?lang=zh-CN
  • ip508 http://www.ip508.com/ip?q=115.159.152.210
  • 太平洋电脑网接口 http://whois.pconline.com.cn/ipJson.jsp?ip=[IP地址]&json=true
  • 腾讯接口 https://apis.map.qq.com/ws/location/v1/ip?output=jsonp&key=KUQBZ-FYDCU-YMVVN-2DDW5-7WDYE-5JBJR&ip=[IP地址]&callback=jQuery183018526900322491291600324416562&=1600324417180
  • 携程 https://cdid.c-ctrip.com/model-poc2/h
  • ip.cn https://www.ip.cn/api/index?ip=&type=0
  • dreamwq https://api.dreamwq.com/api/getLocation
  • 此网站获取到的数据比较详细,推荐。 http://www.hao7188.com/
  • 比较知名的IP查询网站 http://www.ip.cn/
  • 来自台湾的IP查询网站 http://myip.com.tw/
  • 万网获取本地公网IP地址 http://www.net.cn/static/customercare/yourip.asp
  • 腾讯IP分享计划 http://ip.qq.com/
  • 此网站获取到的数据比较详细,推荐。 http://www.hao7188.com/
  • 此网站获取到的数据比较详细,推荐。 http://www.hao7188.com/ 以下还有些收费的API接口(不推荐):
  • 百度地图高精度定位API:http://lbsyun.baidu.com/index.php?title=webapi/high-acc-ip
  • 百度的API:http://apistore.baidu.com/apiworks/servicedetail/114.html
  • NowAPI:https://www.nowapi.com/api/ip.get
  • 91查API:http://www.91cha.com/api/ip.html

参考示例代码

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import javax.annotation.Resource;

@Component
@Slf4j
public class IpService {

    @Resource
    private RestTemplateBuilder builder;

    private final static String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp?json=true&ip=${ip}";

    @Cacheable(value = {"ipCache"},key = "#p0")
    public String getIp(String ip) {
        //参数
        MultiValueMap<String, Object> param = new LinkedMultiValueMap<String, Object>();
        param.add("ip", ip);
        String result2 = builder.build().getForObject(IP_URL, String.class, param);
        log.info("获取IP地址=>{},{}",ip,result2);
        return result2;
    }
}

Search

    微信好友

    博士的沙漏

    Table of Contents