Catalog PyPI
Back to packageRELEASE DETAILS

1.5.2

PyPI

abstract-ip-geolocation-api

IP Geolocation API from Abstract to geolocate any IP

addressapigeocodinggeolocationiplocation
Published3 Nov 2020
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 1.5.2 documentation

IP Geolocation for Python (geolocation-api-python)

Python library for Abstract free IP Geolocation API.

Full documentation can be found on Abstract IP Geolocation API page.

Getting started

Getting started with Abstract IP Geolocation API is very simple, you just need to install the library into your project as follow:

pip install abstract-ip-geolocation-api

From there you can then call the geolocationapi as follow:

# Import abstract ip geolocation api module
import importlib
abstract_ip_geolocation_api = importlib.import_module("abstract-ip-geolocation-api")

# Initiate the geolocation api with a free API key retrieved on https://www.abstractapi.com/ip-geolocation-api
geolocation_api = abstract_ip_geolocation_api.v1('YOUR_API_KEY')

# Fetch location data for a given IP
# Note: If you don't provide an ip_address value, then the requester IP will be used
location_data = geolocation_api.geolocate(ip_address="ANY_IP_ADDRESS")

# Process location data and potential errors
if 'ip_address' in location_data:
    # Location data has been successfully retrieved
    country = location_data['country']
    city = location_data['city']
    print(country)
elif 'error' in location_data:
    # Handle Abstract related errors
    error = location_data['error']
    print(error)
else:
    # No location data available for this IP
    print('No location data available for this IP')

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

2 collected
abstract_ip_geolocation_api-1.5.2-py3-none-any.whl

bdist_wheel · 3.21 KB · Python py3

Source file
abstract-ip-geolocation-api-1.5.2.tar.gz

sdist · 2.25 KB · Python source

Source file

Repository

PENDING
geolocation-api/ip-geolocation-api-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:41 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:2e9a71e8a13fff95d7afb4851c868f84fd1a9aecb30871133db3d76f098c1ecd

Other collected versions

View all collected versions →