Python API for IP2Proxy database. It can be used to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.

pip install aioIP2Proxy==1.1.0


Async IP2Proxy Python Library

This is a fork of ip2proxy-python that works asynchronously.

This library allows user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits. It lookup the proxy IP address from IP2Proxy BIN Data file. This data file can be downloaded at


Below are the methods supported in this library.

Method Name Description
open Open the IP2Proxy BIN data with File I/O mode for lookup.
close Close and clean up the file pointer.
get_package_version Get the package version (1 to 10 for PX1 to PX10 respectively).
get_module_version Get the module version.
get_database_version Get the database version.
is_proxy Check whether if an IP address was a proxy. Returned value:
  • -1 : errors
  • 0 : not a proxy
  • 1 : a proxy
  • 2 : a data center IP address
get_all Return the proxy information in array.
get_proxy_type Return the proxy type. Please visit IP2Location for the list of proxy types supported
get_country_short Return the ISO3166-1 country code (2-digits) of the proxy.
get_country_long Return the ISO3166-1 country name of the proxy.
get_region Return the ISO3166-2 region name of the proxy. Please visit ISO3166-2 Subdivision Code for the information of ISO3166-2 supported
get_city Return the city name of the proxy.
get_isp Return the ISP name of the proxy.
get_domain Return the domain name of proxy's IP address or domain name.
get_usage_type Return the ISP's usage type of proxy's IP address or domain name. Please see Usage Type for details.
get_asn Return the autonomous system number (ASN) of proxy's IP address or domain name.
get_as_name Return the autonomous system (AS) name of proxy's IP address or domain name.
get_last_seen Return the last seen days ago value of proxy's IP address or domain name.
get_threat Return the threat types reported to proxy's IP address or domain name.


  1. Python 2.2 and above


  1. Unzip the package.
  2. Execute python build
  3. Execute python install


To install this module type the following (for PyPI):

pip install aioIP2Proxy


import aioIP2Proxy

db = aioIP2Proxy.IP2Proxy()

# open IP2Proxy BIN database for proxy lookup

# get versioning information
print('Module Version: ' + db.get_module_version())
print('Package Version: ' + db.get_package_version())
print('Database Version: ' + db.get_database_version())

# individual proxy data check
print('Is Proxy: ' + str(await db.is_proxy("")))
print('Proxy Type: ' + await db.get_proxy_type(""))
print('Country Code: ' + await db.get_country_short(""))
print('Country Name: ' + await db.get_country_long(""))
print('Region Name: ' + await db.get_region(""))
print('City Name: ' + await db.get_city(""))
print('ISP: ' + await db.get_isp(""))
print('Domain: ' + await db.get_domain(""))
print('Usage Type: ' + await db.get_usage_type(""))
print('ASN: ' + await db.get_asn(""))
print('AS Name: ' + await db.get_as_name(""))
print('Last Seen: ' + await db.get_last_seen(""))
print('Threat: ' + await db.get_threat(""))

# single function to get all proxy data returned in array
record = await db.get_all("")

print('Is Proxy: ' + str(record['is_proxy']))
print('Proxy Type: ' + record['proxy_type'])
print('Country Code: ' + record['country_short'])
print('Country Name: ' + record['country_long'])
print('Region Name: ' + record['region'])
print('City Name: ' + record['city'])
print('ISP: ' + record['isp'])
print('Domain: ' + record['domain'])
print('Usage Type: ' + record['usage_type'])
print('ASN: ' + record['asn'])
print('AS Name: ' + record['as_name'])
print('Last Seen: ' + record['last_seen'])
print('Threat: ' + record['threat'])

# close IP2Proxy BIN database
await db.close()

Proxy Type

Proxy Type Description
VPN Anonymizing VPN services.
TOR Tor Exit Nodes.
PUB Public Proxies.
WEB Web Proxies.
DCH Hosting Providers/Data Center.
SES Search Engine Robots.
RES Residential Proxies [PX10+]

Usage Type

Usage Type Description
COM Commercial
ORG Organization
GOV Government
MIL Military
EDU University/College/School
LIB Library
CDN Content Delivery Network
ISP Fixed Line ISP
MOB Mobile ISP
DCH Data Center/Web Hosting/Transit
SES Search Engine Spider
RSV Reserved

Threat Type

Threat Type Description
SPAM Spammer
SCANNER Security Scanner or Attack
BOTNET Spyware or Malware