Directions API FAQ
这篇文档目前尚未提供译文,将以原文展示。
Q1. What is Directions API?
Directions API computes travel, time and distance between two places. The API outputs a most optimal route and ETAs between the origin and the destination pair.
Q2. What is a Waypoint?
Waypoints are coordinates along the route between Origin and destination. It is a pipe separated list of coordinate pairs that are included sequentially.
Q3. How many Waypoints can we pass under the Direction API request?
For a Directions API, you can use up to 50 Waypoints in GET request and up to 200 Waypoints in a POST request,
Q4. How is Directions API different from Distance Matrix API?
While both the APIs are customizable based on the vehicle type, Directions API allows a single set of Origin and Destinations with up to 200 waypoints along the route and Distance Matrix API supports a matrix size of 5000*5000 Origins and destinations.
Q5. What advantages does using Flexible version provide over the standard version of Direction API?
The Directions API has 2 versions to cater to different business needs. First, is the Fast version which would return the route and related information in real time. Second, is the Flexible version which offers truck routing and time-based routing features in addition to those available in the Fast version.
Q6. What are flexible-only parameters w.r.t. Directions API?
Time-dependent routing:
Truck-specific routing:
Route type:
departure_time | Example: departure_time=1563254734 | Please note that when route_type is set to shortest then the departure_time will be ineffective as the service will return the shortest path possible irrespective of the traffic conditions. |
Truck-specific routing:
truck_size | Format: height,width,length Example:truck_size=200,210,600 |
This defines the dimensions of a truck in centimetres (cm). This parameter is effective only when the mode=truck. Maximum dimensions are as follows: Height = 1000 cm Width = 5000 cm Length = 5000 cm |
truck_weight | Minimum: 1
Maximum: 100000 Example: truck_weight=11770 |
This parameter defines the weight of the truck including trailers and shipped goods in kilograms (kg). This parameter is effective only when mode=truck. |
Route type:
route_type | Default: fastest Example: route_type=fastest Allowed Values: fastest shortest |
Set the route type that needs to be returned. |
Q7. What are standard-only parameters w.r.t Directions API?
Standard(FAST) version supports car (“4w”) as the default along with the following mandatory parameters:
Flexible versions support 6W mode and more parameters as per requirements.
Origin | Format: latitude,longitude Example: origin=41.349302,2.136480 |
origin is the starting point of your route. Ensure that origin is a routable land location. |
Destination | Format: latitude,longitude Example: destination=41.349302,2.136480 |
destination is the ending point of your route. Ensure that destination is a routable land location. |
Flexible versions support 6W mode and more parameters as per requirements.
Q8. What are the API Methods available for Directions API?
Directions Fast API service can take input using both HTTPS GET and POST requests. Request URL, parameters and response schema are exactly the same for both methods. However, an important difference between these two input methods is in the maximum number of waypoints that can be added to the input.
For GET Request, the maximum number of waypoints allowed is 50.
For POST Requests, the maximum number of waypoints allowed is 200.
For GET Request, the maximum number of waypoints allowed is 50.
For POST Requests, the maximum number of waypoints allowed is 200.