You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using python2.7 and python3 and yelpapi 2.20.1 I think. Now, this is my first time using Yelp and I am kind of clueless so please bear with me. I've tried two different methods and I get two different errors
METHOD 1:
from yelpapi import YelpAPI
from pprint import pprint
import argparse
key = 'my_key'
yelp_api = YelpAPI(key)
#search_results = yelp_api.search_query(term='ice cream', location='austin, tx', sort_by='rating', limit=5)
#response = yelp_api.search_query(categories='bikerentals', longitude=-122.4392, latitude=37.7474, limit=5)
response = yelp_api.phone_search_query(phone='+13193375512')
This will give me the following error:
{'error': {'code': 'TOKEN_MISSING', 'description': 'An access token must be supplied in order to use this endpoint.'}}
METHOD 2:
from yelpapi import YelpAPI
from pprint import pprint
import argparse
key = 'my_key'
argparser = argparse.ArgumentParser(description='Example Yelp queries using yelpapi. '
'Visit https://www.yelp.com/developers/v3/manage_app to get the '
'necessary API keys.')
argparser.add_argument(key, type=str, help='Yelp Fusion API Key')
args = argparser.parse_args()
yelp_api = YelpAPI(args.api_key)
This will give me the following error where app.py is my python code and my_key the actual key:
usage: app.py [-h]
my_key
app.py: error: too few arguments
I've even try to query from Postman and still can get a result! this is what I get from Postman:
{
"error": {
"code": "TOKEN_MISSING",
"description": "An access token must be supplied in order to use this endpoint."
}
}
Thanks in advance
The text was updated successfully, but these errors were encountered:
I am using python2.7 and python3 and yelpapi 2.20.1 I think. Now, this is my first time using Yelp and I am kind of clueless so please bear with me. I've tried two different methods and I get two different errors
METHOD 1:
from yelpapi import YelpAPI
from pprint import pprint
import argparse
key = 'my_key'
yelp_api = YelpAPI(key)
#search_results = yelp_api.search_query(term='ice cream', location='austin, tx', sort_by='rating', limit=5)
#response = yelp_api.search_query(categories='bikerentals', longitude=-122.4392, latitude=37.7474, limit=5)
response = yelp_api.phone_search_query(phone='+13193375512')
This will give me the following error:
{'error': {'code': 'TOKEN_MISSING', 'description': 'An access token must be supplied in order to use this endpoint.'}}
METHOD 2:
from yelpapi import YelpAPI
from pprint import pprint
import argparse
key = 'my_key'
argparser = argparse.ArgumentParser(description='Example Yelp queries using yelpapi. '
'Visit https://www.yelp.com/developers/v3/manage_app to get the '
'necessary API keys.')
argparser.add_argument(key, type=str, help='Yelp Fusion API Key')
args = argparser.parse_args()
yelp_api = YelpAPI(args.api_key)
This will give me the following error where app.py is my python code and my_key the actual key:
usage: app.py [-h]
my_key
app.py: error: too few arguments
I've even try to query from Postman and still can get a result! this is what I get from Postman:
{
"error": {
"code": "TOKEN_MISSING",
"description": "An access token must be supplied in order to use this endpoint."
}
}
Thanks in advance
The text was updated successfully, but these errors were encountered: