有些是需要指定IP,查询归属地等信息;有些是直接访问获取当前客户端的IP信息。看需求使用。
另外不指定有没有请求频率限制;当然,想要稳定最好还是去用付费的接口
太平洋API
http://whois.pconline.com.cn/ipJson.jsp?ip=123.123.123.123&json=true
www.ip.cn
https://www.ip.cn/api/index?ip&type=0
CSDN
https://searchplugin.csdn.net/api/v1/ip/get?ip=123.123.123.123
ip-api.com
查询指定IP
http://ip-api.com/json/123.123.123.123?lang=zh-CN
www.ipplus360.com
https://www.ipplus360.com/getIP
api.ipify.org
https://api.ipify.org/?format=json
搜狐API: http://pv.sohu.com/cityjson?ie=utf-8
// http://pv.sohu.com/cityjson?ie=utf-8
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script type="text/javascript">
console.log(returnCitySN)
//返回对象Object {cip: "122.70.200.146", cid: "110000", cname: "北京市"}
</script>
评论 (0)