Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get projected score of games of final completed week of season #517

Open
bdf0506 opened this issue Dec 26, 2023 · 9 comments
Open

Comments

@bdf0506
Copy link

bdf0506 commented Dec 26, 2023

Sport

Football

Summary

Unable to get the projected score of the final week - it shows the projected scores to equal the final scores.

Logs/Data

>>> from espn_api.football import League
>>> league = League(league_id=xxxxx, year=2023, espn_s2='xxxx', swid='xxxx')
>>> box_scores = league.box_scores(16)
>>> box_scores[0].away_score
134.64
>>> box_scores[0].away_projected
134.64
>>> 

But going back to week 15, all is well in the world:

>>> box_scores = league.box_scores(15)
>>> box_scores[0].away_projected
108.38999999999999
>>> box_scores[0].away_score
115.42

Trying another league, week 16 (where it is NOT the final week of the league), it pulls the week 16 projected scores without issue.

@dtcarls
Copy link
Contributor

dtcarls commented Dec 28, 2023

Having a similar issue with 2 week playoffs, I expect it is related.

@bdf0506
Copy link
Author

bdf0506 commented Dec 24, 2024

This is still an issue with the 2024 season

@cwendt94
Copy link
Owner

cwendt94 commented Jan 2, 2025

I think if its a two week playoffs to get the correct final projected you will need to use the final week to get the correct projected score.

@bdf0506
Copy link
Author

bdf0506 commented Jan 2, 2025

In the league that I tested with, it’s leveraging one week playoffs.

@cwendt94
Copy link
Owner

cwendt94 commented Jan 3, 2025

Hmm thats weird, I would think it would be exactly the same as any other week then. On ESPN's website it shows the correct projections?

@bdf0506
Copy link
Author

bdf0506 commented Jan 5, 2025

Yes, I validated that if I go to the ESPN website and look at the boxscore of the final game, it will properly show the projected points and the actual points. Calling it via the API will show the same value (actual points) for both projected and actual points.

@cwendt94
Copy link
Owner

cwendt94 commented Jan 5, 2025

Are you in a public league? If so I should be able to test and see why it's not pulling the correct projected points.

@bdf0506
Copy link
Author

bdf0506 commented Jan 7, 2025

I tried it on a public league which uses a two week playoff, and same issue exists.

>>> from espn_api.football import League
>>> league = League(league_id=2004529243, year=2024)
>>> box_scores = league.box_scores(18)
>>> box_scores[0].away_score
239.32
>>> box_scores[0].away_projected
239.32
>>> box_scores = league.box_scores(17)
>>> box_scores[0].away_score
239.32
>>> box_scores[0].away_projected
239.32

https://fantasy.espn.com/football/boxscore?leagueId=2004529243&matchupPeriodId=16&scoringPeriodId=18&seasonId=2024&teamId=2&view=scoringperiod

It could be something to do with the logic with a two week playoff, and the fact that it pulls the total score and not the weekly individual score. But on a one week playoff system, it should pull the projected of the individual game.

I feel like in the example above, when pulling the away_score for week 17, it probably should pull the score accumulated up to week 17, and not the combined week 17+18 score. It should only pull the combined score when you pull week 18.

Weeks 15 and 16 (playoff round 1) pull the projected score of the individual game correctly:

>>> box_scores = league.box_scores(16)
>>> box_scores[0].away_score
272.04
>>> box_scores[0].away_projected
123.46000000000001
>>> box_scores = league.box_scores(15)
>>> box_scores[0].away_score
272.04
>>> box_scores[0].away_projected
126.69999999999999

https://fantasy.espn.com/football/boxscore?leagueId=2004529243&matchupPeriodId=15&scoringPeriodId=15&seasonId=2024&teamId=6&view=scoringperiod

@cwendt94
Copy link
Owner

cwendt94 commented Jan 7, 2025

I did some more digging into my two week playoff league and it looks like ESPN when going to the scoreboard tab just shows the total score for the final matchup and also looking at the data they fill in the projected points field as total as well.

When you then click into Box Score for that matchup thats when you see the projected score breakdown and total. Looking at the API call the website uses and fills out the UI the projected points field is still the total points scored. I believe what they are doing t get the projected is adding up the projected of each player and then showing the total.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants