Skip to content

Commit a910ab4

Browse files
authored
Create yelp-connect.py
1 parent 78e8eba commit a910ab4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

yelp-connect.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Import the requests module which allows us to make the API call
2+
import requests
3+
#use authentication code as app_secret
4+
app_secret = 'DbcVh6n74NPHG_3-QvbS_HEHzcacvIfZTPlsV4UdL8QA6gULwLU34PFLtA6FSr90ubQ30hB8FZdzdBNAvug22H5P703sX-kGNyD_atIoFvi1N64Jyhzmux2ThFW1W3Yx'
5+
6+
#To Authorize use a header with authentication code as bearer.
7+
headers = {'Authorization': 'bearer %s' % app_secret}
8+
9+
# Call Yelp API to pull info from local bakery
10+
biz_id = 'kizbees-kitchen-egg-harbor-city'
11+
url = 'https://api.yelp.com/v3/businesses/%s' % biz_id
12+
response = requests.get(url=url, headers=headers)
13+
response_data = response.json()
14+
15+
print(response_data)

0 commit comments

Comments
 (0)