Search code examples
javascriptphpangularjsnode.jszipcode

How to verify the distance between 2 canadian zip code


I would like to know what is the best way to get the distance between 2 (zip code) or postal code in Canada. I have seen post about MySQL doing so with US zip code.

Or I guess that I could probably translate a zip code to coordinates and then triangulate distances? If anyone can share tips on this I would apreciate!

Im working with Angular JS and Node JS but I could do with PHP as well.

An Api should be free and be able to handle large ammount of querys.

Thank You


Solution

  • Google Maps API can do it, by setting origin and destination on the distancematrix API.

    https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=M4C4Y7&destinations=H1A0A2