Mushi

Distance between points - python

Jun 6th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=+52030-100&destinations=+50875-090&mode=bicycling&language=pt-BR&key=AIzaSyBRADWHRl0s_0eIXx7YJL9nwDsjaYGF-iU"
  2.  
  3. import requests
  4. import json
  5. r = requests.get(url)
  6. a= json.loads(r.text)
  7. print(a['rows'][0]['elements'][0]['distance']['text'])
Add Comment
Please, Sign In to add comment