World Cities

FREEMIUM
By andruxnet
Updated 4 months ago
Location
8.5/10
Popularity Score
373ms
Latency
100%
Success Rate

World Cities API Documentation

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.

View API Details
GETQuery
GETQuery

Use a query with at least 3 characters to search for a city, state or country matching the query

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Optional Parameters
querySTRING
OPTIONALIt can be part of the name of a city, state or country. At least 3 characters are needed.
searchbySTRING
OPTIONALOptionally search by city, state or country to narrow the results.
Code Snippet
unirest.get("https://andruxnet-world-cities-v1.p.rapidapi.com/?query=paris&searchby=city")
.header("X-RapidAPI-Host", "andruxnet-world-cities-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://andruxnet-world-cities-v1.p.rapidapi.com/
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

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

unirest.get("https://andruxnet-world-cities-v1.p.rapidapi.com/?query=paris&searchby=city")
.header("X-RapidAPI-Host", "andruxnet-world-cities-v1.p.rapidapi.com")
.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