Menu

GeoDB Cities API

Comments

There are currently no blog comments.

Sort Cities, Get The User's Current City, And More

All API operations returning city collection results now provide an optional sort parameter taking multiple sort directives. What this means is you can now do something like get all cities sorted by country code, then by name. Or get all cities near a location, sorted by largest cities first.

And speaking of location, the following new operation is now available:

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

Among other things, this now allows you an easy way to get the user's current city.

Bug Fixes

  • The HATEOAS links for paged results have been corrected to include any specific query parameters from the original request.
  • The parameters related to location filtering have been renamed to be shorter. If you've been relying on these parameters, please make a note to update your code for the changed names. (Note: Any future such changes will be scoped by a new version of the API, insulating code relying on the previous version.) These changes are:
    • nearLocation → location
    • nearLocationRadius → radius
    • nearLocationRadiusUnit → distanceUnit

Go Back

Comment