Skip to main content

Python Client for - a Free Ip Geolocation API

Project description

This repo provides a Python client for the Free Geolocation API.



pip install ipdata


ip = ipdata()
res = ip.lookup('')
# {u'calling_code': u'61', u'city': u'Research', u'organisation': u'', u'latitude': -37.7, u'ip': u'', 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'', 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('')['country_name]
u'country_name': u'Australia'

Using API keys

apikey = 'myapikey'
ip = ipdata(apikey=apikey)
res = ip.lookup('')

Project details

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.7.tar.gz (1.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page