Created
August 31, 2018 09:32
-
-
Save avicoder/fd7b11d7eea3a08e552ef0526330ba99 to your computer and use it in GitHub Desktop.
Check the google api key is valid or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import googlemaps | |
from datetime import datetime | |
gmaps = googlemaps.Client(key='Add Your Key here') | |
# Geocoding an address | |
geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA') | |
# Look up an address with reverse geocoding | |
reverse_geocode_result = gmaps.reverse_geocode((40.714224, -73.961452)) | |
# Request directions via public transit | |
now = datetime.now() | |
directions_result = gmaps.directions("Sydney Town Hall", | |
"Parramatta, NSW", | |
mode="transit", | |
departure_time=now) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment