Overview

GeoDB Cities is an application programming interface (API) that offers structured access to a global database of cities and their associated geographical and demographic data. This RESTful API is designed to support developers in integrating features such as city autocomplete functionality, detailed city information lookups, and the retrieval of timezone and population data into their applications. The API's capabilities extend to filtering cities by various criteria, including country, region, and minimum population, and sorting results based on proximity or name. Developers can also retrieve information about specific cities using unique identifiers.

The GeoDB Cities API is suitable for a range of use cases, from enhancing user experience in travel applications with predictive city search to powering data analysis platforms that require accurate demographic and geographical insights. Its focus on city-level data distinguishes it from broader geocoding services that might include street-level addresses. For instance, an e-commerce platform could use GeoDB Cities to validate shipping addresses at the city level or to provide localized content based on a user's declared city. The API's developer experience is supported by clear documentation and code examples in multiple programming languages, aiming to facilitate integration.

The service also includes a GeoDB Places API, which extends its functionality to points of interest within cities, such as restaurants, attractions, and public services. This complementary API allows for more granular location-based services beyond just city boundaries. The underlying data structure for both APIs emphasizes consistency and accuracy, drawing on various data sources to compile its database. GeoDB Cities is structured to provide information that is updated periodically, ensuring that population figures and geographical boundaries reflect current data points when available.

For applications requiring global coverage and consistent data formatting, GeoDB Cities provides a standardized approach to accessing city information. This can be particularly beneficial for international applications that need to handle diverse geographical naming conventions and data structures efficiently. The API's design prioritizes ease of use and developer accessibility, offering a free tier for initial exploration and scaling paid plans for higher usage volumes.

Key features

  • City Autocomplete Search: Provides predictive text suggestions for city names as users type, improving user experience in forms and search bars.
  • City Data Lookup: Retrieves detailed information for specific cities, including geographical coordinates, country, region, and administrative divisions.
  • Timezone Information: Supplies accurate timezone data for cities worldwide, useful for scheduling and localization features.
  • Population Data: Offers population figures for cities, enabling demographic analysis and data visualization.
  • Filtering and Sorting: Allows developers to filter city results by country, region, and minimum population, and sort by name or proximity to a given point.
  • International Coverage: Provides data for cities across the globe, supporting applications with an international user base.
  • RESTful API Design: Follows standard REST principles, making it accessible from various programming environments.
  • Multiple Language Support: Offers code examples and SDKs to support integration in languages such as JavaScript, Python, and PHP.

Pricing

GeoDB Cities offers a free tier for initial development and testing, with paid plans scaled to usage requirements.

Plan Name Monthly Requests Monthly Cost Features
Free Tier 10,000 $0 Basic access to city data
Pro Plan 50,000 $49 Standard features, increased request limits
Business Plan 250,000 $199 Higher request limits, priority support
Enterprise Plan Custom Custom Tailored solutions for high-volume usage

Pricing data as of 2026-05-28. For detailed and up-to-date pricing information, refer to the GeoDB pricing page.

Common integrations

  • Web Applications: Integrate with frontend frameworks like React or Angular using the JavaScript SDK for dynamic city search and display.
  • Mobile Applications: Utilize the API to provide location-based services and city information within iOS and Android apps.
  • Data Analytics Platforms: Incorporate city data into business intelligence tools for geographical analysis and reporting.
  • E-commerce Systems: Enhance address validation and shipping calculations by verifying city information.
  • Travel and Hospitality Platforms: Power destination search and provide localized content based on city data.

Alternatives

  • Google Maps Platform: Offers a comprehensive suite of mapping and location services, including geocoding, places, and routing APIs, with broad global coverage.
  • Mapbox: Provides customizable maps, location search, and navigation APIs, often favored for its design flexibility and mobile-first approach.
  • OpenCage: Specializes in geocoding and reverse geocoding, offering a global dataset with a focus on ease of use and transparent pricing for address lookup.
  • ArcGIS Platform: A comprehensive geospatial platform by Esri, offering mapping, geocoding, and advanced spatial analysis capabilities for enterprise applications.

Getting started

To get started with the GeoDB Cities API, you typically need to sign up for an API key and then make HTTP requests to the API endpoints. Here's a basic JavaScript example using fetch to retrieve a list of cities, filtered by country and minimum population. This example assumes you have an API key.


const apiKey = 'YOUR_API_KEY'; // Replace with your actual API key
const baseUrl = 'https://wft-geo-db.p.rapidapi.com'; // GeoDB API endpoint

async function getCities(countryCode, minPopulation) {
  try {
    const response = await fetch(`${baseUrl}/v1/geo/cities?countryIds=${countryCode}&minPopulation=${minPopulation}&limit=10`, {
      method: 'GET',
      headers: {
        'x-rapidapi-host': 'wft-geo-db.p.rapidapi.com',
        'x-rapidapi-key': apiKey
      }
    });

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();
    console.log('Cities:', data.data);
    return data.data;
  } catch (error) {
    console.error('Error fetching cities:', error);
  }
}

// Example usage: Get cities in the United States with a minimum population of 1 million
getCities('US', 1000000);

This JavaScript code snippet demonstrates how to query the GeoDB Cities API for cities within the United States that have a population of at least one million. It constructs a GET request to the /v1/geo/cities endpoint, including parameters for countryIds and minPopulation. The API key is passed in the request headers for authentication. The response, parsed as JSON, contains an array of city objects. For more detailed examples and endpoint references, consult the GeoDB Cities API reference documentation.