Simple node.js microservice that provides up-to-date country and city names from United Nations Economic Commission for Europe
npm install
npm run start
Pull latest image from registry
docker pull dylanblokhuis/country-city-api
Start the container
docker run -d -p 3000:3000 dylanblokhuis/country-city-api
Open localhost:3000 to see if it's working.
/countries
Response
[
...
{
"countryCode": "NL",
"url": "https://service.unece.org/trade/locode/nl.htm",
"name": "Netherlands"
},
{
"countryCode": "NC",
"url": "https://service.unece.org/trade/locode/nc.htm",
"name": "New Caledonia"
},
{
"countryCode": "NZ",
"url": "https://service.unece.org/trade/locode/nz.htm",
"name": "New Zealand"
},
...
]
/countries/:countryCode
Example: /countries/NL
Response
[
"Aa en Hunze",
"Aalburg",
"Aalsmeer",
"Aalsmeerderbrug",
"Aalst",
"Aalten",
"Aan de Zuwe",
"Aardenburg",
"Aarlanderveen",
"Aarle Rixtel",
"Abbegaasterketting",
"Abbekerk",
"Abbenbroek",
...
]