Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Python IP Query.

Project description

Python: IP Query

PyPi Version

IP Query, allow proxy.


$ pip3 install ip-query


from ip_query import ip_query

ip = ip_query()

you will get the result like this:

    'ip': '',
    'country': 'Hong Kong',
    'country_code': 'HK',
    'asn': 4760,
    'aso': 'HKT Limited'

Behind a socks5 proxy? use like this:

from ip_query import ip_query

ip = ip_query(
        'http': 'socks5://',
        'https': 'socks5://',


We've chosen GeoLite2 Country and GeoLite2 ASN from GeoLite2 Free Downloadable Databases..

Latest Version: 20190312.

Many thanks to MaxMind.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ip_query-4.3.0-py3-none-any.whl (5.4 MB) Copy SHA256 hash SHA256 Wheel py3
ip-query-4.3.0.tar.gz (5.4 MB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page