mattdodge / yahoofantasy

A Python SDK for the Yahoo! Fantasy Sports API
62 stars 18 forks source link

Any way to retrieve number of games played per week, a la StatTracker? #51

Open jonathanlaniado opened 1 year ago

jonathanlaniado commented 1 year ago

Not seeing it in the list of stat IDs on the weekly matchup endpoint for an NBA league. Does Yahoo! not provide this stat via API?

mattdodge commented 1 year ago

I'm not in a basketball league so it's a bit tough for me to try things out, but in general the stats that are available via the API are the ones that are visible on the player search page on the league. So if "games played" is not one of your league's stats, it may not be in the API response. The StatTracker applet seems to use it's own source of data separate from the fantasy API so the data you're looking for, unfortunately, may not be available

xaph commented 8 months ago

hi @jonathanlaniado

if you're looking for your or your matchup's game played in total you can check it with this: matchup.teams.team[0].team_remaining_games.total.completed_games

total object has these attributes:

'total': {
    'remaining_games': 0,
    'live_games': 0,
    'completed_games': 30
}
jonathanlaniado commented 8 months ago

@xaph Thanks, not sure how I missed this originally. However, it's inaccurate. It counts injuries, whereas StatTracker does not. Wish I could pull that calculation instead.