Find Nearest Destination and Compare Routes

Calculates routes from a single origin to multiple destinations, returning travel times, distances, and paths. Helps determine which destination is nearest in terms of actual travel cost.

GET
/api/route/onm

Calculates routes from a single origin to multiple destinations, returning travel times, distances, and paths. Helps determine which destination is nearest in terms of actual travel cost.

Query Parameters

origin*string

A single origin coordinate pair in the format {lat,lon}. Example: {8.457685259188599,38.764792722654455}

json*string

An array of destination coordinate pairs in the format [{lat1,lon1},{lat2,lon2},...].

apiKey*string

API key used for authentication and usage control.

Response Body

Travel time and distance from the origin to each destination.

application/json
  1. response
origins?array<>

The origins, snapped to the nearest road.

destinations?array<>

The destinations, snapped to the nearest road.

origin_to_destination?array<>

One entry per origin and destination pair.

curl -X GET 'https://mapapi.gebeta.app/api/route/onm?origin=%7B8.457685259188599%2C38.764792722654455%7D&json=%5B%7B8.987685259188599%2C38.764792722654455%7D%2C%7B9.087685259188599%2C38.764792722654455%7D%5D&apiKey=your-api-key-here'
{  "origins": [    {      "lat": 9.052066,      "lon": 38.710815,      "radius": null    }  ],  "destinations": [    {      "lat": 9.04128,      "lon": 38.721692,      "radius": null    },    {      "lat": 9.048567,      "lon": 38.73236,      "radius": null    }  ],  "origin_to_destination": [    {      "from": 0,      "to": 0,      "distance": 4.008,      "time": 611    },    {      "from": 0,      "to": 1,      "distance": 4.164,      "time": 719    }  ]}