Created
January 14, 2022 12:54
-
-
Save Aniket-508/626e874971c3ab7a76e52e34f654cf32 to your computer and use it in GitHub Desktop.
Python program to find the distance between two addresses using Google Map API
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 | |
# Requires API key | |
gmaps = googlemaps.Client(key='API_key') | |
# Requires cities name | |
my_dist = gmaps.distance_matrix('Address1','Address2')['rows'][0]['elements'][0] | |
# Printing the result | |
print(my_dist.distance.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment