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

Request: Accurate Player Projections #37

Open
dtcarls opened this issue Sep 13, 2024 · 2 comments
Open

Request: Accurate Player Projections #37

dtcarls opened this issue Sep 13, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@dtcarls
Copy link

dtcarls commented Sep 13, 2024

Hello, would it be possible to add calculations to this library to get accurate player projections (not just standard, ppr, or half ppr via unofficial api) utilizing league scoring_settings and active rosters?

I know this isn't exactly a request that fits being a wrapper for the API, but it seems to be functionality that is missing from the sleeper coding community. I'm also open if anyone knows of this functionality existing elsewhere, I have been unable to find it.

@joeyagreco
Copy link
Owner

So this isn't something that I'd add to this library (like you pointed out, just an SDK)...

However, if I recall correctly this info can be extracted from GraphQL calls that the browser makes and could likely be retrieved with a few lines of Python.

I'm unable to check at the moment, if you'd like to see for yourself go in a browser (on a computer, not mobile) to any Sleeper page that shows projections for a league you're in and look at the HTTP calls being made on page load in the developer tools tab.

There should be some call being made to return player projections based on your league settings and rosters.

@joeyagreco joeyagreco added the wontfix This will not be worked on label Sep 13, 2024
@joeyagreco
Copy link
Owner

Looks like theres a call to https://sleeper.com/graphql

With request: operationName "get_league_detail"

With query: 'query get_league_detail {\n \n league_rosters(league_id: "someleagueid"){\n league_id\n metadata\n owner_id\n co_owners\n players\n roster_id\n settings\n starters\n keepers\n reserve\n taxi\n player_map\n }\n \n \n league_users(league_id: "someleagueid"){\n avatar\n user_id\n league_id\n metadata\n settings\n display_name\n is_owner\n is_bot\n }\n…dated\n transaction_id\n type\n player_map\n waiver_budget\n }\n \n \n matchup_legs_2:matchup_legs(league_id: "someleagueid",round: 2){\n league_id\n leg\n matchup_id\n roster_id\n round\n starters\n players\n player_map\n points\n proj_points\n max_points\n custom_points\n starters_games\n picks\n bans\n subs\n }\n \n \n }'

that returns projected points in matchups for the week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants