Skip to main content

Python Client for Ipdata.co - a Free Ip Geolocation API

Project description

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')

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.9.tar.gz (1.8 kB view details)

Uploaded Source

File details

Details for the file ipdata-1.9.tar.gz.

File metadata

  • Download URL: ipdata-1.9.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ipdata-1.9.tar.gz
Algorithm Hash digest
SHA256 25bbd7b853fcf32d7bc2a54cd113e0b693daff092f430e7ef869052e97c9e2ff
MD5 48f2698de1a7fbaae650d97b3a6a7d5a
BLAKE2b-256 168208cb8eb85488a4b30368f91b230b1855e84725c0b0d79b99658e1fd5f351

See more details on using hashes here.

Supported by

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