OT: Country -> (State) -> City/Town (XML/JSON)

Does anyone know where I can find Country -> (State) -> City/Town data
easy to read format (XML/JSON)?

I need it for my application and would like a good base of
countries/states/towns/cities before I start asking users to add missing



100% naturally selected. 0% designed.

“Ants P.” [email protected] wrote
in message
news:[email protected]

Does anyone know where I can find Country → (State) → City/Town data in

easy to read format (XML/JSON)?

There is a databse that provides city (and state/province information
the US and Canada). It is freely available, but requires a short message
the legal section of your site, as well as in any
that mention the address portion of the product. If sounds acceptable,
what you want is:

MaxMind’s worldcitiespop.txt database. The database is a text file
using the ISO-8859-1 encoding. It is a simple comma seperated value
database. The fields are CountryCode, ASCIICityName, CityName,
Population, Latitude, Longitude.

You can ignore the last 3 fields. You will need a database to match
CountryCodes to country names, but MaxMind provides one. A trivial 2
CSV file. You will also need a State/CanadaProvince-code to name, and
MaxMind also provides that too, as a trivial 2 field CSV file.

A few quick gotchas: The file is 130MB uncompressed, and is a 30 MB
download. The first line is not a record, but gives the feild names. A
cities might have country codes of “A1”,“A2”,“EU”,or “AP”. you should
include those, since they are special codes for the geoIP database. The
statecode feild has a numeric region code for countries other than the
US or
Canada, I’d advise you ignore them.

The main database is at:
The license is at:

The Country Code and City Code databases are small enough they provide
as text on html pages: GeoIP2 Release Notes - 2021 Archive and
http://www.maxmind.com/app/iso3166_2 respectively.

I hope this helps.