Menu

GeoDB City API - Find Cities For Your Criteria | Wirefree Thought

header photo

Comments

There are currently no blog comments.

Santa's Got More: Distance Between Cities, Location Enhancements

December 12, 2017

You can now find the distance between any two cities.

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/geo/cities/{fromCityId}?toCityId={toCityId}&distanceUnit={KM | MI)' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

In addition...

Find-Cities API Enhancements

  • When finding cities using location criteria, GeoDB will now include each city's distance from the requested location, sorting results by distance.
  • All city results now include latitude/longitude, saving you a trip to the Get-City-Details API.

Merry Christmas & Happy Hanukkah: Time-Zones Are Here!

December 1, 2017

All cities now include time-zone data. The following functionality is now available:

Get Available Time-Zones

Gets all available time-zones in the system. You should use these time-zone IDs as input to the other methods below, as GeoDB has its own way of encoding the '/' separator.

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/locale/timezones?offset=0&limit=500' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

Find Cities by Time-Zones

Finds all cities in the given comma-delimited set of time-zones.

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/geo/cities?timeZoneIds={commaDelimitedZoneIds}&offset=0&limit=10' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

Get City Date-Time

Returns the given city's date-time in ISO-8601 format, taking into account daylight savings.

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/geo/cities/{cityId}/dateTime' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

Get City Time

Returns the given city's time in ISO-8601 format, taking into account daylight savings.

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/geo/cities/{cityId}/time' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

Get Time-Zone Date-Time

Returns the given time-zone's date-time in ISO-8601 format, taking into account daylight savings.

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/locale/timezones/{zoneId}/dateTime' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

Get Time-Zone Time

Returns the given time-zone's time in ISO-8601 format, taking into account daylight savings.

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/locale/timezones/{zoneId}/time' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

Now get nearby cities in a single call!

October 25, 2017

You can now easily find cities near a given city in a single call. Previously, you had to first get a city's details to obtain its latitude/longitude coordinates, then make a separate call to find all cities in that location. Now you can just do:

curl --get --include 'https://wft-geo-db.p.mashape.com/v1/geo/cities/{cityId}/nearbyCities?nearLocationRadius={nearLocationRadius}&nearLocationRadiusUnit={nearLocationRadiusUnit}&minPopulation={minPopulation}&offset=0&limit=500' \
    -H 'X-Mashape-Key: YOUR_API_KEY' \
    -H 'X-Mashape-Host: wft-geo-db.p.mashape.com'

Go here for more details.

Welcome!

October 24, 2017

The intent of this blog is to communicate any new features, fixes to, or issues identified with the service — or anything else that might be of interest to anyone consuming this API.

Translation: If you are a developer currently using GeoDB, you really owe it to yourself to subscribe to this blog.