Route
Operations
Get Route Directions |
Applies to: S0 and S1 pricing tiers. Returns a route between an origin and a destination, passing through waypoints if they are specified. The route will take into account factors such as current traffic and the typical road speeds on the requested day of the week and time of day. Information returned includes the distance, estimated travel time, and a representation of the route geometry. Additional routing information such as optimized waypoint order or turn by turn instructions is also available, depending on the options selected. Routing service provides a set of parameters for a detailed description of vehicle-specific Consumption Model. Please check Consumption Model for detailed explanation of the concepts and parameters involved. |
Get Route Range |
Route Range (Isochrone) API Applies to: S1 pricing tier. This service will calculate a set of locations that can be reached from the origin point based on fuel, energy, time or distance budget that is specified. A polygon boundary (or Isochrone) is returned in a counterclockwise orientation as well as the precise polygon center which was the result of the origin point. The returned polygon can be used for further processing such as Search Inside Geometry to search for POIs within the provided Isochrone. |
Post Route Directions |
Applies to: S0 and S1 pricing tiers. Returns a route between an origin and a destination, passing through waypoints if they are specified. The route will take into account factors such as current traffic and the typical road speeds on the requested day of the week and time of day. Information returned includes the distance, estimated travel time, and a representation of the route geometry. Additional routing information such as optimized waypoint order or turn by turn instructions is also available, depending on the options selected. Routing service provides a set of parameters for a detailed description of a vehicle-specific Consumption Model. Please check Consumption Model for detailed explanation of the concepts and parameters involved. |
Post Route Directions Batch |
Route Directions Batch API Applies to: S1 pricing tier. The Route Directions Batch API sends batches of queries to Route Directions API using just a single API call. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to 700 queries and sync API up to 100 queries. Submit Synchronous Batch RequestThe Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to 100 for this API.
Submit Asynchronous Batch RequestThe Asynchronous API is appropriate for processing big volumes of relatively complex route requests
When you make a request by using async request, by default the service returns a 202 response code along a redirect URL in the Location field of the response header. This URL should be checked periodically until the response data or error information is available. The asynchronous responses are stored for 14 days. The redirect URL returns a 404 response if used after the expiration period. Please note that asynchronous batch request is a long-running request. Here's a typical sequence of operations:
POST Body for Batch RequestTo send the route directions queries you will use a
A route directions query in a batch is just a partial URL without the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported route directions URI parameters. The string values in the route directions query must be properly escaped (e.g. " character should be escaped with \ ) and it should also be properly URL-encoded. The async API allows caller to batch up to 700 queries and sync API up to 100 queries, and the batch should contain at least 1 query. Download Asynchronous Batch ResultsTo download the async batch results you will issue a
Here's the typical sequence of operations for downloading the batch results:
Batch Response ModelThe returned data content is similar for async and sync requests. When downloading the results of an async batch request, if the batch has finished processing, the response body contains the batch response. This batch response contains a
Here's a sample Batch Response with 1 successful and 1 failed result:
|
Post Route Matrix |
Applies to: S1 pricing tier. The Matrix Routing service allows calculation of a matrix of route summaries for a set of routes defined by origin and destination locations by using an asynchronous (async) or synchronous (sync) POST request. For every given origin, the service calculates the cost of routing from that origin to every given destination. The set of origins and the set of destinations can be thought of as the column and row headers of a table and each cell in the table contains the costs of routing from the origin to the destination for that cell. As an example, let's say a food delivery company has 20 drivers and they need to find the closest driver to pick up the delivery from the restaurant. To solve this use case, they can call Matrix Route API. For each route, the travel times and distances are returned. You can use the computed costs to determine which detailed routes to calculate using the Route Directions API. The maximum size of a matrix for async request is 700 and for sync request it's 100 (the number of origins multiplied by the number of destinations). Submit Synchronous Route Matrix RequestIf your scenario requires synchronous requests and the maximum size of the matrix is less than or equal to 100, you might want to make synchronous request. The maximum size of a matrix for this API is 100 (the number of origins multiplied by the number of destinations). With that constraint in mind, examples of possible matrix dimensions are: 10x10, 6x8, 9x8 (it does not need to be square).
Submit Asynchronous Route Matrix RequestThe Asynchronous API is appropriate for processing big volumes of relatively complex routing requests. When you make a request by using async request, by default the service returns a 202 response code along a redirect URL in the Location field of the response header. This URL should be checked periodically until the response data or error information is available. If The maximum size of a matrix for this API is 700 (the number of origins multiplied by the number of destinations). With that constraint in mind, examples of possible matrix dimensions are: 50x10, 10x10, 28x25. 10x70 (it does not need to be square). The asynchronous responses are stored for 14 days. The redirect URL returns a 404 response if used after the expiration period.
Here's a typical sequence of asynchronous operations:
Download Sync ResultsWhen you make a POST request for Route Matrix Sync API, the service returns 200 response code for successful request and a response array. The response body will contain the data and there will be no possibility to retrieve the results later. Download Async ResultsWhen a request issues a
The URL provided by the location header will return the following responses when a
|