IPGeo Search
v1.0.1: Updated redundancy
IPGEO-SEARCH是一个Python模块,可轻松使用IPGEO API。它允许免费和付费用户仅以一行代码将请求发送到服务器,从而自定义如何加载IP列表。我们在网页上为我们的API提供为期5天的免费试用版。要获取免费试用API密钥,请联系我们的实验室,我们将其发送给您。
要安装ipgeosearch,请运行
pip install IPGeoSearch在本地计算机上运行之前,请确保已安装了最新版本的pandas python 3.6+ 。
要安装熊猫,请运行:
pip install pandassearch功能带有3个参数:
ipList: an Array of IP's where each IP is a string.
path: Where the result files are downloaded to.
key: The API Key sent to you.
要使用任何一个版本,您必须向服务器提供密钥。
from IPGeoSearch import search
with open ( 'ipList.txt' , 'r' ) as f :
ip = [ line . strip () for line in f ]
f . close ()
with open ( 'yourkey.key' , 'r' ) as hashkey :
key = hashkey . read (). replace ( ' n ' , '' )
hashkey . close ()
search . search ( ipList = ip , path = '' , key = key )常见错误是:
TypeError : "An entry in ipList is not a string at line and cannot be read by the server"
RuntimeError : "Your Key is Invalid. Please purchase a key or start a trial."
RuntimeError : "Your Trial Period has expired. Please purchase a key."
RuntimeError : "Your Key has expired. Please purchase a new key."
RuntimeError : "The Network you are using in unknown and key cannot be secured. Please change networks."
RuntimeError : "Your Key is being used on a different network than it was registered on. Please use your original network or purchase a new key for this network."
ValueError : "IP list was not specified."
ValueError : "Key was not specified."如果您收到一个错误:
RuntimeError : "Something went really wrong. Either the IP does not exist in the database, server is down, or another error occured. Check x.x.x.x.json for more details and file an issue if you are unable to solve the problem."提出问题,以便我们的团队可以为您提供帮助。