Skip to content

dylanblokhuis/country-city-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Country City API

Simple node.js microservice that provides up-to-date country and city names from United Nations Economic Commission for Europe

Quick start

npm install

npm run start

Quick start with Docker

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.

Routes

/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",
  ...
]