查询IP地址的免费API
Posted 墨鱼菜鸡 苹果园
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了查询IP地址的免费API相关的知识,希望对你有一定的参考价值。
1、百度
复制代码
1、http://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query=192.168.0.0&co=&resource_id=6006&oe=utf8
例:http://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query=192.168.0.0&co=&resource_id=6006&oe=utf8
2、http://opendata.baidu.com/api.php?query=[ip地址字串]&co=&resource_id=6006&oe=utf8
例:http://opendata.baidu.com/api.php?query=192.168.0.0&co=&resource_id=6006&oe=utf8
复制代码
2、阿里巴巴
复制代码
http://ip.taobao.com/service/getIpInfo.php?ip=[ip地址字串]
例:http://ip.taobao.com/service/getIpInfo.php?ip=192.168.0.0
返回值:{"code":0,"data":{"ip":"192.168.0.0","country":"XX","area":"","region":"XX","city":"内网IP","county":"内网IP","isp":"内网IP","country_id":"xx","area_id":"","region_id":"xx","city_id":"local","county_id":"local","isp_id":"local"}
复制代码
3、国际化显示
复制代码
http://ip-api.com/json/[ip地址字串]?lang=zh-CN
例:http://ip-api.com/json/114.114.114.114?lang=zh-CN
返回值:{"as":"AS174 Cogent Communications","city":"北京","country":"中国","countryCode":"CN","isp":"China Unicom Shandong Province network","lat":39.9042,"lon":116.407,"org":"NanJing XinFeng Information Technologies, Inc.","query":"114.114.114.114","region":"BJ","regionName":"北京","status":"success","timezone":"Asia/Shanghai","zip":""}
复制代码
4、126
http://ip.ws.126.net/ipquery?ip=[ip地址字串]
例:http://ip.ws.126.net/ipquery?ip=192.168.0.0
返回值:var lo="广东省", lc="广州市"; var localAddress={city:"广州市", province:"广东省"}
5、太平洋
http://whois.pconline.com.cn/jsFunction.jsp?callback=jsShow&ip=[ip地址字串]
例:http://whois.pconline.com.cn/jsFunction.jsp?callback=jsShow&ip=192.168.0.0
返回值:if (window.jsShow){jsShow(‘ 局域网‘,‘‘);
6、360
http://ip.360.cn/IPQuery/ipquery?ip=[ip地址字串]
例:http://ip.360.cn/IPQuery/ipquery?ip=192.168.0.0
返回值:{"errno":0,"errmsg":"","data":"u5c40u57dfu7f51"
附录:还可以通过抓取源码从几个网站获取IP信息
http://www.hao7188.com/ 此网站获取到的数据比较详细,推荐。
http://www.ip138.com/ 老牌的IP查询网站
http://www.ip.cn/ 比较知名的IP查询网站
http://myip.com.tw/ 来自台湾的IP查询网站
http://www.net.cn/static/customercare/yourip.asp 万网获取本地公网IP地址
Z-Blog:http://www.361wx.com
以上是关于查询IP地址的免费API的主要内容,如果未能解决你的问题,请参考以下文章