Does there exist a publicly accessible parsable Country/Country Code list? [closed]

我的梦境 提交于 2019-12-04 05:58:53

I occasionally find the Apendix of the CIA - World Fact Book useful.

I assume what you want are the ISO 3166-1 2-alpha or 3-alpha codes, which are defined by ISO 3166-1. You can get various text and XML versions straight from ISO.org. This doesn't include any province, State, or city data, however.

EDIT: The UN/LOCODE site has a list of sublocations that sync up with ISO 3166-2 (ISO codes for provinces/States): http://www.unece.org/cefact/locode/service/sublocat.htm.

Also, UN/LOCODE has a location code list, which is a list of cities/towns by country: http://www.unece.org/cefact/locode/service/location.htm.

Finally, regarding the comment on regional differences/conflicts, ISO 3166-3 sort of approaches that, maintaining a list of prior names for locations.

In Java, you can call java.util.Locale.getISOCountries(), which may help, depending on what you need.

A region hierarchy is more complex; I expect it cost Yahoo a lot to build that aspect of FireEagle.

There is a lot of information in the GNS country files at http://earth-info.nga.mil/gns/html/namefiles.htm - names, locations and other data for a very large number of places internationally.

In mysql you can create country list with the help of Geonames API.

http://praveenravi.blogspot.in/2012/09/country-list-in-mysql.html

this link might be helpful

Wikipedia has a list all country codes and their corresponding countries. I found it through a google search for "wikipedia country code".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!