How would an HTTP request or API request retrieve navigation data from Google Maps? Are there some simple lines of code for that? Let's say I want to give an input of origin and destination address, then the results of car, public transport, walking etc. are given with distance, required time and so on. Basically, setting the navigation UI Google Maps settings which results in a somewhat tabular form or any other format that can be used for analyzing.

Thank you in advance!

1 Answer 1


Yes, from R you can call Google Maps' Directions API.

API calls look like this:


You can specify to receive results in either JSON or XML.

You will need an API key.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.