Skip to main content

Features and Capabilities

The Bing Maps Distance Matrix API can help your users determine the best route possible by reordering stops based on the trip’s parameters, including time or distance, mode of transportation (driving, walking, or public transit), start and end time, traffic prediction and more.

Multiple Agents

Supports up to 10 agents and 100 waypoints

Optimize Routes

Minimize travel time and distance for all agents

Predictive Traffic

Determine best day and time with historical traffic data

Customize Parameters

Input your preferences to reduce travel time or distance

Increased Accuracy

Calculates route with actual road distance

Distance Matrix API

Calculate travel time and distance

The Bing Maps Distance Matrix API service assists in calculating travel time and distances in many-to-many scenarios with an optional travel-time histogram. The Distance Matrix API can help answer questions as varied as where a commercial bakery should open their next location to optimize daily deliveries or helping a school district select the most optimal pick-up locations for their fleet of school buses.

Distance Matrix API

Capabilities

  • Optimize performance with intelligent apps that plan your route more effectively, saving time, money and resources.
  • Identify underserved markets and new locations for delivery optimization, data analysis and location grouping.
  • Plan, monitor and utilize assets to save time and reduce transportation costs.
Distance Matrix API

In Action

Real estate planning – Determine a future house location based on school, medical services, fire and rescue, work location, etc.

Field services – Route the closest technician to the client for service.

Retail – Optimize delivery from distribution centers to retail locations.

Frequently Asked Questions

Distance Matrix API uses billable transactions. If you have a Bing Maps key, review the Distance Matrix API documentation to learn more and start developing your distance matrix solution. If you don’t have a Bing Maps key, create a Bing Maps account and create a key to authenticate your application. Then follow the documentation to start developing your distance matrix solution.

For licensing questions, contact a Bing Maps expert.

To try this service, create a basic account, which will provide up to 125K transactions per calendar year at no charge. Above this usage limit, you will need to purchase a license. To purchase Transactions or Per Asset license, contact a Bing Maps Sales Specialist. To start developing with this API, use the Distance Matrix API documentation.

  • Distance Matrix API is available for Public and Internal transaction website licensing. It is not available for Known or Light Known users.
  • For Mobile Asset Management, the Distance Matrix API is available by purchasing an add-on license (Note- you must have the underlying Asset Management per asset license first).

Enterprise Customers will be able to license via the following options:

  1. Public or Internal Website Transactions (when using in an application that is not related to asset tracking) –
    If you are not licensed for Public or Internal Transactions, you can purchase these from your sales partner.

    • You will need to create a separate account ID on the Bing Maps Dev Center that will be specific to your internal transaction usage.
    • Distance Matrix API is available for Public and Internal transaction website licensing. It is not available for Known or Light Known users.

    Note – This API will increase the consumption of billable transactions, which may result in the need to purchase additional transactions.

  2. Per Asset (applicable when being used as part of asset tracking solution) – To use the Distance Matrix API, you will need an underlying Asset Management per asset license (with or without routing) and will the need to purchase an additional per asset license for the use of this new service. For licensing and pricing questions, please contact a Bing Maps Sales Specialist.

When calculating a simple distance matrix each origin-destination pair will generate a single cell in the matrix.

Total # of cells = # of origins * # of destinations

For example, a matrix that has 2 origins, and 5 destinations, will generate 10 cells where 2 * 5 = 10.

When a matrix includes a histogram, each origin-destination pair will have a cell in the matrix for each time interval. The number of time intervals that a request will have depends on the resolution, start and end times.

Total # of cells = # origins * # destinations * (endTime in hours-startTime in hours) / resolution*0.25

For example, a matrix that has 2 origins, 5 destinations, and retrieves time intervals in 15-minute increments (resolution = 1) over 24 hours, will generate 960 cells where 2 * 5 * 24/0.25 = 2 * 5 * 24 * 4 = 960.

How to calculate total number of billable transactions a request will generate
A billable transaction is generated for every 4 cells in a matrix, rounded up to the nearest whole integer. For a simple matrix, billable transactions will be calculated using the following formula:

Total # of billable transactions = Ceiling (# origins * # destinations * ¼)

For example, a matrix that has 4 origins, and 5 destinations, will generate 5 billable transactions where Ceiling(4 * 5 * ¼) = 5.

When calculating a matrix which includes a histogram, only the first 30 time intervals in each origin-destination pair are counted towards billable transactions, any additional time intervals are provided for free.

Total # of billable transactions =
Ceiling (¼ * # origins * # destinations * Min (30, endTime in hours – startTime in hours / resolution * 0.25))

For example, a matrix that has 4 origins, 5 destinations, and retrieves time intervals in 15 minute increments (resolution = 1) over 24 hours, will generate 150 cells where Ceiling(¼ * 4 * 5 * Min(30, 24/0.25)) = Ceiling(¼ * 4 * 5 * Min(30, 96)) = Ceiling(¼ * 4 * 5 * 30) = 150. Note that 24/0.25 = 24 * 4 = 96, but since only the first increments per origin-destination pair is counted towards billable transaction, 66 time intervals are excluded from the transaction calculation per origin-destination pair, thus saving you a total of 330 billable transactions in this scenario.

A standard distance matrix can have up to 625 origin-destination pairs. A single cell in a matrix is created for each origin-destination pair. Thus, multiplying the number of origins by the number of destinations will provide you with the number of origin-destination pairs. If this number is equal to or less than 625, the origins and destinations can be passed into a single request. For example, you can have 1 origin and 625 destinations, or 25 origins and 25 destinations. See the Distance Matrix API documentation for more information.

For a distance matrix that provides a histogram, the API allows up to a total of 100 origin-destination pairs. For example, 1 origin and 100 destinations, or 10 origins and 10 destinations.

To try the Distance Matrix API, you will need to create a Basic key. When you are ready to deploy into production, you will need to upgrade to an Enterprise key.

The Distance Matrix API is available for Basic and Enterprise accounts (normal TOU limits will apply for Basic accounts), and is available for Public and Internal Website transactions or as an additional per asset license. It is not available for Known or Light Known users.

If you would like to try the API, you can create a Basic key. To deploy into production, you will need to upgrade to an Enterprise key.

Take a look at this project on GitHub, as it makes it easy to use the Distance Matrix API in .NET and also includes examples on how to use the Distance Matrix API.

To develop and deploy this service, refer to the Distance Matrix API documentation. If you have licensing questions, please contact a Bing Maps Sales Specialist. For Enterprise Customer Support, click here. Or check out the Bing Maps Developer Network forum.

Fleet Management Solutions

Distance Matrix API

Calculate travel times and distances between a set of origins and destinations.

Isochrone API

Calculate the area that can be travelled to within a specified distance or time.

Multi-Itinerary Optimization API

Automate itineraries for multiple agents while optimizing all their routes.

Snap to Road API

Advanced data visualization and asset tracking with coordinates that follow the geometry of the road.

Truck Routing API

Designed for professional transportation routing logistics.

Bing Maps for Enterprise

Distance Matrix API

Maximize efficiency by calculating travel time and distances in many-to-many scenarios with Bing Maps Distance Matrix API, offering traffic prediction and more.