Search code examples
pythonapiyelp

Accessing yelp API points in Python


I have a yelp response as linked here. I am trying to print out just a list of the names returned. I have tried the following:

print response['name']
print response[0]
print response[0]['name']

And all seem to give error. How do I access a list of just place names? Or just one place name?


Solution

  • for b in response['businesses']:
        print b.get('name', 'missing')