Is it possible to use the tomtom api to calculate the distance between two addresses


ive tried to calculate the distance in km between two addresses in excel for a school project. First i thought about using the google api cause i had found alot of forums telling to use it for this. But these posts where from 2011-2014. Now google want money and the vba codes out there cant be used anymore without an google api.

So i wonder can i use the tomtom api in exel to do the same thing ppl did back then with the google api or do i need to learn java or so?

Hello Marvin,

First of all - welcome to our community! :wink:

Trying to answer your questions. The one about excel is easy one - yes, you can call our APIs from inside of Excel. You would need to tweak a little code in VBA but that’s easily doable and you’ll probably find a lot of examples how to do it. I have just checked: MSXML2 library works quite fine for that purpose.

About the distance: do you want to check straight line distance between selected addresses or rather distance calculated by a route (walking / cycling / driving)?

Hey Radek,

thx for your fast answer. I will get myself then into VBA and figure it out then.

About the distance: I want to check the distance between two adresses, calculated as driving.

It is a cool case to use TomTom’s Routing API - here you’ll find a documentation for this functionality. Just a little excerpt from the doc:

The Calculate Route service calculates a route between an origin and a destination, passing through waypoints if they are specified.

  • The route will take into account factors such as current traffic and the typical road speeds on the requested day of the week and time of day.
  • Information returned includes the distance, estimated travel time, and a representation of the route geometry.
  • Additional routing information such as optimized waypoint order or turn by turn instructions is also available, depending on the options selected.

You can test the feature and tweak some options using fancy API Explorer that’s also available in the Dev Portal.

Sry for the late response,

ty i will start to work on the weekend. Thx for the tipps :slight_smile: when i have some problems can i ask in this forum for help or can i maybe contact u directly?

Feel free to post any technical question in the forum. Or just catch me directly - anyway that works better for you.

Glad I could help! :slight_smile:

1 Like

can i chat u up personally…have got a few questions to ask…

Unfortunately, we don’t have a chat functionality to talk with the customer representative in person. You can send your questions via the contact-us.