- name
- yahoo-fantasy-baseball
- description
- Manage your Yahoo Fantasy Baseball team: view roster, standings, matchups, free agents, draft results, transactions, and injuries. Daily roster optimization detects inactive players, suggests bench swaps, and manages IL slots. Execute roster changes: swap positions, add/drop players, and submit waiver claims. Use when the user asks about their fantasy baseball team, who to start or sit, league standings, available free agents, roster moves, or injury updates.
- metadata
- {"openclaw":{"emoji":"⚾","requires":{"bins":"[Truncated]"}}}
# Yahoo Fantasy Baseball
Manage your Yahoo Fantasy Baseball league: view data, optimize your daily lineup, and execute roster changes via the Yahoo Fantasy Sports API.
## Requirements
- Python 3.10+
- `yahoo_fantasy_api` — Yahoo Fantasy Sports API wrapper
**Installation:** No manual `pip install` needed. On first run, `yahoo-fantasy-baseball.py` creates a local `.deps/` virtual environment inside the skill directory and installs dependencies from `requirements.txt`. Subsequent runs reuse the existing venv. To force a clean reinstall, delete the `.deps/` directory and run any command again.
## Setup
### 1. Create a Yahoo Developer App
1. Go to [https://developer.yahoo.com/apps/](https://developer.yahoo.com/apps/)
2. Click "Create an App"
3. Set **Redirect URI** to `oob` (out-of-band — Yahoo displays the auth code on screen instead of redirecting to a URL)
4. Copy the **Consumer Key** and **Consumer Secret**
### 2. Authenticate
```bash
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py auth
```
Follow the prompts to enter your Consumer Key and Secret. A browser window opens for Yahoo OAuth authorization. Tokens are cached automatically — you only need to do this once.
### 3. Find Your League
```bash
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py leagues
```
### 4. Set Defaults
```bash
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py config --league 12345
```
The skill auto-detects your team within the league. You can also set it explicitly:
```bash
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py config --league 12345 --team 3
```
## Quick Start
```bash
# View your roster
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py roster
# Daily roster status (who's playing, who's off)
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py today
# Roster status for a specific date
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py day --date 2026-03-25
# Get optimization suggestions
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py optimize
# Auto-swap inactive players for bench players
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py swap --auto --confirm
# Add a free agent
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py add --player "Jake Burger" --confirm
# League standings
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py standings
```
## Commands
### Data Commands (Read)
```bash
# Auth & Config
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py auth
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py config --league 12345 --team 3 --season 2026
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py config
# Leagues & Teams
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py leagues [--season YEAR]
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py teams
# Roster & Lineup
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py roster [--date YYYY-MM-DD]
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py lineup [--week N]
# Standings & Matchups
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py standings
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py matchup [--week N]
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py scoreboard [--week N]
# Players & Draft
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py players [--search NAME] [--position POS] [--status FA|A|T|W|ALL] [--sort OR|AR|PTS|NAME|HR|ERA|...] [--sort-type season|lastweek|lastmonth] [--stat-season YEAR] [--count N]
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py draft [--team ID]
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py transactions [--type add,drop,trade] [--since 3d]
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py injuries
```
### Daily Management
```bash
# Today: roster status with MLB schedule awareness (shortcut for 'day' with today's date)
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py today
# Day: roster status for a specific date
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py day --date 2026-03-25
```
Groups your roster into ACTIVE (team playing), NOT PLAYING (team off), INJURED, and BENCH. Shows each player's eligible positions, game start times (local timezone), and flags probable starting pitchers. Displays "First pitch" time at the top so you know when to finalize your lineup. The `today` command is a shortcut for `day` with today's date.
```bash
# Standouts: yesterday's top performers across all league teams
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py standouts [--date YYYY-MM-DD] [--min-points N] [--count N]
```
Fetches daily player stats for all rostered players across every team in the league and identifies standout performances. Output is split into two sections:
1. **Top Performers** — players in active lineup slots who scored the most fantasy points
2. **Left on the Bench** — benched players with notable performances (points that didn't count)
Each player shows their fantasy points, key stat line, and achievement badges (e.g., "Multi-HR", "10+ K", "Gem", "CGSO"). Defaults to yesterday; use `--date` for a specific date.
```bash
# Optimize: smart roster analysis with suggestions
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py optimize
```
Three analysis categories:
1. **Lineup swaps** — optimal batter assignment via constraint solver (position-aware, fills restrictive slots before UTIL)
2. **Pitcher rotation** — probable starters on bench, active pitchers on off days
3. **IL management** — injured players not in IL slots, cleared players still in IL
### Write Commands
All write commands show a preview by default. Add `--confirm` to execute.
```bash
# Swap a player to a different position slot
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py swap --player "Aaron Judge" --to BN [--confirm]
# Auto-execute all optimize swap suggestions
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py swap --auto [--confirm]
# Move injured player to IL slot
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py move-to-il --player "Zack Wheeler" [--confirm]
# Add a free agent
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py add --player "Jake Burger" [--confirm]
# Drop a player
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py drop --player "Jake Burger" [--confirm]
# Atomic add + drop
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py add-drop --add "Jake Burger" --drop "Luis Arraez" [--confirm]
# Waiver claim (with optional FAAB bid and drop)
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py claim --player "Jake Burger" [--drop "Luis Arraez"] [--faab 15] [--confirm]
```
## Common Flags
| Flag | Description |
|------|-------------|
| `--league ID` | League ID (overrides config default) |
| `--team ID` | Team ID (overrides config/auto-detect) |
| `--season YEAR` | Season year (for historical data) |
| `--week N` | Scoring week number |
| `--date` | Specific date — accepts MM/DD/YYYY, M/D/YYYY, MM-DD-YYYY, or YYYY-MM-DD (roster, day commands) |
| `--format text\|json\|discord` | Output format (default: text) |
| `--status FA\|A\|T\|W\|ALL` | Player status filter: FA (free agents), A (available=FA+W), T (taken), W (waivers), ALL (every player) |
| `--sort OR\|AR\|PTS\|NAME\|{stat}` | Sort order: OR = overall/preseason rank (default), AR = actual/current rank, PTS = points, NAME = alphabetical, or stat abbreviation. See stat sort reference below |
| `--sort-type season\|lastweek\|lastmonth` | Sort period (used with --sort) |
| `--stat-season YEAR` | Season year for stat columns (auto-detects: falls back to previous year if league hasn't started) |
| `--since 3d\|1w\|24h\|2w` | Filter transactions by time window (h=hours, d=days, w=weeks, m=months) |
| `--confirm` | Execute write operations (without this, preview only) |
### Sort Reference
Built-in sort modes:
| Value | Description |
|-------|-------------|
| `OR` | Overall Rank (preseason/projected) |
| `AR` | Actual Rank (by real performance) |
| `PTS` | Fantasy Points |
| `NAME` | Alphabetical |
Batting stats:
| Abbrev | Description |
|--------|-------------|
| `R` | Runs |
| `H` | Hits |
| `1B` | Singles |
| `2B` | Doubles |
| `3B` | Triples |
| `HR` | Home Runs |
| `RBI` | Runs Batted In |
| `SB` | Stolen Bases |
| `BB` | Walks |
| `K` | Strikeouts |
| `AVG` | Batting Average |
| `OBP` | On-base Percentage |
| `SLG` | Slugging Percentage |
| `OPS` | On-base + Slugging |
| `AB` | At Bats |
| `PA` | Plate Appearances |
| `TB` | Total Bases |
| `XBH` | Extra Base Hits |
Pitching stats:
| Abbrev | Description |
|--------|-------------|
| `W` | Wins |
| `L` | Losses |
| `SV` | Saves |
| `HLD` | Holds |
| `SV+H` | Saves + Holds |
| `BSV` | Blown Saves |
| `ERA` | Earned Run Average |
| `WHIP` | Walks + Hits per Inning Pitched |
| `IP` | Innings Pitched |
| `QS` | Quality Starts |
| `K9` | Strikeouts per 9 Innings |
| `BB9` | Walks per 9 Innings |
## Output Format
### Text (Default)
**roster:**
```
Roster — Team Name
Name Pos Slot Team Status
----------------------------------------------------------
Aaron Judge OF,Util OF NYY
Mookie Betts SS,OF,Util SS LAD
Zack Wheeler SP IL PHI IL-60
```
**today / day:**
```
Today — Team Name
First pitch: 1:10 PM
ACTIVE (team playing today) (8)
Aaron Judge OF,Util NYY vs BOS 7:05 PM
Gerrit Cole SP NYY vs BOS 7:05 PM [PROBABLE STARTER]
NOT PLAYING (team off today) (3)
Mookie Betts SS,OF,Util LAD
BENCH (3)
Jake Burger 3B,1B,Util MIA at ATL 1:10 PM
INJURED LIST (1)
Zack Wheeler SP PHI (IL-60)
```
**optimize:**
```
Roster Optimization Suggestions
==================================================
LINEUP SWAPS (2 suggested)
Jake Burger (BN, MIA playing)
↔ Mookie Betts (SS, LAD off)
Aaron Judge (BN, NYY, score: 20.5)
↔ Willy Adames (UTIL, SF, score: 1.3)
PITCHER ROTATION (1 alerts)
Gerrit Cole (NYY) is a probable starter today but is on the bench.
IL MANAGEMENT (1 suggested)
Move Zack Wheeler (IL-60) from SP slot to IL to free a roster spot.
Total: 4 suggestion(s)
```
**scoreboard:**
```
League Scoreboard — Week 1
View on GitHub