forked from goodop/api-imjustgood.com
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgoogle_place.py
28 lines (21 loc) · 982 Bytes
/
google_place.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from justgood import imjustgood
api = imjustgood("INSERT_YOUR_APIKEY_HERE")
data = api.place("hotel di jakarta", region="id", lang="id")
print(data)
# EXAMPLE GET CERTAIN ATTRIBUTES
result = "GOOGLE PLACE\n"
for i in range(len(data["result"])):
main = data["result"][i]
result += "\n{}. {}".format((i+1), main["name"])
result += "\nType : {}".format(main["type"])
result += "\nAddress : {}".format(main["address"])
result += "\nPhone : {}".format(main["phone"])
result += "\nLatitude : {}".format(main["latitude"])
result += "\nLongitude : {}".format(main["longitude"])
result += "\nReview : {}".format(main["review"])
result += "\nRating : {}".format(main["rating"])
result += "\nTimezone : {}".format(main["timezone"])
result += "\nWebsite : {}".format(main["website"])
result += "\nMaps URL : {}".format(main["maps"])
result += "\nImage URL : {}\n".format(main["image"])
print(result)