Skip to content

GeoDB Cities API API

by mashape.com

API keyHTTPSDevelopment
Open documentation ↗

Overview

The GeoDB API focuses on getting global city and region data. Easily obtain country, region, and city data for use in your apps! <ul> <li>Filter cities by name prefix, country, location, time-zone, and even minimum population.</li> <li>Sort cities by name, country code, elevation, and population - or any combination of these.</li> <li>Get all country regions.</li> <li>Get all cities in a given region.</li> <li> Display results in multiple languages.</li> <li>RESTful API adheres to industry best-practices, including HATEOAS-style links to facilitate paging results. </li> <li>Backed by cloud-based load-balanced infrastructure for resiliency and performance!</li> <li>Data is periodically refreshed from GeoNames and WikiData.</li> </ul> <p>Notes: <ul> <li> Since the database is periodically updated, this may <strong>very rarely</strong> result in certain cities being marked deleted (e.g., duplicates removed). By default, endpoints returning city data will exclude cities marked deleted. However, in the unlikely event that this occurs while your app is paging through a set of affected results - and you care about the paged results suddenly changing underneath - specify <tt>includeDeleted=SINCE_YESTERDAY</tt> (or <tt>SINCE_LAST_WEEK</tt> if you're really paranoid!). </li> </ul> <hr/> <h3>Useful Resources</h3> <ul> <li> SDKs <ul> <li> <a href='https://www.npmjs.com/package/wft-geodb-angular-client'>Angular</a>, <a href='https://github.com/wirefreethought/geodb-sample-angular-app'>Sample App</a> </li> <li><a href='https://github.com/wirefreethought/geodb-java-client'>Java</a></li> <li><a href='https://www.npmjs.com/package/wft-geodb-js-client'>JavaScript</a></li> </ul> <li><a href='swagger.json'>Swagger Docs</a></li> <li><a href='http://creativecommons.org/licenses/by/3.0/'>Usage License</a></li> </li> </ul>

GeoDB Cities API is a development API from mashape.com. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 26 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Category
Development
Base URL
https://wft-geo-db.p.rapidapi.com/v1
Version
1.0.0
Endpoints
26
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://wft-geo-db.p.rapidapi.com/v1/geo/adminDivisions" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://wft-geo-db.p.rapidapi.com/v1/geo/adminDivisions", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://wft-geo-db.p.rapidapi.com/v1/geo/adminDivisions",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/geo/adminDivisionsFind administrative divisions
GET/geo/adminDivisions/{divisionId}Get administrative division details
GET/geo/adminDivisions/{divisionId}/nearbyCitiesFind cities near division
GET/geo/adminDivisions/{divisionId}/nearbyDivisionsFind divisions near division
GET/geo/citiesFind cities
GET/geo/cities/{cityId}Get city details
GET/geo/cities/{cityId}/dateTimeGet city date-time
GET/geo/cities/{cityId}/distanceGet city distance
GET/geo/cities/{cityId}/locatedInGet city admin region
GET/geo/cities/{cityId}/nearbyCitiesFind cities near city
GET/geo/cities/{cityId}/timeGet city time
GET/geo/countriesFind countries
GET/geo/countries/{countryId}Get country details
GET/geo/countries/{countryId}/regionsFind country regions
GET/geo/countries/{countryId}/regions/{regionCode}Get region details
GET/geo/countries/{countryId}/regions/{regionCode}/adminDivisionsFind country region administrative divisions
GET/geo/countries/{countryId}/regions/{regionCode}/citiesFind country region cities
GET/geo/locations/{locationId}/nearbyCitiesFind cities near location
GET/geo/locations/{locationId}/nearbyDivisionsFind divisions near location
GET/locale/currenciesFind currencies
GET/locale/languagesGet languages
GET/locale/localesGet locales
GET/locale/timezonesGet time-zones
GET/locale/timezones/{zoneId}Get time-zone
GET/locale/timezones/{zoneId}/dateTimeGet time-zone date-time
GET/locale/timezones/{zoneId}/timeGet time-zone time

Questions

Does the GeoDB Cities API API need an API key?

Yes. The GeoDB Cities API API uses API key authentication; the documentation explains how to get credentials.

Does the GeoDB Cities API API support HTTPS?

Yes, the GeoDB Cities API API is served over HTTPS.

How many endpoints does the GeoDB Cities API API have?

Its OpenAPI description lists 26 endpoints in version 1.0.0. All of them are shown on this page.

What are alternatives to the GeoDB Cities API API?

Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.

Compare alternatives →

Listed from APIs.guru (CC0).