The GeoIP product is available in a variety of downloadable databases. These databases use a custom binary format to maximize lookup speed. MaxMind also offers CSV versions of the same data. This is useful if you would like to import this data into a SQL RDBMS, for example.
Please see our CSV database documentation.
The binary databases come in many flavors, each of which contains a specific dataset. These are all offered as separate products with their own subscription. We provide installation instructions for GeoIP Country and GeoIP City.
At present, we offer the following databases:
We supply APIs for many major programming languages. Please see our benchmarks if you are interested in comparing the speed of various APIs.
Many of our APIs are available on GitHub. We are happy to review patches submitted as GitHub Pull Requests.
If you'd like to embed GeoIP in the Apache server, we offer mod_geoip2 for this purpose.
This module can only look up the IP address of the client connected to the web server. It sets environment variables containing the results of the IP address lookup.
See the mod_geoip2 documentation for more details.
This code is licensed under the LGPL. You can download the latest version of the API from our download server.
This API should work on most Unix platforms. For installation on Windows,
please see the READMEwin32.txt file in the distribution tarball.
Note that while most of the API is thread-safe,
the GeoIP_last_netmask and GeoIP_range_by_ip are
not. In addition, opening a database with the GEOIP_CHECK_CACHE
flag is not thread-safe.
Packages for this library are available in many distributions. They are usually named "GeoIP", "libgeoip1", or "libGeoIP1". Some systems (like Debian) may split the package into "libgeoip1" (the library) and "libgeoip-dev" (headers and static libraries).
We offer an LGPL-licensed C# library on our download server. This library does not require the libGeoIP C library and is thread-safe.
The C# library should work with both Microsoft's .NET framwork as well as Mono.
We offer an LGPL-licensed Java library on our download server. This library does not require the libGeoIP C library and is thread-safe.
We offer a COM API for the MaxMind Country, Region, City, ISP, and Organization database. To get GeoIP or GeoLite City to work with the new COM API, you must set GeoIP.set_db_path to the directory containing the GeoIPCity.dat file. If you are using GeoLite data, you have to rename GeoLiteCity.dat to GeoIPCity.dat for this to work.
The MS COM API may not work on 64 bit machines. To install on a 64 bit machine, copy the dll to %windir%/SysWOW64, then register the dll. If that doesn't work, a client of ours has documented a MS COM API guide for 64 bit machines.
Source code for the MS COM API is available.
GeoIP is available in two forms for Perl. The Geo::IP module can either use a XS wrapper to the libGeoIP C library installed on your system, or use pure Perl code. Geo::IP::PurePerl has been merged with Geo::IP and is now deprecated.
We offer an LGPL-licensed pure PHP API. This API works on Windows and Unix.
You may also use our mod_geoip Apache module
from PHP. See the
apache_note PHP function for information on how to do this.
Finally, there are several third-party PHP APIs.
We offer an LGPL-licensed Python library that links against the libGeoIP C library on our download server.
There are several Node.js APIs available. The GeoIP binding uses the C library to provide fast performance. node-geoip and node-maxmind are pure JavaScript implementations.
In addition to our supported API, the PEAR package repository has a Net_GeoIP package for PHP 5. This API works on both Windows and Unix and does not require the libGeoIP C library.
If you require a faster API, there is a PECL package that lets you embed the libGeoIP C library in the PHP interpreter. This package also has a newer fork on github which supports more of the GeoIP data.
pygeoip is a pure Python module that is available on PyPI.
There are several options for Ruby. The geoip-c gem links against the libGeoIP C library. There is a pure Ruby implementation in the geoip gem.
We offer instructions for using our downloadable databases with OpenX.
Wireshark compiled with GeoIP supports the use of GeoIP and GeoLite databases.
Wireshark packages are available for many platforms. Windows packages are available from Wireshark for 32-bit and 64-bit processors.