Wednesday, January 7, 2015

The route to your favourite destination

Ever wondered how your favourite Cab Service or GPS software finds directions using Google from your phone or tablet. Yes, you guessed it correct - using Google Direction APIs. Google has made a lot of it's services like maps, search, gmail accessible to us through APIs and playing with it comes for free with your Google account. Want to try it yourself? Open the following link in your browser and see how Google Direction API responds with the direction to the coolest new year destination -  Goa, India from Mumbai, India

The link URL is called API Request and the what you get to see in the browser window is called the API response. The notation that you see is called JSON and is made of key-value pairs. For instance "end_address" is a key and it's value is "Goa, India". See how it shows you the distance (603 km), the duration (9hrs 30 minutes) and step by step directions. It also identifies the state of Mumbai i.e Maharashtra. This response is what all those Mobile Apps Use to show you the route details

Feel free to try you own choice of locations by just changing Mumbai to your start place and Goa to end place. Note this uses my Google API key (you can get one for free too) which works only 2500 times a day, so if it fails for you, be the first one to try tomorrow

1 comment:

  1. IT' is one of the vast and most employeed job of nowadays, this blog highlights the term of API which is totally linked to the software engineers and programmers. This is a plus point for them to enhance their knowledge