I want to make service with API that give some info about a city (in any country) by some id.
What I should choose as id for cities? Does there exist an ISO standard for city identification? If so, where I can get a list of city ids?
There is an ISO standard for Country code, but none (that I can find) for city code. There is, however; a United Nations Economic Commission for Europe United Nations Code for Trade and Transport Locations system of city identification UN/LOCODE. Edit: Lined out the wrong name, added the slash to the UN/LOCODE name.
The country codes can be represented either as a two-letter code (alpha-2) which is recommended as the general-purpose code, a three-letter code (alpha-3) which is more closely related to the country name and a three-digit numeric code (numeric-3) which can be useful if you need to avoid using Latin script.
The ISO country codes are internationally recognized codes that designate every country and most of the dependent areas a two-letter combination or a three-letter combination; it is like an acronym, that stands for a country or a state.
There is an ISO standard for Country code, but none (that I can find) for city code. There is, however; a United Nations Economic Commission for Europe United Nations Code for Trade and Transport Locations system of city identification UN/LOCODE.
Edit: Lined out the wrong name, added the slash to the UN/LOCODE name.
I decided to use IATA codes for cities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With