yahoo_fantasy_api
yahoo_fantasy_api copied to clipboard
Individual Player Fantasy Points per Week
Is it possible to retrieve the fantasy points earned by each athlete in each week? I understand this value would be unique to each league depending on scoring settings.
Yes you can use the player_stats function of a league object to retrieve that value:
oauth2_logger.cleanup()
sc = OAuth2(None, None, from_file=<json>)
gm = yfa.Game(sc, <game_code>)
ids = gm.league_ids(year=<year>)
for lg_id in ids:
if lg_id.find("auto") > 0:
continue
lg = yfa.League(sc, lg_id)
lg.player_stats(
player_ids=[<player_id>,<player_id>],
req_type="week",
week=<week>,
)