Created
July 15, 2020 01:12
-
-
Save Seanny123/0e49f61d60c3969d87409c0fd7b0402d to your computer and use it in GitHub Desktop.
Example of using Yelp rest 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 json | |
import requests | |
yelp_auth = "nope" | |
def get_events( city ): | |
headers = { "Authorization": f"Bearer {yelp_auth}" } | |
params = {"location": city, "limit": 5, "term": "seafood"} | |
req = requests.get( | |
'https://api.yelp.com/v3/businesses/search', | |
headers=headers, | |
params=params, | |
) | |
return json.loads(req.text) | |
print(get_events("New York")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment