新浪 ip 地址库



API地址:http://int.dpool.sina.com.cn/iplookup/iplookup.php

1
2
3
4
5
6
7
8
function get_location( $ip ){
  $curl = curl_init();
         curl_setopt( $curl ,CURLOPT_URL, "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=" . $ip );
         $location = curl_exec( $curl );
         $location = json_decode( $location );
         if ( $location ===FALSE) return "" ;
         return empty ( $location ->desc) ? $location ->province. $location ->city. $location ->district. $location ->isp : $location ->desc;
}

update:
2012年又收集到一些ip地址转换的接口,其中发现腾讯的api已经挂了。
腾讯:http://fw.qq.com/ipaddress
新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js
新浪多地域测试方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=12.130.132.30
搜狐IP地址查询接口(默认GBK):http://pv.sohu.com/cityjson
搜狐IP地址查询接口(可设置编码):http://pv.sohu.com/cityjson?ie=utf-8
搜狐另外的IP地址查询接口:http://txt.go.sohu.com/ip/soip
网易有道IP地址API接口:http://www.youdao.com/smartresult-xml/search.s?type=ip&q=115.156.238.114

API地址:http://int.dpool.sina.com.cn/iplookup/iplookup.php

1
2
3
4
5
6
7
8
function get_location( $ip ){
  $curl = curl_init();
         curl_setopt( $curl ,CURLOPT_URL, "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=" . $ip );
         $location = curl_exec( $curl );
         $location = json_decode( $location );
         if ( $location ===FALSE) return "" ;
         return empty ( $location ->desc) ? $location ->province. $location ->city. $location ->district. $location ->isp : $location ->desc;
}

update:
2012年又收集到一些ip地址转换的接口,其中发现腾讯的api已经挂了。
腾讯:http://fw.qq.com/ipaddress
新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js
新浪多地域测试方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=12.130.132.30
搜狐IP地址查询接口(默认GBK):http://pv.sohu.com/cityjson
搜狐IP地址查询接口(可设置编码):http://pv.sohu.com/cityjson?ie=utf-8
搜狐另外的IP地址查询接口:http://txt.go.sohu.com/ip/soip
网易有道IP地址API接口:http://www.youdao.com/smartresult-xml/search.s?type=ip&q=115.156.238.114

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值