通过淘宝提供的API服务进行查询并返回JSON格式结果:
1. 请求接口(GET):
http://ip.taobao.com/service/getIpInfo.php?ip=[ip地址字串]
例:
http://ip.taobao.com/service/getIpInfo.php?ip=1.192.105.191
2. 响应信息:
(json格式的)国家 、省(自治区或直辖市)、市(县)、运营商
3. 返回数据格式:code的值的含义为,0:成功,1:失败
返回结果:
{ code: 0, data: { country: "中国", country_id: "CN", area: "华中", area_id: "400000", region: "河南省", region_id: "410000", city: "郑州市", city_id: "410100", county: "", county_id: "-1", isp: "电信", isp_id: "100017", ip: "1.192.105.191" } }
如果要是一批IP该如何是好?有待研究