Question

Is there any quick guide/reference to list all the countries and its states/provinces?

Like when I click US, it will list: Alabama, alaska etc

Was it helpful?

Solution

I don't have code to do it, but if you want a good (free) list of administrative districts for most of the world you can use this Wikipedia page.

OTHER TIPS

pycountry is the most complete free reference I was ever able to find:

pycountry provides the ISO databases for the standards:

639 Languages
3166 Countries
3166-2 Subdivisions of countries
4217 Currencies
15924 Scripts

The databases are imported from Debian's pkg-isocodes, packaged into pycountry and made accessible through a Python API.

Translation files for the various strings are included as well.

Grabbing data from Geonames would be an option. It is kept relatively up to date, and is under a CC license.

In case you don't want to use sql, here is just a javascript with region country's province/state, i found it a while ago. Maybe its of good use....

http://www.sitepoint.com/forums/showthread.php?350291-Country-State-City-Dropdown-list

As Squeeks says you can use GeoNames.

I did a tool ( https://github.com/yosoyadri/GeoNames-XML-Builder ) that downloads and saves GeoNames response as a XML file based on the library at http://geonamesdotorgdotnet.codeplex.com/.

You can also download a complete file of countries and states/provinces at https://raw.github.com/yosoyadri/GeoNames-XML-Builder/master/continents-countries-statesprovinces.xml

This is as close as it gets. http://27.org/isocountrylist/

This list is rather old, however it does offer a great deal of value for those wanting a country list, with codes and abbreviations. Also, there is a link to US States and provinces there too. This has been a good resource over the years.

With this table data, it's possible for someone to create some normalized data between countries, states, provinces, counties or whatever political jurisdictions.

I thought this would be a huge time saver for this task.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top