GeoDB Cities API

handling deleted cities

Part of the benefit of using GeoDB is it will periodically refresh its city database with the latest GeoNames data. As part of this refresh, some cities will be marked deleted. (Usually because they were determined to be duplicates.)

But never fear: You will ALWAYS be able to retrieve a city by id obtained through some prior call to get cities. GeoDB will never actually physically delete the record, only mark it as deleted.

However, when requesting city collections, GeoDB will by default exclude cities marked deleted. This means that in the unlikely event that GeoDB marks one or more cities as deleted as your user is paging through a set of city results, your app paging widget may end up in an inconsistent state.

To guard against this, when paging city results, set the includeDeleted param to one of the following self-explanatory options:

  • ALL

For example, to return all cities, including those that may have been deleted in the last 24 hours:

curl --get --include '' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host:'