A comprehensive Node.js application that analyzes your Yahoo Fantasy Football roster, researches player information from multiple sources, and provides intelligent starter recommendations for any given week.
- Roster Analysis: Automatically fetches and analyzes your Yahoo Fantasy Football roster
- Player Research: Gathers player statistics, injury status, matchups, and projections from multiple sources
- Smart Recommendations: AI-powered starter recommendations based on multiple factors
- Risk Assessment: Identifies and alerts you to potential risks (injuries, weather, poor matchups)
- Waiver Wire Suggestions: Recommends potential pickups and drop candidates
- Trade Analysis: Suggests trade opportunities based on roster strengths and weaknesses
- Beautiful CLI Output: Color-coded, easy-to-read recommendations in the terminal
- Node.js 16+
- npm or yarn
- Yahoo Fantasy Football account
- League ID and Team ID (see setup instructions below)
- Clone or download this repository
- Install dependencies:
npm install- Copy the environment template:
cp env.example .env- Configure your environment variables (see Configuration section below)
Edit your .env file with the following information:
# Yahoo Fantasy Football API Configuration
YAHOO_CLIENT_ID=your_yahoo_client_id
YAHOO_CLIENT_SECRET=your_yahoo_client_secret
YAHOO_REDIRECT_URI=http://localhost:3000/callback
# League Configuration
LEAGUE_ID=your_league_id
TEAM_ID=your_team_id
# Optional: External APIs for enhanced research
ESPN_API_KEY=your_espn_api_key
PRO_FOOTBALL_REFERENCE_API_KEY=your_pfr_api_key
OPENWEATHER_API_KEY=your_openweather_api_key
# Application Settings
PORT=3000
NODE_ENV=development-
League ID:
- Go to your Yahoo Fantasy Football league
- The League ID is in the URL:
https://football.fantasysports.yahoo.com/f1/LEAGUE_ID - Or check the league settings page
-
Team ID:
- Go to your team page
- The Team ID is in the URL:
https://football.fantasysports.yahoo.com/f1/LEAGUE_ID/TEAM_ID - Or check the team settings
For full functionality, you'll need to set up Yahoo OAuth2:
- Go to Yahoo Developer Console
- Create a new application
- Get your Client ID and Client Secret
- Set up OAuth2 redirect URI
# Analyze current week with default settings
npm start
# Analyze specific week
npm start -- --week 5
# Interactive mode
npm start -- --interactive
# Skip detailed research (faster, uses mock data)
npm start -- --no-researchnpm start -- --helpAvailable options:
--week, -w: Week number for analysis (default: current week)--league, -l: League ID (default: from .env)--team, -t: Team ID (default: from .env)--interactive, -i: Run in interactive mode--research, -r: Perform detailed player research (default: true)
Run with --interactive flag for a guided setup:
npm start -- --interactiveThis will prompt you for:
- League ID
- Team ID
- Week number
- Whether to perform detailed research
π Yahoo Fantasy Football Roster Analyzer
π Analyzing roster for Week 5...
π Fetching roster and league information...
β
Roster and rules retrieved successfully
π Mock Team Roster
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
QB (2 total)
Starters:
β
Patrick Mahomes (KC)
Bench:
βΈοΈ Josh Allen (BUF)
RB (2 total)
Starters:
β
Christian McCaffrey (SF)
Bench:
βΈοΈ Saquon Barkley (PHI)
WR (1 total)
Starters:
β
Tyreek Hill (MIA)
TE (1 total)
Starters:
β
Travis Kelce (KC)
K (1 total)
Starters:
β
Justin Tucker (BAL)
DEF (1 total)
Starters:
β
Buffalo Bills (BUF)
π League Rules Summary
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
QB: 1 required
RB: 2 required
WR: 2 required
TE: 1 required
K: 1 required
DEF: 1 required
Max Teams: 12
Max Adds: Unlimited
π¬ Researching player statistics and matchups...
β
Player research completed
π Analyzing roster performance...
β
Roster analysis completed
π― Generating starter recommendations...
β
Recommendations generated
π― Week 5 Recommendations
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Team Summary
ββββββββββββββββββββββββββββββββββββββββ
Overall Grade: A-
Projected Points: 125.3
Strengths: 2
Weaknesses: 1
Risks: 0
Key Insights:
β’ Strong RB performance with 2 players
β’ Weak WR performance needs attention
π Starter Recommendations
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. Patrick Mahomes (QB)
Team: KC
Projected Points: 24.5
Confidence: 85%
Risk Level: LOW
Reasoning: High projected points, Improving performance trend
2. Christian McCaffrey (RB)
Team: SF
Projected Points: 22.1
Confidence: 82%
Risk Level: LOW
Reasoning: High projected points, Consistent high performance
3. Tyreek Hill (WR)
Team: MIA
Projected Points: 18.7
Confidence: 78%
Risk Level: LOW
Reasoning: Good projected points, Favorable matchup
4. Travis Kelce (TE)
Team: KC
Projected Points: 16.2
Confidence: 75%
Risk Level: LOW
Reasoning: Good projected points, Consistent high performance
5. Justin Tucker (K)
Team: BAL
Projected Points: 12.8
Confidence: 70%
Risk Level: LOW
Reasoning: Good projected points
6. Buffalo Bills (DEF)
Team: BUF
Projected Points: 10.2
Confidence: 65%
Risk Level: LOW
Reasoning: Moderate scoring potential
βΈοΈ Bench Recommendations
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. Josh Allen (QB)
Team: BUF
Projected Points: 21.3
Risk Level: LOW
Reasoning: Low projected points
2. Saquon Barkley (RB)
Team: PHI
Projected Points: 15.8
Risk Level: LOW
Reasoning: Low projected points
π Waiver Wire Recommendations
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. WR Position
Priority: Priority 7/10
Reasoning: Address Weak WR performance needs attention
Suggested Pickups:
β’ WR3 Option 1
β’ WR3 Option 2
Drop Candidates:
β’ Saquon Barkley
π Confidence & Projections
ββββββββββββββββββββββββββββββββββββββββ
Overall Confidence: 76%
Projected Score: 125.3 points
π High confidence in recommendations!
π Analysis complete! Good luck this week! π
The application is built with a modular architecture:
index.js: Main entry point with CLI interfacesrc/services/: Core business logicyahooFantasyAPI.js: Yahoo API integrationplayerResearch.js: Player data gatheringrosterAnalyzer.js: Roster analysis and optimizationrecommendationEngine.js: Recommendation generation
src/utils/: Utility functionsdisplay.js: CLI output formatting
The application researches players from multiple sources:
- Yahoo Fantasy API: Roster and league data
- ESPN API: Player statistics and projections
- Pro Football Reference: Historical data and advanced stats
- Weather APIs: Game day weather conditions
- Injury Reports: Multiple sources for injury status
npm run devnpm testTo add new data sources, extend the PlayerResearch class:
// In src/services/playerResearch.js
async getNewSourceStats(player) {
// Implement your new data source
return stats;
}Modify the recommendation logic in RecommendationEngine:
// In src/services/recommendationEngine.js
calculatePlayerScore(player, data, week) {
// Add your custom scoring logic
}- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
This tool is for educational and entertainment purposes. Fantasy football involves risk and uncertainty. Always make your own informed decisions about your fantasy team. The creators are not responsible for any losses or poor performance based on these recommendations.
-
"Yahoo access token not found"
- Set up Yahoo OAuth2 or use mock data mode
- Run with
--no-researchflag
-
"League ID not found"
- Check your
.envfile - Verify the League ID in your Yahoo Fantasy URL
- Check your
-
"Team ID not found"
- Check your
.envfile - Verify the Team ID in your Yahoo Fantasy URL
- Check your
-
Slow performance
- Use
--no-researchflag for faster analysis - Check your internet connection
- Use
- Check the troubleshooting section above
- Review the configuration section
- Ensure all dependencies are installed
- Try running in interactive mode for guided setup
- Web interface
- Mobile app
- Historical performance tracking
- Advanced analytics dashboard
- Integration with more fantasy platforms
- Machine learning improvements
- Real-time updates and notifications