This repo provides a Python client for the ipdata.co Free Geolocation API.
Installation
Run
pip install ipdata
Examples
ip = ipdata()
res = ip.lookup('1.1.1.1')
# {u'calling_code': u'61', u'city': u'Research', u'organisation': u'', u'latitude': -37.7, u'ip': u'1.1.1.1', u'region': u'Victoria', u'time_zone': u'Australia/Melbourne', u'continent_code': u'OC', u'currency': u'AUD', u'continent_name': u'Oceania', u'flag': u'https://ipdata.co/flags/au.png', u'longitude': 145.1833, u'country_code': u'AU', u'country_name': u'Australia', u'postal': u'3095', u'asn': u''}
To get a specific field, do
country = ip.lookup('1.1.1.1')['country_name]
u'country_name': u'Australia'
Using API keys
apikey = 'myapikey'
ip = ipdata(apikey=apikey)
res = ip.lookup('1.1.1.1')
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ipdata-1.8.tar.gz
(1.6 kB
view details)
File details
Details for the file ipdata-1.8.tar.gz.
File metadata
- Download URL: ipdata-1.8.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2b7aee3c30b1a448cf0b32352673842b920ba842e9db15c107cb439fc8a1be7
|
|
| MD5 |
b5cd3be1f60e5aa2d9b84ae1cb70f467
|
|
| BLAKE2b-256 |
11f01595ccdb524e800e5f50b023e5fb37517ab643c51d12bc99b4a28d5bf96a
|