Distance API

Getting started

The tr.distance24.org API provides rich geo-related content. For example, the following request:


will return a json structure containing the distance between Hamburg and Berlin plus a lot of additional information related to these cities and the route between them.

Why use it?

There are many great sources of geo information on the web, such as: GeoNames, DBpedia, Google Maps, and Yahoo GeoPlanet. But none gives you the same variety of information as the tr.distance24.org API, and with the same performance and ease. Also, the API provides some pretty rare data, for example, the airport information.


The parameter "stops" is required. It takes a list of one or more city or country names, separated by a vertical bar ("|"). Make sure you encode the parameters properly (UTF-8).

JSONP support: Add a "jsonp" parameter to have the JSON data deliver as a script that passes the result to the given callback function.


result.distance Double Total distance between the places.
result.distances Array of Double Useful if more than two places have been specified.
result.travel.byPlane Object Recommended airports (properties: origin, destination) for flying. May contain the IATA code or the airport city name if the IATA code could not be found.
result.travel.byTrain Object Available train services
result.travel.byShip Object Available ship services
result.travel.timeOffset Object Time offset (if in different time zones)
result.stops Array of objects Information related to each single place.
result.stops[i].city String Official name.
result.stops[i].countryCode String ISO country code.
result.stops[i].region String State or region.
result.stops[i].postalCode String Don't rely on this one - cities usually have multiple postal codes, then this property is not available .
result.stops[i].longitude Double Geographical location - longitude part.
result.stops[i].latidude Double Geographical location - latitude part.
result.stops[i].timeZone object Timezone, with the following properties: id (Olsen ID) , name, abbr, offsetMin, dstSavingsMins.
result.stops[i].localTime object Current local time, with the following properties: formatted (formatted time string), dstActive (true if in daylight savings period)
result.stops[i].alt array of objects List of places with the same name. The API always returns the "best guess". If ambiguous, add latitude and longitude in brackets to the parameter, e.g.:
to select Hamburg, Pennsylvania.
result.stops[i].wikipedia object Wikipedia content related to the place
result.stops[i].wikipedia.abstract object Wikipedia intro for this place
result.stops[i].wikipedia.home URL string Official homepage of the place.
result.stops[i].wikipedia.population Number Population
result.stops[i].wikipedia.thumbnail URL string Thumbnail picture of the place.
result.stops[i].wikipedia.image URL string Larger picture of the place.
result.stops[i].airports Array of objects Airports found for this or near this place, with the properties name, iata (IATA code), and home (homepage of the airport).
result.stops[i].nearByCities Array of objects 30 related cities, with the properties city, distance, and category (near, medium of far). Called "nearby" for historical reasons: for the "far" cities obviously misleading.
result.stops[i].travelGuides Array of objects 3 most popular travel guides at Amazon, with the properties title, thumbnail, url, and review (if available).
result.stops[i].promotions object Contains local offers, such as last minute travel, coupons, etc.
result.stops[i].news object Contains current news related to this place, e.g. travel warnings.


The API is provided "as is". It may change at any time or may not be available. Please mailto:info@reezom.com for support.