import json, requests
url = 'http://maps.googleapis.com/maps/api/directions/json'
params = dict(origin='Chicago,IL', destination='Los+Angeles,CA', waypoints=
    'Joplin,MO|Oklahoma+City,OK', sensor='false')
resp = requests.get(url=url, params=params)
data = json.loads(resp.text)
HTTP requests and JSON parsing in Python