Country City API is a REST API to get a list of all the countries in the world. It can also be used to get a list of all the cities in a country.
composer global require shivammathur/countrycity "master-dev"composer create-project shivammathur/countrycity countrycity "master-dev" --prefer-dist
/countries
Without URL Rewriting
/index.php/countries
/cities/{countryName}
Without URL Rewriting
/index.php/cities/{countryName}
Here are the server configuration instructions if you want to host this on a server.
{"error":"true", "message": "error message here"}