yelp-python icon indicating copy to clipboard operation
yelp-python copied to clipboard

'Client' object has no attribute 'business'

Open forest44 opened this issue 4 years ago • 3 comments

Hello,

I try the following python code copied from this site: from yelp.client import Client

MY_API_KEY = 'xxxx'

client = Client(MY_API_KEY) business_response = client.business.get_by_id('yelp-san-francisco')

Then, I have the error "'Client' object has no attribute 'business'". Any idea why the given code doesn't work? Thanks for your help.

forest44 avatar Apr 18 '20 19:04 forest44

I have the exact same issue.

theRealDavidDavis avatar Sep 16 '20 02:09 theRealDavidDavis

Finally, I use this solution: url = 'https://api.yelp.com/v3/businesses/search' API_KEY = xxxx headers = {'Authorization': f"Bearer {API_KEY}"} categories = ['french', 'chinese', 'japanese', 'italian', 'indian']

for i, category in enumerate(categories): params = {'location': location, 'limit': 50, 'categories': category} resp = requests.get(url, headers=headers, params=params)

forest44 avatar Sep 16 '20 07:09 forest44

Heh, may want to fork and start something anew, project looks dead to me.

np3xpu avatar Oct 20 '20 14:10 np3xpu