Features of the Distance Matrix API

Features of the Distance Matrix API
Photo Credit: Rapid API

Let’s start

It is unlikely needs to be proved today the fact that such a software product as a distance matrix that solves almost any transport problem is not only extremely in demand but often necessary.  Accordingly, the demand for various services that have such software in their arsenal is increasing. And here we would like to emphasize that it is the distance matrix ai of the service that proves its exceptional usefulness, especially in those areas of human activity that are somehow related to transport, logistics, routing, navigation, etc.

Scope of the Distance Matrix API

It is not necessary to go far for examples to see that many situations in everyday life are successfully resolved thanks to the distance matrix. Here are just a few examples, but not limited to them. Calculating the distance between two or more coordinate points, developing routes between places, calculating the time to cover the planned distances, planning business and personal trips by various modes of transport and even on foot – all this and much more requirements is easily covered by the functionality of the Distance Matrix API (DMA API). Why the API interface is added to the distance matrix is obvious and should not lead to misunderstanding.

The API interface acts as a kind of software intermediary that connects your program with other programs that are useful to you. Returning to the functional features of the DMA API, it is impossible not to mention that any planning with its help takes into account the objectively existing traffic situation. Despite the seeming insignificance, this indicator is very important, especially for business trips, as it allows you to foresee convenient travel times at the planning stage, as well as combine different modes of transport to overcome problematic parts of the route.

Briefly About Requests and Responses

So what is the essence of the process by which users can realize their plans and tasks related primarily to transport and movement? The essence is elementary and lies in the activation of the communication chain “request-response.”

Let’s start with a request. When in ordinary life, we want to get to someplace and ask for directions from people passing by, we give the address or name of the object we are looking for or the hallmarks of the place we need. In the case of the DMA API, the situation is similar; only we communicate with the service, not through verbal communication, but make a request in the form of an HTTP or HTTPS protocol. Just like when communicating with a person, the request for the DM API must contain the input information necessary to process the request.

First of all, these are the starting and finishing points of the route (in the amount of one or more). The format for indicating the location of these places can be either in the form of textual identification familiar to us or in the form of numerical designations of the geographical grid (coordinates). Since the service has a geocoder in its arsenal, the process of transforming one type of address into another is carried out quickly and without problems. The second necessary component of the request is a kind of user’s autograph or, in other words, the API key.

Like any key in everyday life, the API key serves as a confirmation of the owner’s identity, a guarantor of the security of his data, and the ability to track the entire activity history and adjust it depending on the goals and capabilities. Both the location identification and the API key are indispensable attributes of the request. There are other optional but desirable parameters. To find out what these parameters are, visit our website, study the necessary documents and easily fill out your requests.

Now let’s discuss the response of the service to the sent request. The response is formed in a relatively simple configuration, which is represented by JavaScript Object Notation, or JSON for short. Such a configuration is convenient and simple, both for writing and for reading, and is equally acceptable for use by both a computer and a person. So, a JSON response, just like a request, contains a certain number of elements.

Obviously, that set of information on the addresses or coordinates that were requested by the user will be an indispensable element. In addition, the response will reflect both the distances and the duration of the movement in time in accordance with the requested information.

There is another interesting parameter in the response – this is the so-called field of status codes. And if you see the “OK” indicator in this field, then your request is accepted as correct, and a correct answer is also generated for it. If, for a number of reasons, the request is invalidated, then instead of the “OK” entry, you will see a different entry indicating the incorrectness of the request. For more information, you need to visit the documents page on our website.

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like