Question

I need to get list of valid countries for web application, is there any list that could be downloaded as XML or similar format, so that I could atomatically update country list?

Was it helpful?

Solution

Get the ISO 3166 list (there is an XML version) from the ISO 3166 Maintenance agency. You can also look at Updates on ISO 3166. You can read about the standard on Wikipedia for more information.

OTHER TIPS

You can get a JSON list of country codes to names at http://country.io/names.json, and other country related data at http://country.io/data/

Here is the curated and regularly updated source of "country list" data available in CSV and JSON formats:

https://datahub.io/core/country-list

It also has an API if you need it. Here is the preview of the data:

<iframe src="https://datahub.io/core/country-list/r/0.html" width="100%" height="100%" frameborder="0"></iframe>

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