cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
544 stars 183 forks source link

Lineups are only populating for first and current week matchups #524

Open wsecheng opened 5 months ago

wsecheng commented 5 months ago

Sport

Basketball

Summary

I'm trying to pull the players + stats that participated in every matchup throughout the year, but I'm seeing that home_lineup and away_lineup attributes only return a non-empty list for teams in the first and current week matchups.

Logs/Data

for week in range(league.currentMatchupPeriod):
    for matchup in league.box_scores(matchup_period = week+1):
        print(week)
        print(matchup)

        # returns empty list when week is not 1 nor league.currentMatchupPeriod
        for player in matchup.home_lineup:
            print(player)

        for player in matchup.away_lineup:
            print(player)
cwendt94 commented 4 months ago

what type of scoring league is this? I am able to see all the lineups for my H2H points league.

wsecheng commented 4 months ago

It's a H2H cats league

cwendt94 commented 4 months ago

Okay, I tried by cats league and seeing the same issue. I will take a look.

cwendt94 commented 4 months ago

So the issue is mapping the matchup_period to a scoring_period. For CAT leagues it seems like the way we find scoring period does not work the same for H2H points. Right now I can't seem to find out how to see all the scoring periods in a matchup. To get around this issue for now if you also define a scoring_period to each of your matchup calls it should get the lineups correctly.

wsecheng commented 4 months ago

What scoring_period meant to represent and what should it be set to?

EDIT: I can see from browsing my league URL, that scoring_period typically equals matchup_period * 7 -1.

cwendt94 commented 4 months ago

Yeah the scoring_period is the actual day of games being played. So the opening day of games for the season scoring_period=1 second day of games scoring_period=2. And it keeps increasing for every day there are games.

H2H scoring had a way to get all of the scoring periods in a matchup but right now I can't find that data when the league is CAT