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')
Metadata
Release files for ipdata 1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ipdata-1.6.tar.gz | 1.6 kB | Details |
Release files / ipdata-1.6.tar.gz
| Download URL | ipdata-1.6.tar.gz |
|---|---|
| Size | 1.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ca4429cffc8d09ece250d5bffacba0ef88bfffa3a662fa3f4edaf5cc221d080
|
|
BLAKE2b-256 checksum How to use checksums |
7947340ae6c205305c186933357faa898bde951de3d64db041655ed29ab83e0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |