for a logistics job, which consists of determining an optimal route for a tourist, I need to calculate the distance or travel time by car from each of the 50 points with the other points.

Our teacher told us that you can use the google maps API to get that, how do you do it?