Where can I get a list of easily parseable country codes and names? Note: 2 letter codes wanted. Examples:
au,Australia
uk,United Kingdom
us,United States
etc
Where can I get a list of easily parseable country codes and names? Note: 2 letter codes wanted. Examples:
au,Australia
uk,United Kingdom
us,United States
etc
The ISO 3166-1 list of country codes is what I was looking for.
For more information you can also find general information about country codes on Wikipedia and a - possibly more up to date list - ISO 3166-1 list as well.
Edit: Posting it here:
In case it can help anyone, I just took the list of ISO 3166 country codes and names in English and French and put them together in CSV and SQL format: http://blog.plsoucy.com/2012/04/iso-3166-country-code-list-csv-sql/
While doing that, I fixed the capitalization so names aren't all uppercase, and renamed a few countries to the name that is used on Wikipedia, so "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF" became "Macedonia" for example. That should allow for shorter lists.
Feel free to use these if you want.
Take a look at ISO http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements.htm It is not CSV but you can easily copy and paste it into a file, or you can buy the file from ISO
updated the link
Here's a maintained repo of country codes with friendly country names in multiple languages and in many formats, including text, CSV, JSON, YAML, XML, SQL, and others:
https://github.com/umpirsky/country-list
The English CSV dump from the above repo: https://github.com/umpirsky/country-list/blob/master/data/en_US/country.csv