Get Route Directions
Calculates the best driving route between two points, with optional waypoints, and returns the travel time, total distance and the route as coordinates. With `alternative=t`, other possible routes come back in `alternates`.
Calculates the best driving route between two points, with optional waypoints, and returns the travel time, total distance and the route as coordinates. With alternative=t, other possible routes come back in alternates.
origin*stringStarting point of the route in the format {latitude,longitude}.
destination*stringEnding point of the route in the format {latitude,longitude}.
apiKey*stringAPI key used to authenticate the request.
waypoints?stringAn optional list of intermediate points the route must pass through, formatted as an array of {latitude,longitude} pairs.
alternative?"t"Set to t to also get other possible routes, in alternates.
"t"The route, and alternatives if requested.
application/json- response
msg?stringtimetaken?numberTravel time in seconds.
totalDistance?numberRoute length in meters.
direction?array<array<number>>The route as [lat, lng] points.
alternates?array<>Other possible routes. Only present with alternative=t.
curl -X GET 'https://mapapi.gebeta.app/api/route/direction/?origin=%7B8.987685259188599%2C38.764792722654455%7D&destination=%7B9.087685259188599%2C38.764792722654455%7D&apiKey=your-api-key-here&waypoints=%5B%7B8.9879443%2C+38.7651287%7D%5D'{ "msg": "Ok", "timetaken": 1275.631, "totalDistance": 8895, "direction": [ [ 9.055978, 38.704943 ], [ 9.056214, 38.704691 ] ], "alternates": [ { "timetaken": 1182.037, "totalDistance": 8425, "direction": [ [ 9.055978, 38.704943 ] ] }, { "timetaken": 1404.338, "totalDistance": 10585, "direction": [ [ 9.055978, 38.704943 ] ] } ]}