An open API service indexing awesome lists of open source software.

https://github.com/dylanblokhuis/country-city-api

Easy web service to fetch all countries including cities
https://github.com/dylanblokhuis/country-city-api

cities country-city-api docker microservice nodejs unece

Last synced: 2 months ago
JSON representation

Easy web service to fetch all countries including cities

Awesome Lists containing this project

README

        

# Country City API

Simple node.js microservice that provides up-to-date country and city names from [United Nations Economic Commission for Europe](https://unece.org)

## 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](http://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",
...
]
```