Overview
After authenticating with Yahoo, you’ll see a list of all your fantasy basketball leagues. The league selection process filters and displays only head-to-head category leagues, organized by season and team name.Fetching Your Leagues
The/select route queries Yahoo’s API to retrieve all your leagues:
main.py
API Query Breakdown
Understanding the Yahoo API query
Understanding the Yahoo API query
users;use_login=1: Get data for the currently logged-in usergames;game_codes=nba: Filter to NBA (basketball) games onlyleagues;out=teams: Fetch leagues with team information included
Filtering Head-to-Head Leagues
The app only displays head-to-head category leagues (not points-based or rotisserie):main.py
If you don’t see a league listed, verify it’s configured as “Head-to-Head Categories” in Yahoo Fantasy Basketball settings.
Finding Your Team
For each league, the app identifies which team belongs to you:main.py
Owner Identification
The_is_owner helper checks if you’re the team manager:
main.py
League List Display
Leagues are displayed sorted by recency and team name:main.py
Display Format
Each league shows:- Season: The NBA season year (e.g., “2024”)
- Team Name: Your team’s name in that league
- League Key: A unique identifier used for API calls
The Selection Interface
HTML Structure
The selection page presents a dropdown menu:select.html
JavaScript Enhancement
When you select a league, JavaScript captures the team name:select.html
Why store both league_key and team_name?
Why store both league_key and team_name?
- league_key: Used for all Yahoo API calls (format:
nba.l.12345) - team_name: Displayed in the dashboard header and used to identify your team in league data
Submitting Your Selection
When you click “Continue to Dashboard”, the form posts to/greet:
main.py
Switching Leagues
To switch to a different league:- Navigate back to the league selection page (via navbar or direct URL)
- Select a different league from the dropdown
- Your session updates with the new league information
Switching leagues preserves your authentication token but resets all league-specific data like cached statistics.
League Data Structure
Each league object contains:Season Format
Seasons are represented as:- Single year: “2024” for the 2024-25 NBA season
- The year represents when the season started
League Key Format
League keys follow Yahoo’s format:{game_id}.l.{league_id}
Example: 423.l.12345
423: NBA game ID for the current seasonl: Denotes a league12345: Your specific league ID
Troubleshooting
No leagues showing up
No leagues showing up
Possible reasons:
- Not in any head-to-head category leagues: The app only shows H2H leagues
- Authentication expired: Try logging out and back in
- No active NBA leagues: Verify you have active Yahoo Fantasy Basketball leagues
Wrong team name displayed
Wrong team name displayed
If the wrong team appears:
- The app uses Yahoo’s
is_current_loginflag and your GUID - Co-managed teams may show the first manager’s name
- Try refreshing the page or re-authenticating
League from previous season showing
League from previous season showing
This is normal behavior:
- The app shows all your leagues, including past seasons
- Leagues are sorted with most recent first
- You can select any season to view historical data
- Some features may have limited data for past seasons
Session Data
After selection, your session contains:- Make league-specific API calls
- Display your team name
- Identify your team in comparisons
- Filter data to your perspective
Next Steps
Dashboard Navigation
Explore the dashboard interface and tabs
Interpreting Analytics
Learn how to read the analytics and insights