Overview
These endpoints fetch detailed player statistics for your fantasy team from the Yahoo Fantasy API. Two variants are available: weekly stats for a specific week, and season-long cumulative stats.Authentication
Both endpoints require an active user session with a selected league and team.Weekly Player Stats
Retrieve player statistics for a specific week of the fantasy season.Path Parameters
The week number for which to retrieve player statistics
Response
The root object containing player statistics from Yahoo Fantasy API
Example Request
Season Player Stats
Retrieve cumulative season statistics for all players on your team.Request
This endpoint does not accept any parameters. It automatically uses the league and team from the user’s session.Response
The root object containing player statistics from Yahoo Fantasy API
Example Request
Error Responses
Both endpoints share common error responses:Error message describing what went wrong
Possible Errors
-
400 Bad Request - No league selected in session
-
404 Not Found - Could not determine user’s team
-
500 Internal Server Error - Failed to fetch data from Yahoo API
Implementation Details
These endpoints are implemented inmain.py:752-774 and perform the following:
- Validate that a league is selected in the user’s session
- Call
get_user_team_key()to determine the user’s team key from league data - Call the Yahoo Fantasy API with the appropriate parameters:
- Weekly:
fantasy/v2/team/{team_key}/players/stats;type=week;week={week} - Season:
fantasy/v2/team/{team_key}/players/stats;type=season
- Weekly:
- Return the complete Yahoo API response as JSON
- Log errors and return appropriate HTTP status codes on failure
Use Cases
- Display current roster with player performance
- Compare player statistics across weeks
- Analyze player trends and consistency
- Make lineup decisions based on recent performance
- Build player comparison and ranking tools
Related Endpoints
- Season Averages - Team-level season statistics
- Scoreboard - Weekly matchup results