Menu

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

header photo

Getting The distance between two cities

1. First, find the two cities of interest.

2. Now get the distance in miles:

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

Where:

fromCityId The origin city
toCityId The city to find the distance to.

 

 

The distance will be returned in terms of the requested distanceUnit.