根據IP獲取所在的國家城市
新浪的IP地址查詢接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js
新浪多地域測試方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=119.139.196.127
搜狐IP地址查詢接口(默認GBK):http://pv.sohu.com/cityjson
搜狐IP地址查詢接口(可設置編碼):http://pv.sohu.com/cityjson?ie=utf-8
太平洋電腦 IP庫接口:(默認callback=IPCallBack) http://whois.pconline.com.cn/ipJson.jsp
淘寶網接口:http://ip.taobao.com/service/getIpInfo.php?ip=119.139.196.127
返回:
{"code":0,"data":{"ip":"119.139.196.127","country":"中國","area":"","region":"廣東","city":"深圳","county":"XX","isp":"電信","country_id":"CN","area_id":"","region_id":"440000","city_id":"440300","county_id":"xx","isp_id":"100017"}}
IP地址查詢--手機號碼查詢歸屬地 | 郵政編碼查詢 | 長途電話區號 | 身份證號碼驗證在線查詢網
http://ip138.com/
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>根據IP地址獲取所在城市</title> <script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" type="text/ecmascript"></script> <script type="text/JavaScript"> function getIpPlace() { alert(remote_ip_info["province"] + "省" + ',' +remote_ip_info["city"] + "市") } </script> </head> <body> <form id="form1"runat="server"> <div> <input id="Button1" type="button"value="根據IP地址獲取所在城市" onclick="getIpPlace();"/> </div> </form> 新浪的IP地址查詢接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js 新浪多地域測試方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=121.33.59.18 搜狐IP地址查詢接口(默認GBK):http://pv.sohu.com/cityjson 搜狐IP地址查詢接口(可設置編碼):http://pv.sohu.com/cityjson?ie=utf-8 太平洋電腦 IP庫接口:(默認callback=IPCallBack) http://whois.pconline.com.cn/ipJson.jsp 淘寶網接口:http://ip.taobao.com/service/getIpInfo.php?ip=119.139.196.127 返回: {"code":0,"data":{"ip":"119.139.196.127","country":"中國","area":"","region":"廣東","city":"深圳","county":"XX","isp":"電信","country_id":"CN","area_id":"","region_id":"440000","city_id":"440300","county_id":"xx","isp_id":"100017"}} IP地址查詢--手機號碼查詢歸屬地 | 郵政編碼查詢 | 長途電話區號 | 身份證號碼驗證在線查詢網 http://ip138.com/ </body> </html>