import pandas as pd
import numpy as np
import requests
import yelp
requests.get(https://api.yelp.com/v3/autocomplete?text=del&latitude=37.786882&longitude=-122.399972,headers={'Authorization: Bearer <API KEY that I have>'})
我的菜鸟自我告诉我这是一本字典
headers={'Authorization: Bearer <API KeY>'}
我知道这可能 100% 是错误的,所以我真的很想了解更多有关在 Python 中使用 REST API 的信息。我只是把这作为一个个人项目来做。我的总体目标是能够通过 API 访问 yelps 公共数据。例如,我想获取 X 业务的评论。
{'reviews': [{'id': 'pD3Yvc4QdUCBISy077smYw', 'url': 'https://www.yelp.com/biz/la-taqueria-san-francisco-2?hrid=pD3Yvc4QdUCBISy077smYw&adjust_creative=hEbqN49-q6Ct_cMosX68Zg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_reviews&utm_source=hEbqN49-q6Ct_cMosX68Zg', 'text': 'My second time here.. \nI love the Burito here it has the distinct taste of freshness.. we order super steak burito and boy it did not disappoint! everything...}