MaxMind's GeoIP2 web services and GeoIP2 databases are an evolution of our original GeoIP web services and databases, which we now refer to as GeoIP Legacy. This document highlights the most important changes for developers.
GeoIP2 includes a variety of new data, as well as making changes to how existing data is represented.
Perhaps the biggest change is the inclusion of localized name data. The service
supports Brazilian Portuguese (
pt-BR), English (
en), French (
de), Japanese (
ja), Russian (
ru), Simplified Chinese (
Whenever possible, we provide a
geoname_id for things like cities, countries,
and country subdivisions. The GeoNames data set
includes a huge amount of data on geographical features.
We now distinguish between several types of country data. The
country is the
country where the IP address is located. The
registered_country is the country
in which the IP is registered. These two may differ in some cases.
registered_country may include the
key to indicate that the country is in the European Union.
Finally, we also include a
represented_country key for some records. This is
used when the IP address belongs to something like a military base. The
represented_country is the country that the base represents. This can be
useful for managing content licensing, among other uses.
We now provide the ISO 3166-2 codes for country subdivisions when they are available. The GeoIP2 databases and services do not include FIPS 10-4 region codes. The GeoIP Legacy databases included ISO codes for US and Canada and FIPS codes for all other countries.
We also provide multiple levels of country subdivision data. The subdivisions these provide correspond to the subdivisions which have been given ISO 3166-2 codes. For example, in the United States, we only provide a single level of subdivision data, corresponding to US states. But for the United Kingdom, we may provide two levels. The first level is the country (England, Scotland, Wales) or province (Northern Ireland). The second level may be a county, a London borough, a unitary authority, council area, etc.
We provide a CSV file which maps FIPS 10-4 region codes to their corresponding ISO 3166-2 subdivision codes. Note that codes for the US and Canada are not present since we included ISO codes for these countries in GeoIP Legacy. Also note that the CSV file may contain outdated ISO 3166-2 subdivision codes in addition to any up-to-date codes that may have replaced them. This file incorporates GeoNames geographical data, which is made available under the Creative Commons Attribution 4.0 License.
In the GeoIP Legacy databases, we included several country codes that don't
represent countries. These were
(anonymous proxy), and
A2 (satellite provider).
For IP addresses where we used to use
AP, we now return a response with no
country set at all. It will, however, contain a
continent object, and that
continent will be Asia. The
time_zone key under the
location object will be
EU, we return a similar document where the
continent is Europe and the
For IP addresses where we used
A2, we now set the appropriate key in
traits object. The
A1 code corresponds to the deprecated
is_anonymous_proxy key, while
A2 corresponds to the deprecated
is_satellite_provider key. New integrations are encouraged to use
available in the GeoIP2 Insights web service or the GeoIP2 Anonymous IP
In the GeoIP2 web services, we have effectively merged the user type and net
speed data into the
user_type key. The
cellular net speed was already
included in the list of possible
We have also changed the format of the
user_type values so that they are in
all lower case, with words separated by underscores (_).
In GeoIP Legacy, this was returned as a string like "AS1239 Linkem IR WiMax
Network". This has been split into two keys,
autonomous_system_organization, which is a string.
The GeoIP2 databases and services do not include area codes.
GeoIP2 Insights includes the average income and population density for the area in which the IP address is used.
All GeoIP2 databases and web services provide the network of the associated data record in the database.
GeoIP2 Insights also includes
user_count, an estimate of the number of users
using the IP address, and the
static_ip_score, an indicator of how static or
dynamic an IP allocation is.
Our GeoIP2 web services now follow REST principles.
Unlike the GeoIP Legacy web service, the GeoIP2 web services use HTTP basic authentication over SSL rather than passing the license key as a query parameter.
When an error occurs, we now return an appropriate HTTP error code instead of simply returning a 200 with an error in the document. We also return a JSON document with details about the error in most cases.
Successful responses also return a JSON document. All documents, both successful and error, are in the form of a JSON object.
This is an example of our GeoIP2 Insights web service's return document.
Latitude and longitude are not precise and should not be used to identify a particular street address or household. To better represent a level of accuracy, please include the accuracy_radius when displaying latitude and longitude and make it clear that the coordinates refer to a larger geographical area instead of a precise location.
This page was last updated on December 2, 2022.