Skip to content

Instantly share code, notes, and snippets.

@CptKirklnd
Created April 14, 2015 22:06
Show Gist options
  • Save CptKirklnd/8dab9680497b82c825fe to your computer and use it in GitHub Desktop.
Save CptKirklnd/8dab9680497b82c825fe to your computer and use it in GitHub Desktop.
Google Maps Geocode API Test
#testing an address search in the Google Maps Geocode API before using it in our BitCamp 2015 project
#http://maps.googleapis.com/maps/api/geocode/output?parameters
#using keyword paramters (street name, parsed in the superior script), rankby (distance)
import requests
import json
outputFormat = "json"
queryRoot = "https://maps.googleapis.com/maps/api/geocode/"
streetName = "54TH+STREET"
APIKey = "#####"
#add your own google API key here
perameters = ""
dc = "Washington,+DC"
query = queryRoot + outputFormat + "?address="+streetName+",+"+dc+"&key="+APIKey
r = requests.get(query)
print r.json()
print query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment