几个免费的IP查询API接口

  • 发表于
  • 前端

腾讯IP查询接口:

腾讯IP接口已停用,下面几个能用:

淘宝IP查询API接口

//网址:http://ip.taobao.com/
//请求接口(GET):http://ip.taobao.com/service/getIpInfo.php?ip=[ip地址]
//返回结果:(json格式的)国家 、省(自治区或直辖市)、市(县)、运营商。例如:
//注:其中code的值的含义为,0:成功,1:失败。
{
"code": 0,
"data": {
"ip": "210.75.225.254",
"country": "中国",
"area": "华北",
"region": "北京市",
"city": "北京市",
"county": "",
"isp": "电信",
"country_id": "86",
"area_id": "100000",
"region_id": "110000",
"city_id": "110000",
"county_id": "-1",
"isp_id": "100017"
}
}

新浪IP查询API接口

//请求接口(GET):http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=[ip地址]
//注:参数format可设置返回格式:js/json;参数ip可选查询IP;
//返回结果:
var remote_ip_info = {
"ret": 1,
"start": "125.40.0.0",
"end": "125.40.111.255",
"country": "中国",
"province": "河南",
"city": "郑州",
"district": "",
"isp": "联通",
"type": "",
"desc": ""
};

搜狐IP查询API接口

默认编码GBK,这个是获取本机ip的

//请求接口(GET):http://pv.sohu.com/cityjson?ie=utf-8
//返回结果:
var returnCitySN = {
"cip": "223.89.129.93",
"cid": "CN",
"cname": "CHINA"
};

搜狐IP查询API接口

默认编码GBK,这个是获取本机ip的

//请求接口(GET):http://members.3322.org/dyndns/getip
//返回结果(直接是你的ip):
222.222.222.222