Navigation products
Mapbox provides a collection of APIs to add directions-related services to your application. Generate a route with trip durations, estimated distances, and turn-by-turn directions with the Mapbox Directions API, retrieve travel times between many points with the Mapbox Matrix API, compute areas that are reachable within a specified amount of time from a location by the Mapbox Isochrone API, retrieve duration-optimized trips between points with the Mapbox Optimization API, or align existing fuzzy routes to the routeable network with the Mapbox Map Matching API. From routing deliveries efficiently to providing navigation steps for wayfinding, Mapbox provides the tools necessary to integrate directions into your application.
This guide provides an overview of how the routing network is created, how to add directions services to applications across platforms, how to provide feedback, and relevant documentation to help you get started.
Directions demo
In the demo below, you can enter two locations to be the starting and ending points of a Directions API query, then view the response as raw JSON:
The demo uses the Mapbox Directions API through the Mapbox GL Directions plugin with Mapbox GL JS to add driving, cycling, or walking directions to a web application.
The Mapbox Directions API returns a JSON object containing a route with trip durations, estimated distances, and turn-by-turn instructions. When using the Mapbox GL Directions plugin, all this information will be automatically added to the map when a request is complete. By default, the plugin will also display turn-by-turn instructions. This example hides the turn-by-turn instructions and displays the raw JSON response to illustrate what information is included in the directions response object.
How directions work
When you provide two or more points to the Mapbox Directions API, it returns a route as a GeoJSON line that you can add to your map, text for turn-by-turn instructions that you can choose to display in your application, and the distance and estimated travel times for the mode of transportation you selected. There are many other services that extend Mapbox directions that allow you to fix messy GPS traces to the network or optimize trips to multiple stops on a single journey.
The routing network
The Mapbox routing network can create routes and optimized trips, and is used to calculate the most efficient path for a given mode of transportation (driving, cycling, and walking). The routing network includes a robust network of roads and paths (also known as ways) with distinct attributes like speed limits, turn lane restrictions, mode of travel, and accessibility for bikes and pedestrians.
A way is an OpenStreetMap term used to describe an ordered list of nodes (points) which normally also has at least one tag, or description. For the purposes of the Mapbox Navigation service APIs, ways can be roads, foot paths, or bicycle lanes.
Travel times
The Mapbox Directions API, Matrix API, and Optimization API all provide estimated trip durations. The time it takes to travel from one point to another is determined by many factors, including:
- The routing profile used (
walking
,cycling
,driving
,driving-traffic
). - The speed stored in the
maxspeed
tag in OpenStreetMap. - Traffic derived from real-time telemetry data (when the traffic profile is used).
Traffic data
Incorporate real-time and typical traffic data using the mapbox/driving-traffic
routing profile into route selection and ETA generation with the Mapbox Directions API, Map Matching API, Matrix API, either into computing areas of reachability with the Mapbox Isochrone API, or add a traffic layer to road geometries on a visual map. Read more about our traffic tileset in Mapbox data.
The mapbox/driving-traffic
routing profile is available globally, but the availability of traffic varies by country. Real-time traffic shows speeds that have been directly observed in the last 15 minutes. Real-time traffic data is useful if there are atypical traffic patterns (for example, during severe weather events or accidents).
When real-time traffic conditions are not available, typical traffic conditions will be used instead. Typical traffic is an estimate for traffic speeds at a specific location, at a specific time, based on historical observations. Typical traffic data reflects normal traffic conditions during a typical week.
Traffic Coverage
For the following countries, the returned ETA is calculated using both real-time and typical traffic data along the requested route.
- Afghanistan
- Albania
- Algeria
- American Samoa
- Andorra
- Angola
- Antigua and Barbuda
- Argentina
- Armenia
- Aruba
- Australia
- Austria
- Azerbaijan
- The Bahamas
- Bahrain
- Bangladesh
- Barbados
- Belarus
- Belgium
- Belize
- Benin
- Bermuda
- Bhutan
- Bolivia
- Bosnia and Herzegovina
- Botswana
- Brazil
- British Virgin Islands
- Brunei Darussalam
- Bulgaria
- Burkina Faso
- Burundi
- Cabo Verde
- Cambodia
- Cameroon
- Canada
- Cayman Islands
- Chad
- Chile
- Colombia
- Comoros
- Congo, Dem. Rep.
- Congo, Rep.
- Costa Rica
- Cote d'Ivoire
- Croatia
- Cuba
- Cyprus
- Czech Republic
- Denmark
- Djibouti
- Dominica
- Dominican Republic
- Ecuador
- El Salvador
- Egypt, Arab Rep.
- Equatorial Guinea
- Estonia
- Eswatini
- Ethiopia
- Faroe Islands
- Finland
- Fiji
- France
- French Polynesia
- Gabon
- Gambia, The
- Georgia
- Germany
- Ghana
- Gibraltar
- Greece
- Greenland
- Grenada
- Guam
- Guatemala
- Guinea
- Guinea-Bissau
- Guyana
- Haiti
- Honduras
- Hong Kong SAR, China
- Hungary
- Iceland
- India
- Indonesia
- Iran, Islamic Rep.
- Iraq
- Ireland
- Isle of Man
- Israel
- Italy
- Jamaica
- Japan
- Jordan
- Kazakhstan
- Kenya
- Kiribati
- Korea, Rep.
- Kuwait
- Kyrgyz Republic
- Lao PDR
- Latvia
- Lebanon
- Lesotho
- Liberia
- Libya
- Liechtenstein
- Lithuania
- Luxembourg
- Macao SAR, China
- Madagascar
- Malaysia
- Malawi
- Maldives
- Mali
- Malta
- Marshall Islands
- Mauritania
- Mauritius
- Mexico
- Micronesia, Fed. Sts.
- Moldova
- Monaco
- Mongolia
- Montenegro
- Morocco
- Mozambique
- Myanmar
- Namibia
- Nepal
- Netherlands
- New Caledonia
- New Zealand
- Nicaragua
- Niger
- Nigeria
- Northern Mariana Islands
- North Macedonia
- Norway
- Oman
- Pakistan
- Panama
- Papua New Guinea
- Paraguay
- Peru
- Philippines
- Poland
- Portugal
- Puerto Rico
- Qatar
- Romania
- Russian Federation
- Rwanda
- Samoa
- San Marino
- Sao Tome and Principe
- Saudi Arabia
- Serbia
- Sierra Leone
- Singapore
- Slovak Republic
- Slovenia
- Solomon Islands
- Somalia
- South Africa
- Spain
- Sri Lanka
- St. Kitts and Nevis
- St. Lucia
- St. Vincent and the Grenadines
- Sudan
- Suriname
- Sweden
- Switzerland
- Syrian Arab Republic
- Taiwan
- Tajikistan
- Tanzania
- Thailand
- Timor-Leste
- Togo
- Tonga
- Trinidad and Tobago
- Tunisia
- Turkey
- Turkmenistan
- Turks and Caicos Islands
- Uganda
- Ukraine
- United Arab Emirates
- United Kingdom
- United States
- Uruguay
- Uzbekistan
- Vanuatu
- Venezuela, RB
- Vietnam
- Virgin Islands (U.S.)
- West Bank and Gaza
- Yemen, Rep.
- Zambia
- Zimbabwe
Using directions services
There are many tools you can use to enable directions-related services for your Mapbox web or mobile application. You can access these services directly using the web services APIs, through our Navigation SDK, or using one of several plugins and libraries to integrate these services into applications across platforms.