python - 无法使用 Yahoo Fantasy Sports API 查找统计数据

标签 python oauth-2.0 yahoo-api yahoo-oauth

https://developer.yahoo.com/fantasysports/guide/game-resource.html

所以在 API 指南上,在 stat_categories 下,有一组 id,

https://fantasysports.yahooapis.com/fantasy/v2/game/nba/stat_categories

但是当我查看我发出的所有 API 请求中的 json 数据时,没有

{'stats': [{'stat': {'stat_id': 0,
'name': 'Games Played',
'display_name': 'GP',
'sort_order': '1',
'position_types': [{'position_type': 'P'}]}}

在上面。

这是我的 json 数据的结果。正如您在下面看到的,没有 stat_id = 0 或 1 或 2。但它以 3 开头。

'stats': [{'stat': {'stat_id': '3', 'value': '3473'}},
{'stat': {'stat_id': '4', 'value': '1625'}},
{'stat': {'stat_id': '6', 'value': '920'}},
{'stat': {'stat_id': '7', 'value': '713'}},
{'stat': {'stat_id': '9', 'value': '1069'}},
{'stat': {'stat_id': '10', 'value': '384'}},
{'stat': {'stat_id': '12', 'value': '4347'}},
{'stat': {'stat_id': '13', 'value': '408'}},
{'stat': {'stat_id': '15', 'value': '1792'}},
{'stat': {'stat_id': '16', 'value': '1016'}},
{'stat': {'stat_id': '17', 'value': '271'}},
{'stat': {'stat_id': '18', 'value': '132'}},
{'stat': {'stat_id': '19', 'value': '586'}},
{'stat': {'stat_id': '27', 'value': '63'}},
{'stat': {'stat_id': '28', 'value': '3'}}]

有人可以帮我解决这个问题吗?

我需要每天玩的游戏数量来进行分析。

最佳答案

如果您查询“联赛设置”,雅虎会让您知道您的联赛跟踪哪些统计数据以获得积分。雅虎只会提供您正在跟踪的积分统计数据的 STAT 详细信息。

很可能,统计 0 -> 玩过的游戏不是跟踪/得分统计。因此,当您查询玩家时,它不会为您提供此信息。

获得此统计数据的唯一方法是让您的联盟提供此统计数据。

关于python - 无法使用 Yahoo Fantasy Sports API 查找统计数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53754207/

相关文章:

python - 如何在 np.linalg.inv 函数的奇异矩阵上传递引发的错误?

python - 通过 serial1 将 Arduno Yun pin 信息发送到 linino python 脚本,通过 UDP 发送到 Max

javascript - 使用 hello js 获取雅虎好友列表

r - 集成 Yahoo Sports API 数据

android - Google 用户信息仅通过来自 android google plus 的访问 token 提供 id

yql - 雅虎 YQL : find city WOEID by coordinates

python - 如何拆分整个pandas DataFrame以列出并选择第n个元素

python - 为什么要为其他语言(例如 C)的现有代码开发 Python 绑定(bind)?

azure - 机器人生成器 : How to create a bot using OAuth 2 implicit grant flow method in sharepoint

Salesforce 身份验证失败