1、百度
http://opendata.baidu.com/api.php?query=120.204.100.171&co=&resource_id=6006&oe=utf8
2、国外的ip-api.com,准确性稍差,限制每分钟45次,速度稍慢,可以用境外cn2服务器做中转
http://ip-api.com/json/114.114.114.114?lang=zh-CN
3、太平洋
http://whois.pconline.com.cn/ipJson.jsp?ip=123.65.58.3&json=true
收费的:
http://www.91cha.com/api/ip.html
注意:用file_get_contents函数一定要开启allow_url_fopen,推荐用CURL获取信息