淘宝的ip地址库
来源:互联网 发布:知乎阅读 编辑:程序博客网 时间:2024/04/30 07:23
http://ip.taobao.com/instructions.php
1. 请求接口(GET):
/service/getIpInfo.php?ip=[ip地址字串]
2. 响应信息:
(json格式的)国家 、省(自治区或直辖市)、市(县)、运营商
3. 返回数据格式:
{"code":0,"data":{"ip":"210.75.225.254","country":"\u4e2d\u56fd","area":"\u534e\u5317",
"region":"\u5317\u4eac\u5e02","city":"\u5317\u4eac\u5e02","county":"","isp":"\u7535\u4fe1",
"country_id":"86","area_id":"100000","region_id":"110000","city_id":"110000",
"county_id":"-1","isp_id":"100017"}}
其中code的值的含义为,0:成功,1:失败。
==============================================================================
以下转自 zcqshine 的博客
利用python抓取淘宝提供的ip库信息并保存.
淘宝ip库网站:http://ip.taobao.com
淘宝提供的API地址为:http://ip.taobao.com/service/getIpInfo.php?ip=
这个接口提供的QPS=10
以下为用python简单实现(剔除了私有ip地址段,在判断的时候后也只取了IP段的前三节,第四节统一设置为0,因为只要根据前三段就可以判断ip的归属地信息了)
- # -*- decoidng:utf-8 -*-
- from urllib import request
- import time
- def writefile(L=[]):
- with open('ip.txt','a') as f:
- for s in L:
- f.write(s)
- f.write('\n')
- f.close()
- l=[]
- a = 1
- while a < 256:
- if a == 10:
- a=a+1
- continue
- b=0
- while b < 256:
- if a == 172 and b>15 and b<32:
- b=b+1
- continue
- if a == 192 and b==168:
- b = b + 1
- continue
- c=0
- while c < 256:
- ip = str(a) + "."+ str(b) + "." + str(c) + "." + "0"
- url='http://ip.taobao.com/service/getIpInfo.php?ip='+ip
- with request.urlopen(url)as f:
- data = f.read()
- l.append(str(data.decode('utf-8')))
- if len(l) > 100:
- writefile(l)
- l=[]
- time.sleep(0.2)
- c=c+1;
- b=b+1
- a=a+1
- if len(l)>0:
- writefile(l)
- 淘宝的ip地址库
- 很方便的IP查询接口:淘宝IP地址库
- 淘宝IP地址库采集
- 淘宝IP地址库采集
- 获取淘宝IP地址库
- 分享淘宝的IP地址库查询接口
- 通过淘宝的ip地址库获取ip地址通用类的实现(C#版)
- 查IP地址,淘宝的API
- 获取客户IP并查询IP的地理位置(使用淘宝IP地址库)
- 淘宝IP地址库,提供API
- JAVA 调用淘宝IP地址库API
- 淘宝网查询IP地址信息的服务地址
- 通过淘宝IP地址库获取IP位置
- 通过淘宝IP地址库获取IP位置
- 通过淘宝IP地址库获取IP位置
- 通过淘宝IP地址库获取IP位置
- 使用Retrofit和淘宝IP地址库查询IP
- 淘宝ip地址查询接口
- JAVA中Action层, Service层 ,modle层 和 Dao层的功能区分
- GPIO pull High 原理
- Android获取的时间转为12小时制
- Java数据类型和MySql数据类型对应表
- LeetCode_42---Trapping Rain Water
- 淘宝的ip地址库
- Day6.文件读写
- int和NSInteger和long区别
- android app notification的用法
- nginx安装异常汇总
- leetcode: basic caculator
- String format specifier
- ssh框架分工与职责
- Android--Volley(四)--源码解析