这是我到目前为止的代码:
LIMIT = 50 # limit of number of venues returned by Foursquare API
radius = 500 # define radius
# create URL
url = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&ll={},{}&radius={}&limit={}'.format(
CLIENT_ID,
CLIENT_SECRET,
VERSION,
neighborhood_latitude,
neighborhood_longitude,
radius,
LIMIT)
url
results = requests.get(url).json()
results
错误:
NewConnectionError('
该版本包已弃用。我相信问题出在授权上。可能需要传入一个参数oauth_token=ACCESS_TOKEN
确保 CLIENT_ID、CLIENT_SECRET、VERSION(选择日期)正确初始化。
支持文档链接如下:https://docs.foursquare.com/developer/reference/versioning