whatadewitt / yahoo-fantasy-sports-api

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

players stats returns empty stats for specific date #121

Closed tanierell closed 1 month ago

tanierell commented 1 month ago

I have been trying to fetch some players' stats at a given date from last season, and it returns '-' for all the stats, excluding small amount of players which receive the true stats. is there a problem with yahoo's api?

whatadewitt commented 1 month ago

can you share the sport, player, and date in question?

you could also try entering the information here https://yahoo-fantasy-node-docs.vercel.app/resource/player/stats which is basically a raw implementation of the library so it might point to whether there's something wrong in your code or this library.

tanierell commented 1 month ago

I have verified it their too, for example looking for NBA, players id 5317, on the 2023-10-25.

whatadewitt commented 1 month ago

What is the game key you are using? I see the data for 428.p.5317

My guess is you're using nba.p.5317?

tanierell commented 1 month ago

Indeed that was the problem, thank you

whatadewitt commented 1 month ago

It's frustrating. When you're using the "current" season, you can default to the league key (nba, mlb, nhl), but if you're using a past season you need to use the game key for THAT season to get stats from that year.

Glad it's sorted :)