whatadewitt / yahoo-fantasy-sports-api

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

Unable to filter player stats for lastweek/lastmnoth in basketball league #111

Open als15 opened 6 months ago

als15 commented 6 months ago

I'm trying to fetch player resource for basketball league, using the 'lastweek' filter in order to get only last week's stats. My call is as follows Yahoo.players.fetch('428.p.6515', ['lastweek']) (please assume it's obviously an existing player).

The error I get in return is :

Failed to generate report {
  'xml:lang': 'en-us',
  'yahoo:uri': '/fantasy/v2/players;player_keys=428.p.6515;out=lastweek?format=json',
  description: 'Invalid player resource lastweek requested.',
  detail: ''
}
whatadewitt commented 6 months ago

Hi @als15 -- I was able to get the stats (go Raptors!) using my documentation page -- https://yahoo-fantasy-node-docs.vercel.app/resource/player/stats

428.p.6515 lastweek

as the entries on the "tester" and it worked... can you share the code? My guess is that it's that you're passing "lastweek" in an array, and I think you can just use a string...