Route endpoint

Compute the route, distance, and travel time between two coordinates, by driving, walking, cycling, or transit.

GET https://{country}.yatmo.com/route LicenseKey header

Proxied to an internal GraphHopper routing engine.

Request

Name In Type Description
travelMode required query int 1 = Driving, 2 = Walking, 3 = Bicycling, 4 = Transit.
startLatitude required query double Origin latitude.
startLongitude required query double Origin longitude.
arrivalLatitude required query double Destination latitude.
arrivalLongitude required query double Destination longitude.

Examples

curl -H 'LicenseKey: YOUR_KEY' \
  'https://be.yatmo.com/route?travelMode=1&startLatitude=50.8520525&startLongitude=4.3442926&arrivalLatitude=50.8606&arrivalLongitude=4.3588'
const qs = new URLSearchParams({
  travelMode: 1,
  startLatitude: 50.8520525, startLongitude: 4.3442926,
  arrivalLatitude: 50.8606, arrivalLongitude: 4.3588
});
const res = await fetch(`https://be.yatmo.com/route?${qs}`,
  { headers: { LicenseKey: 'YOUR_KEY' } });
const route = await res.json();
console.log(route.paths[0].distance, 'meters,', route.paths[0].time, 'ms');
$qs = http_build_query([
    'travelMode' => 1,
    'startLatitude' => 50.8520525, 'startLongitude' => 4.3442926,
    'arrivalLatitude' => 50.8606, 'arrivalLongitude' => 4.3588,
]);
$ch = curl_init("https://be.yatmo.com/route?$qs");
curl_setopt($ch, CURLOPT_HTTPHEADER, ['LicenseKey: YOUR_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$route = json_decode(curl_exec($ch), true);
curl_close($ch);
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("LicenseKey", "YOUR_KEY");
var qs = "travelMode=1&startLatitude=50.8520525&startLongitude=4.3442926&arrivalLatitude=50.8606&arrivalLongitude=4.3588";
var json = await http.GetStringAsync($"https://be.yatmo.com/route?{qs}");

Response shape

Pass-through from GraphHopper. Top-level paths array with one entry per computed route:

Name In Type Description
paths[].distance number Route distance in meters.
paths[].time number Route duration in milliseconds.
paths[].points object GeoJSON LineString with the route geometry (coordinates as [longitude, latitude] pairs).
paths[].instructions array? Turn-by-turn instructions when available (nullable).
info object Engine metadata: copyright, processing time.

Notes