whatadewitt / yahoo-fantasy-sports-api

NodeJS wrapper for the Yahoo! Fantasy Sports API
https://yahoo-fantasy-node-docs.vercel.app/
MIT License
200 stars 54 forks source link

Can't access player data from Plus leagues #84

Closed foldedpaper closed 3 years ago

foldedpaper commented 3 years ago

I suspect this may be an issue on Yahoo's end, but considering how difficult it is to track down support for the API on their end, I'm raising an issue here with fingers crossed that maybe it's just an issue with how we are accessing the data.

The issue is that attempting to access player data from old Yahoo Plus leagues fails to find player data. It seems to be unique to Plus leagues because if I attempt to access the same player's data from a non-plus league in the same year, it fetches the data with no problem.

Example:

1) attempt to fetch player.meta for 195.p.7754. This successfully returns player meta information for Mike Napoli (7754) from the 2008 season, using a non-Plus game_id (195)

2) attempt to fetch player.meta for 196.p.7754. This uses the Plus game_id for the same year (196), but gives a response with the description "Player key 196.p.7754 does not exist."

whatadewitt commented 3 years ago

Wow, I've never heard of plus leagues! What are they?

That's really strange, and unfortunately it does look like it's an issue with Yahoo!

Can you get any other resources using 196? I see game.meta works, but I'm curious if there's anything else.

foldedpaper commented 3 years ago

Ha, I had to refresh my own memory of what a Plus league was--but for a few years, Yahoo! offered a paid league option (the Plus leagues) that offered features that weren't in regular, free fantasy leagues. It cost $125/year, and added things like having divisions in a league, being able edit rosters pre-draft in order to have keepers, and having a live stat-tracker during MLB games.

Eventually they just folded all the paid features into the free service and stopped offering Plus leagues--though, I see that now Yahoo is offering a different "Plus" service for managers which is nice and confusing.

Anyway--in an old league with a couple of "Plus" seasons, I can access most resources just fine, including league.meta, league.settings, league.standings, etc. But it seems like almost anything involving players fails. Here's the entirety of the result for league.transactions:

{
  "xml:lang": "en-us",
  "yahoo:uri": "/fantasy/v2/league/196.l.3152/transactions?format=json",
  "description": "Player key 196.p.7705 does not exist.",
  "detail": ""
}

On the other hand, league.draft_results successfully returns a list of draft picks with team_key and player_key for each pick--no error about a player key not existing. I guess because the draft_results are just accessing the player key and not attempting to look up any player information by that key?

whatadewitt commented 3 years ago

What happens if you try using the players.league collection and enter the league ID?

https://yahoo-fantasy-node-docs.vercel.app/collection/players/league

foldedpaper commented 3 years ago

Hmm, it just has an empty array for players:

[
   {
    ...(league meta)...

    "current_week": "25",
    "start_week": "1",
    "start_date": "2008-03-24",
    "end_week": "25",
    "end_date": "2008-09-28",
    "is_finished": 1,
    "game_code": "pmlb",
    "season": "2008",
    "players": []
  }
]
whatadewitt commented 3 years ago

It looks as though they've stopped supporting it... unfortunately I don't think there's much I can do to help you!

foldedpaper commented 3 years ago

Bummer! Thanks for helping look into it. I'll see if I can navigate the Yahoo help contact forms to flag them and see if they will look into the issue.