GeoIP2 Enterprise CSV Database

In addition to our MaxMind DB binary format, we also offer GeoIP2 databases in a CSV format suitable for importing into a SQL database. This documentation details the format of those CSV files. The CSV files are shipped as a single zip file.

IP Geolocation Usage

IP geolocation is inherently imprecise. Locations are often near the center of the population. Any location provided by a GeoIP database should not be used to identify a particular address or household.

Zip File

The zip file itself is named GeoIP2-Enterprise-CSV_{YYYYMMDD}.zip. The downloaded zip file contains a single directory which in turn contains several files. That directory is named GeoIP2-Enterprise-CSV_{YYYYMMDD}.

The files in this zip archive are:

FilenameDescription
LICENSE.txt End user license
COPYRIGHT.txt Copyright statement
GeoIP2-Enterprise-Blocks-IPv4.csv CSV file containing data on IPv4 addresses
GeoIP2-Enterprise-Blocks-IPv6.csv CSV file containing data on IPv6 addresses
GeoIP2-Enterprise-ISP.csv CSV file containing data on ISPs. This may be cross referenced with the various blocks files using the shared isp_id key.
GeoIP2-Enterprise-Locations-XX.csv CSV files containing data on locations. This may be cross referenced with the various blocks files using the shared geoname_id key.

Example File

This example file contains a CSV containing records for just the IP address 67.248.44.118 - GeoIP2-Enterprise-CSV_Example

CSV File Format

All the CSV files start with a single header row containing column names. The specific column names and their contents are detailed below. The files are encoded as UTF-8.

Blocks Files

There are two CSV files for network blocks, one each for IPv4 and IPv6 blocks. These files are named GeoIP2-Enterprise-Blocks-IPv4.csv and GeoIP2-Enterprise-Blocks-IPv6.csv respectively.

Name Type Description
network IP network as a string This is the IPv4 or IPv6 network in CIDR format such as "2.21.92.0/29" or "2001:4b0::/80". We offer a utility to convert this column to start/end IPs or start/end integers. See the conversion utility section for details.
geoname_id integer A unique identifier for the network's location as specified by GeoNames. This ID can be used to look up the location information in the Location file.
registered_country_geoname_id integer The registered country is the country in which the ISP has registered the network. This column contains a unique identifier for the network's registered country as specified by GeoNames. This ID can be used to look up the location information in the Location file.
represented_country_geoname_id integer The represented country is the country which is represented by users of the IP address. For instance, the country represented by an overseas military base. This column contains a unique identifier for the network's registered country as specified by GeoNames. This ID can be used to look up the location information in the Location file.
is_anonymous_proxy boolean Deprecated. Please see our GeoIP2 Anonymous IP database to determine whether the IP address is used by an anonymizing service.
is_satellite_provider boolean Deprecated.
postal_code string The postal code associated with the IP address. These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, United Kingdom, and the US. We return the first 3 characters for Canadian postal codes. We return the the first 2-4 characters (outward code) for postal codes in the United Kingdom.
latitude decimal The latitude of the location associated with the network.
longitude decimal The longitude of the location associated with the network.
isp_id integer A identifier for the ISP. This ID can be used to look up the location information in the ISP file.
is_legitimate_proxy boolean A 1 if the network is a legimate proxy, otherwise 0.
domain string The domain associated with the network.
accuracy_radius integer The radius in kilometers around the specified location where the IP address is likely to be.
country_confidence decimal (1-100) The confidence that the country was correctly geolocated.
subdivision_confidence decimal (1-100) The confidence that the most specific subdivision was correctly geolocated.
city_confidence decimal (1-100) The confidence that the city was correctly geolocated.
postal_confidence decimal (1-100) The confidence that the postal code was correctly geolocated.

ISP File

A single CSV file, called GeoIP2-Enterprise-ISP.csv, contains information on ISPs.

Name Type Description
isp_id integer The identifier for the ISP. This key can be cross referenced with the isp_id in the Blocks files.
isp string The name of the ISP associated with the IP address.
organization string The name of the organization associated with the IP address.
autonomous_system_number integer The ASN assigned to the ISP for routing.
autonomous_system_organization string The name of the autonomous system organization.
connection_type string

The type of connection. This will be one of the following values.

  • Dialup
  • Cable/DSL
  • Corporate
  • Cellular
user_type string

The user type associated with the IP address. This will be one of the following values.

  • business
  • cafe
  • cellular
  • college
  • content_delivery_network
  • dialup
  • government
  • hosting
  • library
  • military
  • residential
  • router
  • school
  • search_engine_spider
  • traveler

Locations Files

The zip file includes one location file for each locale code for which data is available. The current locales are "en", "de", "es", "fr", "ja", "pt-BR", "ru", and "zh-CN". Depending on the data available for a given GeoIP2 data set, we may not include all of these locales.

These files are named GeoIP2-Enterprise-Locations-{locale}.csv. An example name would be "GeoIP2-Enterprise-Locations-en.csv".

Name Type Description
geoname_id integer A unique identifier for the a location as specified by GeoNames. This ID can be used as a key for the Location file.
locale_code string The locale that the names in this row are in. This will always correspond to the locale name of the file.
continent_code string (2)

The continent code for this location. Possible codes are:

  • AF - Africa
  • AN - Antarctica
  • AS - Asia
  • EU - Europe
  • NA - North America
  • OC - Oceania
  • SA - South America
continent_name string The continent name for this location in the file's locale.
country_iso_code string (2) A two-character ISO 3166-1 country code for the country associated with the location.
country_name string The country name for this location in the file's locale.
subdivision_1_iso_code string (1-3) A string of up to three characters containing the region-portion of the ISO 3166-2 code for the first level region associated with the IP address. Some countries have two levels of subdivisions, in which case this is the least specific. For example, in the United Kingdom this will be a country like "England", not a county like "Devon".
subdivision_1_name string The subdivision name for this location in the file's locale. As with the subdivision code, this is the least specific subdivision for the location.
subdivision_2_iso_code string (1-3) A string of up to three characters containing the region-portion of the ISO 3166-2 code for the second level region associated with the IP address. Some countries have two levels of subdivisions, in which case this is the most specific. For example, in the United Kingdom this will be a a county like "Devon", not a country like "England".
subdivision_2_name string The subdivision name for this location in the file's locale. As with the subdivision code, this is the most specific subdivision for the location.
city_name string The city name for this location in the file's locale.
metro_code integer The metro code associated with the IP address. These are only available for networks in the US. MaxMind provides the same metro codes as used by DoubleClick.
time_zone string The time zone associated with location, as specified by the IANA Time Zone Database, e.g., “America/New_York”.

Returned Values as Database, Map, Dict, or Hash Keys

We strongly discourage you from using a value from any *_name field as a key in a database or map/dict/hash data structure.

These names may change between releases. Instead we recommend using one of the following:

Data object Recommended key
city geoname_id
continent continent_code
country country_iso_code
postal postal_code
subdivisions subdivision_{1,2}_iso_code

Conversion Utility

We've created a small utility program to allow you to convert a GeoIP2 CSV file's representation of IP addresses to another format. You can choose between start/end IP addresses, with the addresses represented as strings or integers.

The program is available from our geoip2-csv-converter GitHub project releases tab.