0

I'm new to programming and am trying to parse some data returned from Yelp's API. From this data, how could I return something like just the phone number (display_phone) and address? Thank you

Result for business "little-miss-bbq-phoenix-2" found:
{ u'categories': [[u'Barbeque', u'bbq']],
  u'display_phone': u'+1-602-437-1177',
  u'id': u'little-miss-bbq-phoenix-2',
  u'image_url': u'http://s3-media2.fl.yelpcdn.com/bphoto/4Rcm0IIbRhdo-4Z4KPvuXQ/ms.jpg',
  u'is_claimed': True,
  u'is_closed': False,
  u'location': { u'address': [u'4301 E University Dr'],
                 u'city': u'Phoenix',
                 u'coordinate': { u'latitude': 33.421587,
                                  u'longitude': -111.989088},
                 u'country_code': u'US',
                 u'display_address': [ u'4301 E University Dr',
                                       u'Phoenix, AZ 85034'],
                 u'geo_accuracy': 9.5,
                 u'postal_code': u'85034',
                 u'state_code': u'AZ'},
  u'mobile_url': u'http://m.yelp.com/biz/little-miss-bbq-phoenix-2',
  u'name': u'Little Miss BBQ',
  u'phone': u'6024371177',
  u'rating': 5.0,
  u'rating_img_url': u'http://s3-media1.fl.yelpcdn.com/assets/2/www/img/f1def11e4e79/ico/stars/v1/stars_5.png',
  u'rating_img_url_large': u'http://s3-media3.fl.yelpcdn.com/assets/2/www/img/22affc4e6c38/ico/stars/v1/stars_large_5.png',
  u'rating_img_url_small': u'http://s3-media1.fl.yelpcdn.com/assets/2/www/img/c7623205d5cd/ico/stars/v1/stars_small_5.png',
  u'review_count': 403,
  u'reviews': [ { u'excerpt': u"I saw that this place had almost 400 reviews and that they have a perfect 5 star rating. It sounded too good to be true BUT it's worth every star and...",
                  u'id': u'-9poa0ycpVnOveVlqbYE9Q',
                  u'rating': 5,
                  u'rating_image_large_url': u'http://s3-media3.fl.yelpcdn.com/assets/2/www/img/22affc4e6c38/ico/stars/v1/stars_large_5.png',
                  u'rating_image_small_url': u'http://s3-media1.fl.yelpcdn.com/assets/2/www/img/c7623205d5cd/ico/stars/v1/stars_small_5.png',
                  u'rating_image_url': u'http://s3-media1.fl.yelpcdn.com/assets/2/www/img/f1def11e4e79/ico/stars/v1/stars_5.png',
                  u'time_created': 1431095420,
                  u'user': { u'id': u'd43iQ50HjWIl4vN4rBgoVQ',
                             u'image_url': u'http://s3-media4.fl.yelpcdn.com/photo/sn17KBbRjXOEELnjSir1tg/ms.jpg',
                             u'name': u'Jason J.'}}],
  u'snippet_image_url': u'http://s3-media4.fl.yelpcdn.com/photo/sn17KBbRjXOEELnjSir1tg/ms.jpg',
  u'snippet_text': u"I saw that this place had almost 400 reviews and that they have a perfect 5 star rating. It sounded too good to be true BUT it's worth every star and...",
  u'url': u'http://www.yelp.com/biz/little-miss-bbq-phoenix-2'}
ryan
  • 625
  • 3
  • 10
  • 23
  • Which language do you want to use to parse this json and extract the phone number & address? There are libraries available for a lot of languages to do so. – TJ- May 09 '15 at 06:20
  • Python preferably, I'm very new to this type of thing. – ryan May 09 '15 at 06:20
  • This is the first search result from SO: http://stackoverflow.com/questions/2835559/parsing-values-from-a-json-file-in-python – TJ- May 09 '15 at 06:21

0 Answers0