ip2location facebbook  ip2location twitter  ip2location google+ ip2location github

Python Library

This module is a Python Library to support all IP2Location™ database products. It has been optimized for speed and memory utilization. Developers can use this API to query all IP2Location™ binary databases for IPv4 and IPv6 address.

Download Download   Source Source


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


Sample Codes
import IP2Location;

IP2LocObj = IP2Location.IP2Location();
rec = IP2LocObj.get_all("");

print rec.country_short
print rec.country_long
print rec.region
print rec.city
print rec.isp
print rec.latitude
print rec.longitude
print rec.domain
print rec.zipcode
print rec.timezone
print rec.netspeed
print rec.idd_code
print rec.area_code
print rec.weather_code
print rec.weather_name
print rec.mcc
print rec.mnc
print rec.mobile_brand
print rec.elevation
print rec.usage_type


Sample IP2Location Databases (BIN)

The following evaluation copy of the database file has limited range of IP address information compare to commercial. For evaluation purpose, you can query IP addresses from (IPv4) or 2A04:0:0:0:0:0:0:0-2A04:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF (IPv6).

Sample Packages IPv4 IPv6
IP2Location DB1 Sample Bin File469.88 kB73.56 kB
IP2Location DB2 Sample Bin File38.56 MB100.93 kB
IP2Location DB3 Sample Bin File18.59 MB86.29 kB
IP2Location DB4 Sample Bin File55.23 MB110.48 kB
IP2Location DB5 Sample Bin File29.55 MB92.89 kB
IP2Location DB6 Sample Bin File66.06 MB115.63 kB
IP2Location DB7 Sample Bin File61.18 MB120.86 kB
IP2Location DB8 Sample Bin File72.27 MB125.76 kB
IP2Location DB9 Sample Bin File34.62 MB96.16 kB
IP2Location DB10 Sample Bin File78.32 MB130.81 kB
IP2Location DB11 Sample Bin File35.35 MB96.86 kB
IP2Location DB12 Sample Bin File78.86 MB131.67 kB
IP2Location DB13 Sample Bin File33.92 MB94.25 kB
IP2Location DB14 Sample Bin File80.28 MB132.43 kB
IP2Location DB15 Sample Bin File38.43 MB100.77 kB
IP2Location DB16 Sample Bin File85.19 MB138.03 kB
IP2Location DB17 Sample Bin File41.61 MB102.53 kB
IP2Location DB18 Sample Bin File93.15 MB148.21 kB
IP2Location DB19 Sample Bin File75.10 MB127.00 kB
IP2Location DB20 Sample Bin File95.71 MB149.10 kB
IP2Location DB21 Sample Bin File42.24 MB103.32 kB
IP2Location DB22 Sample Bin File100.27 MB152.19 kB
IP2Location DB23 Sample Bin File75.70 MB128.01 kB
IP2Location DB24 Sample Bin File101.21 MB153.48 kB