Python Foursquare API请求返回版本参数错误
我试图向Foursquare开发者API发送一个get请求,通过“探索”功能获取附近所有场馆的json响应。我收到的错误是Python Foursquare API请求返回版本参数错误,python,pandas,jupyter-notebook,foursquare,Python,Pandas,Jupyter Notebook,Foursquare,我试图向Foursquare开发者API发送一个get请求,通过“探索”功能获取附近所有场馆的json响应。我收到的错误是 {'meta': {'code': 410, 'errorType': 'param_error', 'errorDetail': '**The Foursquare API no longer supports requests that pass in a version v <= 20120609.** For more details see http
{'meta': {'code': 410,
'errorType': 'param_error',
'errorDetail': '**The Foursquare API no longer supports requests that pass in a version v <= 20120609.** For more details see https://developer.foursquare.com/overview/versioning',
'requestId': '5d9f5d5fcad1b6002c61ef2c'},
'response': {}}
结果输出就是我得到错误的地方
我尝试了版本变量的多个不同日期,如“20191008”、“20181008”等,但都给出了相同的错误 更换
url = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&ll={},{}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, latitude, longitude, VERSION, RADIUS, LIMIT)
与
您需要使用当前日期作为格式为YYYYMMDD的版本。在这种情况下,您需要将“YYYYMMDD”替换为当前日期。例如,今天的日期是2021年3月24日,因此需要将“YYYYMMDD”替换为“20210324”。您还需要使用Foursquare并重置客户端密码。看起来“VERSION”变量需要是实际日期,而不是基于示例的“YYYYMMDD”。您需要使版本与当前日期匹配。例如,如果今天的日期是2021年3月24日,则版本将是20210324。您还需要在Foursquare上重置客户端密码。
url = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&ll={},{}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, latitude, longitude, VERSION, RADIUS, LIMIT)
url = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&ll={},{}&radius={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, VERSION, latitude, longitude, RADIUS, LIMIT)