GeoDB Cities API

Geocoding / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

GeoDB Cities provides detailed data on cities, regions, and countries worldwide, including population figures, time zones, and geographic coordinates. It supports filtering, sorting, and pagination, making it well-suited for building location pickers or geographic dashboards. You need a free RapidAPI key to access it.

💡

Beginner Tip

Start by querying the /cities endpoint with a namePrefix filter to build a city search autocomplete — this is the most common use case and easy to implement.

Available Data

IP address details
latitude and longitude
city and country
timezone
ISP information
country name and code

Example Response

JSON Response
{
  "name": "Japan",
  "capital": "Tokyo",
  "population": 125800000,
  "region": "Asia",
  "languages": [
    "Japanese"
  ],
  "flag": "https://flagcdn.com/jp.svg",
  "currencies": [
    {
      "code": "JPY",
      "name": "Japanese yen"
    }
  ]
}

Field Reference

data List of city objects matching the query.
data[].name Official name of the city.
data[].country Full country name where the city is located.
data[].population Estimated population of the city.
data[].latitude Geographic latitude of the city center.
data[].longitude Geographic longitude of the city center.

Implementation Example

const url = "http://geodb-cities-api.wirefreethought.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

403 Forbidden Missing or invalid RapidAPI key in the request headers.
Subscribe to the GeoDB Cities API on RapidAPI and include the X-RapidAPI-Key header with your key.
429 Too Many Requests The free tier has a low rate limit (typically 1 request/second).
Add a delay between requests or upgrade to a paid plan for higher throughput.
Empty data array The namePrefix or filter criteria did not match any city.
Double-check the spelling and try a shorter prefix; the search is case-sensitive in some configurations.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 10/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Geocoding
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →