Solutions
Resources
Pricing
Sign in
Get a free trial
Products
Solutions
Resources
Pricing
Contact us
Contact us
Developer guides
Developer guides
The Distance Matrix API
The Distance Matrix API
The Geocoding API
The Geocoding API
The Asynchronous Distance Matrix API (Beta)
The Asynchronous Distance Matrix API (Beta)
Distance Matrix API guide
Geocoding API guide
Distance Matrix API guide
Geocoding API guide
DM API application guide
DM API application guide
Taxi services
Food delivery
Taxi services
Courier services
Logistics & Transportation
Courier services
Logistics & Transportation
Distance Matrix pricing
Distance Matrix pricing
Geocoding pricing
Geocoding pricing
Our news
Our news
Useful guides
Useful guides
Case studies
Case studies

Use API Keys with Distance Matrix API

Guide for developers
Introduction
Our Distance Matrix is a service designed to measure the relevant distance between any two objects on the map, and it also helps calculate the time of your travel between certain checkpoints.

Our technology is protected from unauthorized use by restricting API calls to those who provide the correct authentication credentials. These account details are in the form of an API key, also called an access token. It is a unique alphanumeric string that verifies that you are a user of the Distancematrix.ai services and grants you access.

In this guide, we tell you about the crucial points of the Distance Matrix API key. You will find out what it is for, how to get and use it, and its application restriction.

Purpose of Distance Matrix API keys

In addition to identifying the user, an API key authenticates requests and associates them with your account and project. Authenticated requests provide statistics of your Distance Matrix API use. These statistics are the base for billing purposes. About the billing and payment process, you can read in the FAQ.

In addition, you can easily track and control your usage statistics in the admin panel (page Usage). Knowing your current use, you can always predict your payment amounts.
You can find detailed price information at https://distancematrix.ai/pricing.

Getting Distance Matrix API keys

To get the API key for Distance Matrix API (also called an access token), you need to leave a request on the page https://distancematrix.ai/contact.

After sending the application, the user automatically receives an email with a token and information for starting. The letter also contains such information as a link to the admin panel, links to useful pages and instructions, information about restrictions, etc.

Please note that if your project requires several keys, you can request their creation from the manager in the correspondence.

Adding the Distance Matrix API key to your request

You must include the API key with every request. You should add it to the query string as the your_access_token parameter.

For example:
https://api.distancematrix.ai/maps/api/distancematrix/json?origins=51.4822656,-0.1933769&destinations=51.4994794,-0.1269979&key=<your_access_token>
Adding the Distance Matrix API key to your request
You must include the API key with every request. You should add it to the query string as the your_access_token parameter.

For example:
https://api.distancematrix.ai/maps/api/ distancematrix/json?origins= 51.4822656,-0.1933769&destinations= 51.4994794,-0.1269979&key=<your_access_token>

Restricting Distance Matrix API keys

For security reasons, we may impose some restrictions on access tokens. For example, for all free trial tokens, there is a limit on the total number of elements you can obtain during the test week. After the free trial, you can switch to paid or free use.

With free use, there are the following application restrictions for using our product:
5000 elements per month
only 1x1 matrices
one request per second
With paid usage, there is no limit on the number of elements you can obtain per month. But restrictions are set on the number of items in the query and the calculation time. The default limits are 100 elements per request and time of calculation – up to 50 items per second. You can change these limits upon request.

If you want to set additional restrictions for tokens, you can write about it to the manager in the correspondence.
Conclusion
We can conclude that our Distance Matrix API service suggests a much easier procedure for obtaining access to a credentials page than their analogs like Google, TomTom, and Bing. You can get a similar level of accuracy with the best world examples for a competitive price. Moreover, we provide reliable support throughout the entire period of using our product.
Do you need more information
about the Distance Matrix API?
The Distance Matrix API
The API accounts for traffic conditions, different travel modes, and includes a departure and arrival time option to build forecasts
The Distance Matrix API Documentation
Instruction for developers on Distance Matrix requests and responses. Easy migration from Google API, free trial, and flexible rate plans
No credit card required. Cancel anytime!
Start a free 7-day trial of the Distance Matrix API for Business
Get my 7-days free trial
Learn more about our pricing
Get my 7-days free trial
Learn more about our pricing