【问题标题】:Foursquare Users Details Endpoint Returning 404 ErrorFoursquare 用户详细信息端点返回 404 错误
【发布时间】:2020-01-06 16:11:59
【问题描述】:

我正在尝试使用 Foursquare 用户详细信息端点来检索有关不同用户的信息,但由于某种原因,我收到了 404 错误。我似乎无法找到此错误的原因,因此非常感谢任何帮助。这是我的用户“67786428”的代码,您可以在 Foursquare 上找到他们的页面:https://foursquare.com/user/67786428。

user_id = '67786428' 

url = 'https://api.foursquare.com/v2/users/{}?client_id={}&client_secret={}&v={}'.format(user_id, CLIENT_ID, CLIENT_SECRET, VERSION) # define URL

# send GET request
results = requests.get(url).json()
results

输出如下:

{'meta': {'code': 404,
  'errorType': 'endpoint_error',
  'errorDetail': 'Endpoint not found',
  'requestId': '5e13583c02a172001bbf17c7'},
 'response': {}}
  1. 我的 client_id 和 client_secret 正在工作,因为我正在使用场所端点获得结果。
  2. 我检查了我没有达到 API 调用的限制。
  3. 以前的代码可以工作,但我不确定 Foursquare 是否更改了他们的 API,现在必须以不同的方式构建 url,尽管根据文档,上述端点应该存在。

【问题讨论】:

    标签: python-3.x foursquare


    【解决方案1】:

    您需要进行身份验证。 https://developer.foursquare.com/docs/api/configuration/authentication

    试试下面的网址

    https://api.foursquare.com/v2/users/{}?&oauth_token=(YOUR_TOKEN)
    

    【讨论】:

    猜你喜欢
    • 2018-07-02
    • 2019-10-12
    • 1970-01-01
    • 2016-10-27
    • 2019-01-18
    • 2019-08-09
    • 1970-01-01
    • 1970-01-01
    • 2017-10-02
    相关资源
    最近更新 更多