根据ip获取省份/城市的接口

Author Avatar
新风作浪 10月 12, 2015
  • 在其它设备中阅读本文章

###淘宝接口

http://ip.taobao.com/service/getIpInfo.php?ip=119.57.173.141

#####返回结果

{
"code": 0,
"data": {
    "country": "中国",
    "country_id": "CN",
    "area": "华北",
    "area_id": "100000",
    "region": "北京市",
    "region_id": "110000",
    "city": "北京市",
    "city_id": "110100",
    "county": "",
    "county_id": "-1",
    "isp": "日升天信科技",
    "isp_id": "1000157",
    "ip": "119.57.173.141"
}
}

###新浪接口

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=119.57.173.141

#####返回结果

{
"ret": 1,
"start": -1,
"end": -1,
"country": "中国",
"province": "北京",
"city": "北京",
"district": "",
"isp": "",
"type": "",
"desc": ""
}

###百度接口

http://api.map.baidu.com/location/ip

需要申请key才能用http://developer.baidu.com/map/index.php?title=webapi/ip-api

#####返回结果

{  
    address: "CN|北京|北京|None|CHINANET|1|None",   #地址  
    content:       #详细内容  
    {  
    address: "北京市",   #简要地址  
    address_detail:      #详细地址信息  
    {  
    city: "北京市",        #城市  
    city_code: 131,       #百度城市代码  
    district: "",           #区县  
    province: "北京市",   #省份  
    street: "",            #街道  
    street_number: ""    #门址  
    },  
    point:               #百度经纬度坐标值  
    {  
    x: "116.39564504",  
    y: "39.92998578"  
    }  
    },  
    status: 0     #返回状态码  
}

###腾讯接口
如果网页端查看一下 直接http://ip.qq.com

欢迎您,尊敬的用户
您当前的IP为:119.57.173.141
该IP所在地为:中国北京市 联通