根据ip地址获取地理信息http接口

网上说的一些,比如淘宝的,老报错。这个可以:

http://whois.pconline.com.cn/ip.jsp?ip=223.104.123.29

http://whois.pconline.com.cn

一、使用js根据ip获取地址位置

<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script>
var cityCode=returnCitySN.cid;
document.write('<hr><br><h1> 老铁位置:'+JSON.stringify(returnCitySN)+'</h1>');
</script>

原文地址:https://www.cnblogs.com/lihaoyang/p/13050247.html