World Cities

By andruxnet
Updated 4 months ago
Popularity Score
Success Rate

World Cities API Overview

Get a list of cities that match a search criteria. Results in JSON and include city, state and country. Search criteria is also applied to states and countries.

Optionally, provide a "searchby" parameter that can be one of "city", "state" or "country" to narrow the results.

Contact API Provider

Missing or incorrect information?

If you find incorrect information being returned by the API, or if a city, state or country is missing, please open a support ticket with the information and I'll gladly update the API database.

Extend the API

Do you need some extra information to be returned? What about some extra endpoints?

I'll be adding the ability to control if the query is searched only for cities, states, countries, all of them or any combination. For example, if you only want to search states and cities that match your query, but exclude searching the countries list.

Another feature in progress is to include country codes and phone codes, also with the ability to select which data you want instead of returning all columns.

In any case, if you need some other feature to be added just open a ticket and we'll talk about it.

Install SDK for NodeJS


To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

.header("X-RapidAPI-Host", "")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication