yahoo_fantasy_api icon indicating copy to clipboard operation
yahoo_fantasy_api copied to clipboard

Individual Player Fantasy Points per Week

Open stellarore opened this issue 2 years ago • 1 comments

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.

stellarore avatar Nov 03 '23 01:11 stellarore

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>,
        )

DMcP89 avatar Dec 24 '24 17:12 DMcP89