Skip to main content

Overview

The season averages endpoint fetches cumulative season statistics for all teams in your Yahoo Fantasy Basketball league. This includes category totals and averages across all weeks of the season.

Authentication

Requires an active user session with a selected league.

Request

This endpoint does not accept any query parameters. It automatically uses the league selected in the user’s session.

Response

fantasy_content
object
The root object containing all season statistics data from Yahoo Fantasy API

Error Responses

error
string
Error message describing what went wrong

Possible Errors

  • 400 Bad Request - No league selected in session
    {"error": "no league chosen"}
    

Example Request

curl -X GET "https://your-domain.com/api/season_avg" \
  -H "Cookie: session=your-session-cookie"

Implementation Details

This endpoint is implemented in main.py:482-484 and performs the following:
  1. Validates that a league is selected in the user’s session
  2. Calls the Yahoo Fantasy API: fantasy/v2/league/{league_key}/teams;out=stats;type=season
  3. Returns the complete Yahoo API response containing season statistics for all teams

Use Cases

  • Display league standings based on category performance
  • Compare team performance across statistical categories
  • Calculate league-wide averages and trends
  • Build team comparison tools and visualizations

Build docs developers (and LLMs) love