【发布时间】:2016-10-27 02:42:04
【问题描述】:
我正在尝试使用 Yahoo! 返回的 JSON 获取所有可用的球员。 Fantasy API,使用此资源:
http://fantasysports.yahooapis.com/fantasy/v2/game/nfl/players;status=A;position=RB
使用此 API 似乎总是最多返回 25 个玩家。我也尝试过使用;count=n 过滤器,但如果 n 高于 25,我仍然只能返回 25 名玩家。有人知道为什么是这样吗?以及如何获得更多?
这是我的代码:
from yahoo_oauth import OAuth1
oauth = OAuth1(None, None, from_file='oauth.json', base_url='http://fantasysports.yahooapis.com/fantasy/v2/')
uri = 'league/nfl.l.91364/players;position=RB;status=A;count=100'
if not oauth.token_is_valid():
oauth.refresh_access_token
response = oauth.session.get(uri, params={'format': 'json'})
【问题讨论】:
-
我其实也想知道同样的事情,你有想过吗?
标签: python json oauth yahoo-api