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

league/players endpoint optional week parameter does not work as expected #122

Open
stoopkidddd opened this issue Oct 26, 2024 · 4 comments

Comments

@stoopkidddd
Copy link

stoopkidddd commented Oct 26, 2024

Only tested this for NFL, so it might be unique to an NFL league since they do the week thing a bit different. When you call the league.players endpoint with a league_key and player_key and additionally a week value such as 1, it ignores the week and just returns the total season points/stats instead.

You can reproduce this in the docs tester. I attached a sample response and screenshot from the tester, but you'd need to use a league that you are in since this is a private league.

Screenshot 2024-10-26 at 12 48 20 PM

response.json

This does however work on the player.stats endpoint, so it seems to be something about the league specificity. I see that week: "1" gets sent in the request payload, so I wonder if this is unfortunately just a Yahoo limitation not supporting weekly stats per league 🤔

@whatadewitt
Copy link
Owner

This may be a design of Yahoo! to keep some of their stuff proprietary... but I can dig in more a bit later this week to see why the coverage type is being ignored and where the difference(s) may be. Thanks for pointing it out!

@whatadewitt
Copy link
Owner

I could swear I had something like this working at some time, but I see a number of the issues that seem to indicate exactly what you're saying, it only works on the player endpoint... and my guess is that you're looking for additional stats that are league dependant because I don't believe they will give you every single stat, just a selection of stats that is missing what you're looking for? I can try to prod my contacts at Yahoo! but it's been a while...

@stoopkidddd
Copy link
Author

stoopkidddd commented Oct 30, 2024

It's mainly because I wanted to get a per week breakdown of players' points within the context of a league and didn't want to do the calculation myself. The alternative, which has some benefits over using the league.players endpoint, is that I can cache the player.stats response for each player in a KV, and then use the league settings to calculate points from the player stats on a per week basis. This means I only need to get the player stats once, instead of once per league.

All in all, not the end of the world, but it would certainly be nice to be able to get a player's calculated points for a given week within the context of a league.

@whatadewitt
Copy link
Owner

100%

I've reached out to someone I know at Yahoo!

In baseball this is especially frustrating because it won't bring back all of the stats, and if you play in a league that uses, as an example, OPS, there's not really a way to get that.

Hopefully I can get some good news from them.

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

2 participants