Ipgeo-Search adalah modul Python yang memungkinkan penggunaan API IPGEO dengan mudah. Ini memungkinkan pengguna gratis dan berbayar untuk mengirim permintaan ke server hanya dalam satu baris kode, memungkinkan kustomisasi bagaimana daftar IP dimuat. Kami menawarkan uji coba gratis 5 hari untuk API kami di halaman web kami. Untuk mendapatkan kunci API uji coba gratis, hubungi lab kami dan kami akan mengirimkannya kepada Anda.
Untuk menginstal ipgeosearch, jalankan
pip install IPGeoSearch Sebelum berjalan di komputer lokal Anda, pastikan Anda memiliki python 3.6+ dengan versi terbaru dari pandas yang diinstal.
Untuk menginstal panda, jalankan:
pip install pandas Fungsi search menerima 3 argumen:
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.
Untuk menggunakan salah satu versi, Anda harus menyediakan kunci Anda ke server.
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 )Kesalahan umum adalah:
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."Jika Anda menerima kesalahan seperti:
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."Ajukan masalah sehingga tim kami dapat membantu Anda.