What is a Distance Matrix API?

A Distance Matrix API is a web service that calculates the distances and journey times between a set of origins and destinations. The matrix is normally calculated for a chosen mode of transport and can be one-to-many, or many-to-many.

One to many matrix
Many to many matrix

Contents

      Use cases for a distance matrix are incredibly broad, from fleet optimisation to gravity modelling to B2C search applications.

      There are a number of different providers offering similar products to meet these different application areas, often with slightly different features that can be hard to disentangle in order to work out how they stack up against one another.  

      There are a couple of key areas where differences between different providers are more obvious though:

      1. Usage limits - what size matrices can you generate, and how quickly?
      2. Pricing - how much does it cost to generate matrices of different sizes?

      This blog will compare these two criteria for the following providers:

      • Google Distance Matrix API
      • TravelTime Matrix API
      • Mapbox
      • TomTom
      • Bing
      • OpenRouteService
      • Nextbillion.ai
      • Graphhopper

      Why pick these two criteria for a comparison?

      The reason that these two criteria are important may be obvious, but it is worth touching on it briefly.

      Without suitable usage limits, a Distance Matrix API may have all the features and functionality that you need to meet your business need in theory, but it just will not do the job. For example, it may take so long to get the data you require, and therefore renders itself unusable.

      But even with high enough usage limits, if the pricing model does not match accordingly, then again, the Distance Matrix API will be redundant. It’s all very well being able to generate the data you require in a workable time frame, but if it is prohibitively expensive to do so then you simply will not be able to.

      Criteria 1 - Price

      When it comes to pricing, Distance Matrix API providers typically offer some form of free tier, and then charge based on the number of ‘elements’ used.

      What is an element?

      An element is normally defined as each result in the matrix (i.e the distance and travel time between one origin and one destination. So, for example, a matrix with 1 origin and 1,000 destinations would equate to 1,000 elements (1 x 1,000), while a matrix with 10 origins and 20 destinations would be 200 elements (10 x 20).

      Very occasionally a provider will calculate their own unit to price on (e.g “Elements / 2”) but the general idea is broadly the same.

      The table below compares the monthly price for a number of the main Distance Matrix API providers, based on various monthly volumes of elements.

      Monthly Volume
      (Elements)
      Monthly Price
      (per 1,000 Elements)
      TravelTime 0 - 100,000
      100,000+
      Free
      $0.70
      Google 0 - 100,000
      100,001 - 500,000
      $5
      $4
      Mapbox 0 - 100,000
      100,001 - 500,000
      501,000 - 1,000,000
      1,000,001 - 5,000,000
      Free
      $2
      $1.60
      $1.20
      TomTom Any $4
      Bing Unknown Unknown
      OpenRouteService 0 - 52,500,000 Free*
      Nextbillion.ai 0 - 100,000
      100,001 - 500,000
      501,000 - 1,000,000
      1,000,001 - 5,000,000
      5,000,001 - 10,000,000
      $1.80
      $1.50
      $1.20
      $0.90
      $0.75
      Graphhopper Not based on Elements Not based on Elements

      *Limited to 500 requests per day

      Criteria 2 - Usage Limits

      When it comes to usage limits, there is a fair degree of standardisation across the market, with limits normally based on two metrics:

      1. How many elements can be included in a matrix request?
      2. How many requests can be made to the API in a given time period (usually per minute)?

      In other words, how big can a single matrix be and how quickly can you make multiple matrices?

      The table below compares these two metrics for the same major Distance Matrix API providers:

      Maximum Matrix Size
      (Elements)
      Requests per Minute
      TravelTime 1,000,000 250
      Google 100 600
      Mapbox 625 60
      TomTom 2,500 Unknown
      Bing 10,000 Unknown
      OpenRouteService 3,500 40
      Nextbillion.ai 1,000,000 6,000
      Graphhopper 150 Not based on Requests

      What do these results mean?

      The comparisons of Usage Limits and Pricing can be looked at separately, but it often makes more sense to assess a provider by looking at both together.

      For example, going just on price alone then OpenRouteService seems an obvious first choice given the fact that it is completely free. Once you take the usage limits into account, however, it becomes clear that the maximum allowance of 40 requests per minute and 500 requests per day may not be sufficient for the majority of Distance Matrix API use cases.

      On the other hand, if we were to judge based solely on usage limits then Google looks like a decent option with its 600 requests per minute. Where it falls down, however, is on pricing, with a starting point of $5 per 1,000 elements – significantly more than most of the other available providers.

      Why is TravelTime up to 10 times cheaper than alternatives?

      The TravelTime Distance Matrix API has been built specifically for processing large volumes of elements efficiently at scale. Because of this, we are able to deliver incredibly high levels of performance at a significantly lower cost than other providers.

      There is no loss of data quality associated with these efficiencies – they are simply the cumulative impact of several years striving to drive down response times while increasing the volume of elements that the API can process. There are now over 10bn elements per month being calculated by our Distance Matrix API.

      Choosing a Distance Matrix API provider to suit your needs

      Given the broad range of potential use cases, it’s no real surprise that there are a large number of different providers in the market that offer a Distance Matrix API. When choosing between them, the features and functionality on offer are often broadly similar, but where the biggest differences come in are around Pricing and Usage Limits.

      When making your decision, we’d always advise that you map out what sort of usage you are expecting to see, and then pick a provider that can both meet your requirements in terms of usage, but not at a price that is going to blow your budget out of the water.

      Ready to try TravelTime?

      TravelTime is built for high volume users focused on performance and data accuracy.

      • High usage limits
      • Low cost

      Try it free:

      CTA
      Distance matrix

      Share this article

      Create travel time polygons and matrices with the TravelTime API

      Calculate thousands of travel times with the TravelTime API