IPGEO-Search est un module Python qui permet une utilisation facile de l'API IPGEO. Il permet aux utilisateurs gratuits et payants d'envoyer des demandes au serveur en une seule ligne de code, permettant la personnalisation de la façon dont les listes IP sont chargées. Nous offrons un essai gratuit de 5 jours pour notre API sur notre page Web. Pour obtenir la clé API d'essai gratuite, contactez notre laboratoire et nous vous l'enverrons.
Pour installer ipGeosearch, exécuter
pip install IPGeoSearch Avant d'exécuter sur votre ordinateur local, assurez-vous d'avoir python 3.6+ avec la dernière version de pandas installée.
Pour installer des pandas, exécutez:
pip install pandas La fonction search prend 3 arguments:
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.
Pour utiliser l'une ou l'autre version, vous devez fournir votre clé au serveur.
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 )Les erreurs courantes sont:
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."Si vous recevez une erreur comme:
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."Déposez un problème pour que notre équipe puisse vous aider.