从Yelp API解析JSON数据

时间:2015-05-09 06:17:47

标签: json parsing yelp

我是编程新手,正在尝试解析从Yelp的API返回的一些数据。根据这些数据,我怎样才能返回类似电话号码(display_phone)和地址的内容?谢谢

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'}

0 个答案:

没有答案