Why fusion returns max 50 businesses?
See original GitHub issueI created a Python script
app_id = 'MYAPPID'
app_secret = 'MYAPPSECRET'
data = {'grant_type': 'client_credentials',
'client_id': app_id,
'client_secret': app_secret}
token = requests.post('https://api.yelp.com/oauth2/token', data=data)
access_token = token.json()['access_token']
url = 'https://api.yelp.com/v3/businesses/search'
headers = {'Authorization': 'bearer %s' % access_token}
# Yelp v3 API: https://nz.yelp.com/developers/documentation/v3
params = {'cc': args.country,
'location': args.location,
'categories': args.category,
'limit': args.limit}
response = requests.get(url=url, params=params, headers=headers)
results = response.json()['businesses']
for business in results:
print(business['name'])
print '\nTotal Cinemas retrieved: ' , len(results)
that works fine withinput: --country FR --location Paris --category movietheaters --limit 50
and indeed I can return 50 cinemas in Paris.
But if I set 51 as limit Python says:
Traceback (most recent call last):
File "./VISTA.py", line 52, in <module>
results = response.json()['businesses']
KeyError: 'businesses'
This is a mystery to me as Postman can return 149 businnesses with the query https://api.yelp.com/v3/businesses/search?cc=FR&location=Paris&categories=movietheaters
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
US Hails Fusion Breakthrough as Energy Dream Takes Shape
After more than 50 years of false starts, nuclear fusion is finally taking a resolute step closer to becoming the world's newest energy ......
Read more >Service Limits - Oracle Help Center
Review the following service limits for Oracle Integration Generation 2 resources. A service limit is the quota or allowance set on a resource....
Read more >Nuclear fusion power inches closer to reality
Venture capitalists are pumping billions into companies, racing to get a fusion power plant up and running by the early 2030s.
Read more >Feds commit $50 million to for-profit nuclear fusion companies
The Department of Energy officially announced that $50 million will go toward private nuclear fusion companies in public-private partnerships.
Read more >Ignition! Fusion Energy Comes Closer to Being a Reality, With ...
The ASIC chip, believe it or not, boasts an unbelievable 50 billion ... At the moment, there aren't any publicly traded fusion companies....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Postman isn’t returning all 149 without an offset. The total you see is the total number of businesses represented in your specific query, that doesn’t mean it’s returning 149 of them.
For using offset, give it any number. If you have limit=50, that means you’re getting results 1-50, so give it offset=51 and you’ll get 51-100.
Thank you, please specify this on the documentation.
Basically is the same as
next_page_token
for google-API