v5

latestSwagger 2.02026-07-1310125222.6 KB

Use to get the best route between an origin and destination for automobile, commercial trucks and walking routes.

The Route Directions API is an HTTP POST request that returns the ideal route between an origin and destination for automobile (driving), commercial trucks and walking routes. The route passes through a series of waypoints if specified. A waypoint is a geographical location defined by longitude and latitude that is used for navigational purposes. The route considers factors such as current traffic and the typical road speeds on the requested day of the week and time of day.

The API returns the distance, estimated travel time, and a representation of the route geometry. More routing information such as an optimized waypoint order or turn by turn instructions is also available, depending on the parameters used.

The Route Directions considers local laws, vehicle dimensions, cargo type, max speed, bridge and tunnel heights to calculate the truck specific routes and avoid complex maneuvers and difficult roads. Not all trucks can travel the same routes as other vehicles due to certain restrictions based on the vehicle profile or cargo type. For example, highways often have separate speed limits for trucks, some roads don't allow trucks with flammable or hazardous materials, and there can be height and weight restriction on bridges.

Up to 150 waypoints and 10 viaWaypoints between any two waypoints is supported. Each set of waypoints creates a separate route Leg. ViaWaypoints define the route path and can be used for route creation through specific locations, but they don't create route Legs.

For information about routing availability in countries/regions, see Azure Maps routing coverage.

post/route/directions

Query parameters

api-versionstring required

The API version to use for this operation.

Headers

x-ms-client-idstring

Indicates the account intended for use with the Microsoft Entra ID security model. This unique ID for the Azure Maps account can be obtained from the Azure Maps management plane Account API. For more information on using Microsoft Entra ID security in Azure Maps, see Manage authentication in Azure Maps.

Accept-Languagestring

Language in which routing results should be returned.

For more information, see Localization support in Azure Maps.

Response

The request has succeeded.

type'FeatureCollection'

Specifies the GeoJSON type. The only supported object type is FeatureCollection. For more information, see RFC 7946.

All 10 operations