Country State City List Csv Download Option
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor. Caseid / province / city / group / infectioncase / confirmed / latitude / longitude patient.csv patient id / global num / sex / birth year / age / country / province / city / disease / infection case / infection order / infected by / contact number / confirmed date / released date / deceased date / state.
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.
Product Information
Terms and pricing for the GeoIP2 City and GeoIP2 Country databases may be found on our product pages:
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.
Here Mudassar Ahmed Khan has explained with an example, how to build Country State City Cascading DropDownList in ASP.Net i.e. Country State City Cascading DropDownList populated from Database and dependent on each other. First the Country DropDownList will be populated on Page Load event. Then when a Country is selected, the SelectedIndexChanged event will fire and the State DropDownList will. Cities Databases by Country We're happy to offer free world cities databases (by country). They include fields such as latitude, longitude, population and more. Choose a country to learn more and download. Or, view our entire world cities database. Download demo.csv files starting from 10 rows up to almost half a million rows. Select the one that goes well with your requirements. You can even find options dealing with.csv files that can store records, data or values with 100, 1000, 5000, 10000, 50000, and 100000 rows.
Data Privacy
To comply with data privacy regulations, please monitor our Do Not Sell My Personal Information Requests page [login required] for IP addresses and networks that should not be used for advertising or marketing purposes.
Zip File
The zip file itself is named {Product}-{Content}-CSV_{YYYYMMDD}.zip
. The {Product}
is either “GeoIP2” or “GeoLite2”. The {Content}
refers to the particular product name, such as “City” or “Country”. For the city subset by continent databases, the {Content}
is one of “City-Africa”, “City-Asia-Pacific”, “City-Europe”, “City-North-America”, or “City-South-America”.
The downloaded .zip file contains a single directory which in turn contains 13 files:
Filename | Description |
COPYRIGHT.txt | Copyright statement |
LICENSE.txt | End user license |
README.txt | Information file |
{Product}-{Content}-Blocks-IPv4.csv | CSV file containing data on IPv4 addresses |
{Product}-{Content}-Blocks-IPv6.csv | CSV file containing data on IPv6 addresses |
{Product}-{Content}-Locations-{locale}.csv | Eight CSV files containing data location for each locale code, where {locale} can be “de”, 'en', “es”, “fr”, “ja”, “pt-BR”, “ru”, and “zh-CN” . |
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 {Product}-{Content}-Blocks-IPv4.csv
and {Product}-{Content}-Blocks-IPv6.csv
respectively. An example name would be 'GeoIP2-City-Blocks-IPv4.csv'.
City subset by continent databases blocks files have the same columns as the City database.
Included in ... | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Name | Type | Description | Country? | City? | ||||||
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. Please see our GeoIP2 Anonymous IP database. | ||||||||
postal_code | string | A postal code close to the user's location. For the following countries, we return partial postal codes with the number of characters indicated below:
| ||||||||
latitude* | decimal | The approximate WGS84 latitude of the postal code, city, subdivision or country associated with the IP address. | ||||||||
longitude* | decimal | The approximate WGS84 longitude of the postal code, city, subdivision or country associated with the IP address. | ||||||||
accuracy_radius | integer | The approximate accuracy radius, in kilometers, around the latitude and longitude for the geographical entity (country, subdivision, city or postal code) associated with the IP address. We have a 67% confidence that the location of the end-user falls within the area defined by the accuracy radius and the latitude and longitude coordinates. |
Locations Files
The zip file includes one location file for each locale code for which data is available. There will always be an 'en' file containing a record for every geoname_id
used in the blocks files. Files corresponding to other locales will exist and have a record for a geoname_id
only if data is available. The other possible locales are 'de', 'es', 'fr', 'ja', 'pt-BR', 'ru', and 'zh-CN'.
These files are named {Product}-{Content}-Locations-{locale}.csv
. An example name would be 'GeoIP2-City-Locations-en.csv'.
City subset by continent databases locations files have the same columns as the City database.
Included in ... | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Name | Type | Description | Country? | City? | |||||||
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:
| |||||||||
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 location. These are only available for networks in the US. | |||||||||
time_zone | string | The time zone associated with location, as specified by the IANA Time Zone Database, e.g., “America/New_York”. | |||||||||
is_in_european_union | boolean | This is 1 if the country associated with the location is a member state of the European Union. It is 0 otherwise. |
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
Country State City List Csv Download Options
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.
Country State City List Csv Download Optional
state | latitude | longitude | name |
---|---|---|---|
AK | 63.588753 | -154.493062 | Alaska |
AL | 32.318231 | -86.902298 | Alabama |
AR | 35.20105 | -91.831833 | Arkansas |
AZ | 34.048928 | -111.093731 | Arizona |
CA | 36.778261 | -119.417932 | California |
CO | 39.550051 | -105.782067 | Colorado |
CT | 41.603221 | -73.087749 | Connecticut |
DC | 38.905985 | -77.033418 | District of Columbia |
DE | 38.910832 | -75.52767 | Delaware |
FL | 27.664827 | -81.515754 | Florida |
GA | 32.157435 | -82.907123 | Georgia |
HI | 19.898682 | -155.665857 | Hawaii |
IA | 41.878003 | -93.097702 | Iowa |
ID | 44.068202 | -114.742041 | Idaho |
IL | 40.633125 | -89.398528 | Illinois |
IN | 40.551217 | -85.602364 | Indiana |
KS | 39.011902 | -98.484246 | Kansas |
KY | 37.839333 | -84.270018 | Kentucky |
LA | 31.244823 | -92.145024 | Louisiana |
MA | 42.407211 | -71.382437 | Massachusetts |
MD | 39.045755 | -76.641271 | Maryland |
ME | 45.253783 | -69.445469 | Maine |
MI | 44.314844 | -85.602364 | Michigan |
MN | 46.729553 | -94.6859 | Minnesota |
MO | 37.964253 | -91.831833 | Missouri |
MS | 32.354668 | -89.398528 | Mississippi |
MT | 46.879682 | -110.362566 | Montana |
NC | 35.759573 | -79.0193 | North Carolina |
ND | 47.551493 | -101.002012 | North Dakota |
NE | 41.492537 | -99.901813 | Nebraska |
NH | 43.193852 | -71.572395 | New Hampshire |
NJ | 40.058324 | -74.405661 | New Jersey |
NM | 34.97273 | -105.032363 | New Mexico |
NV | 38.80261 | -116.419389 | Nevada |
NY | 43.299428 | -74.217933 | New York |
OH | 40.417287 | -82.907123 | Ohio |
OK | 35.007752 | -97.092877 | Oklahoma |
OR | 43.804133 | -120.554201 | Oregon |
PA | 41.203322 | -77.194525 | Pennsylvania |
PR | 18.220833 | -66.590149 | Puerto Rico |
RI | 41.580095 | -71.477429 | Rhode Island |
SC | 33.836081 | -81.163725 | South Carolina |
SD | 43.969515 | -99.901813 | South Dakota |
TN | 35.517491 | -86.580447 | Tennessee |
TX | 31.968599 | -99.901813 | Texas |
UT | 39.32098 | -111.093731 | Utah |
VA | 37.431573 | -78.656894 | Virginia |
VT | 44.558803 | -72.577841 | Vermont |
WA | 47.751074 | -120.740139 | Washington |
WI | 43.78444 | -88.787868 | Wisconsin |
WV | 38.597626 | -80.454903 | West Virginia |
WY | 43.075968 | -107.290284 | Wyoming |