Query your Yahoo Fantasy Baseball league: view data and optimize your daily lineup via the Yahoo Fantasy Sports API. Read-only — no roster modifications are made.
yahoo_fantasy_api — Yahoo Fantasy Sports API wrapperInstallation: Before first use, run --setup to create a local .deps/ virtual environment and install dependencies from requirements.txt. Subsequent runs reuse the existing venv. To force a clean reinstall, delete the .deps/ directory and run --setup again.
bash
python3 yahoo-fantasy-baseball.py --setup
oob (out-of-band — Yahoo displays the auth code on screen instead of redirecting to a URL)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.
bash
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py leagues
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
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
# League standings
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py standings
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
# Lineup Check — confirmed MLB lineups vs fantasy roster
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py lineup-check [--date YYYY-MM-DD]
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:
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
# Lineup check: verify active players are in confirmed MLB lineups
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py lineup-check
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py lineup-check --date 2026-04-01
Cross-references active fantasy roster players against confirmed MLB batting lineups (from MLB Stats API hydrate=lineups). Flags position players who are in a starting fantasy slot but NOT in their team's confirmed real-life lineup (e.g., scratched, resting, benched vs lefty/righty). Pitchers are excluded (they don't appear in batting lineups). Players whose team's lineup hasn't been posted are NOT flagged — only players whose lineup IS posted and who are absent. Lineups are typically posted 1-3 hours before game time.
bash
# Optimize: smart roster analysis with suggestions
python3 /home/claw/.openclaw/workspace/skills/yahoo-fantasy-baseball/yahoo-fantasy-baseball.py optimize
Three analysis categories:
Each move includes team, opponent, score, and (when set) Yahoo injury status (e.g. DTD, IL10) inline in the parenthetical. If a player suggested to start is DTD, a ⚠️ Day-to-day — confirm in lineup before locking. caution is rendered beneath the line — the optimizer scores ignore status, so a higher-scoring DTD player can still surface as a swap recommendation. Moves to BN may include a reason indicator:
⚠️ — player not in confirmed MLB lineup (urgent — they won't play)🔒 — player's game has already started (locked by Yahoo)📅 — player's team is off todayIn --format json, every entry in swap_groups[].start, swap_groups[].bench, swap_groups[].reshuffle (and the pitcher equivalents) carries a status field — empty string when the player has no Yahoo status. The flat moves[] and pitcher_moves[] arrays mirror the text view: they include every move that is part of a swap group, each tagged with a swap_group index. A group always moves at least one player to or from the bench. Pure active↔active shuffles (e.g. UTIL → SS with no bench involvement) leave the same set of players in the lineup and therefore cannot change scoring, so they are dropped from both the groups and the flat arrays rather than reported as busywork. A reshuffle leg still appears when it is part of a real bench swap — a UTIL player sliding to 1B to make room for an incoming bench bat.
Scores run 0–100 and are derived from the league's own scoring categories, read from league.stat_categories() — not a fixed formula. Each category is min-max normalized across the roster pool and the results averaged, so every category carries equal weight, which is how category leagues actually settle. A stat your league does not score contributes nothing.
Two stat windows feed the score:
average_season window, which is already per-game (or a true rate for OBP/ERA/WHIP). Using rates rather than totals means accumulated playing time cannot inflate a score: a part-time or recently-injured star is compared on quality, not on how many at-bats he has banked.lastmonth window, weighted at _RECENCY_WEIGHT (default 0.35). Counting stats in this window are divided by AB (batters) or IP (pitchers) to keep them rate-based.Batters and pitchers are normalized within their own pools, since their categories aren't comparable. Categories where lower is better (ERA, WHIP, BB/9) are inverted. A player with less than 15 AB (or 5 IP) in the recent window falls back to his season rate for that component rather than being penalized for a small sample — this keeps a player just back from the IL from being buried. If the league's categories can't be read at all, scoring falls back to the legacy composite formula.
Early-season preseason rank blending: The optimizer blends Yahoo's preseason overall rank (OR) into player scores during the first weeks of the season, when current-year stats are too small a sample to be reliable. The blending schedule:
This prevents the optimizer from overreacting to small early-season slumps (e.g., benching a star who went 0-for-8 in the first series). The preseason ranks are fetched via one additional Yahoo API call ( sort=OR, status=T) per optimize run.
FlagDescription--league IDLeague ID (overrides config default)--team IDTeam ID (overrides config/auto-detect)--season YEARSeason year (for historical data)--week NScoring week number--dateSpecific date — accepts MM/DD/YYYY, M/D/YYYY, MM-DD-YYYY, or YYYY-MM-DD (roster, day commands)--format text|json|discordOutput format (default: text)--status FA|A|T|W|ALLPlayer 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|lastmonthSort period (used with --sort)--stat-season YEARSeason year for stat columns (auto-detects: falls back to previous year if league hasn't started)--since 3d|1w|24h|2wFilter transactions by time window (h=hours, d=days, w=weeks, m=months)
Built-in sort modes:
ValueDescriptionOROverall Rank (preseason/projected)ARActual Rank (by real performance)PTSFantasy PointsNAMEAlphabetical
Batting stats:
AbbrevDescriptionRRunsHHits1BSingles2BDoubles3BTriplesHRHome RunsRBIRuns Batted InSBStolen BasesBBWalksKStrikeoutsAVGBatting AverageOBPOn-base PercentageSLGSlugging PercentageOPSOn-base + SluggingABAt BatsPAPlate AppearancesTBTotal BasesXBHExtra Base Hits
Pitching stats:
AbbrevDescriptionWWinsLLossesSVSavesHLDHoldsSV+HSaves + HoldsBSVBlown SavesERAEarned Run AverageWHIPWalks + Hits per Inning PitchedIPInnings PitchedQSQuality StartsK9Strikeouts per 9 InningsBB9Walks per 9 Innings
roster:
text
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:
text
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:
text
Roster Optimization Suggestions
==================================================
LINEUP CHANGES (2 swaps)
Swap 1 — 3B
▶ Start Jake Burger (MIA vs ATL, score: 18.3)
▼ Bench Josh Smith (TEX vs SEA, score: 9.2)
⚠️ not in confirmed MLB lineup
Swap 2 — SS / UTIL
▶ Start Willy Adames at SS (SF vs PHI, score: 35.0)
↔ Move Mookie Betts from SS → UTIL
▼ Bench Tyler Fitzgerald (SF, score: 12.0)
📅 team off today
PITCHER ROTATION (1 swap)
Swap 1 — P
▶ Start Gerrit Cole (NYY vs BOS, score: 42.1) — probable starter today
▼ Bench Nathan Eovaldi (TEX vs SEA, score: 39.0)
💡 not starting today
IL MANAGEMENT (1 suggested)
Move Zack Wheeler (IL-60) from SP slot to IL to free a roster spot.
Total: 4 suggestion(s)
Players on teams whose games are already in progress or finished are locked and excluded from optimization — they will not appear in the move list.
scoreboard:
text
League Scoreboard — Week 1
------------------------------------------------------------
Clanker Killerz 6 vs 4 1% AI 99% hot gas
In progress
Mossi Possi 1 vs 7 Normal Men
In progress
transactions:
text
Recent Transactions
------------------------------------------------------------
add | 1% AI 99% hot gas | Mar 25, 07:38 PM
Add from Free Agent:Luis Castillo (SEA - SP)
add/drop | 1% AI 99% hot gas | Mar 25, 04:14 AM
Add from Waivers: Josh Smith (TEX - 1B,3B,SS,OF)
Drop: Luis Robert Jr. (NYM - OF)
All commands support --format json for structured output.
All commands support --format discord which wraps text output in code blocks.
--season for historical data.auth.today, day, optimize, and lineup-check commands use the MLB Stats API for schedule data (off days, probable pitchers, confirmed batting lineups). This data is not available from the Yahoo Fantasy API.Preferred: Environment variables. Set YAHOO_CONSUMER_KEY and YAHOO_CONSUMER_SECRET via OpenClaw config or your shell environment. The skill will use these automatically — no need to run auth. Note: credentials are still written to oauth2.json on disk because the underlying yahoo_oauth library requires a file for token management. File permissions are set to 0600 on Unix.
Alternative: Interactive setup. Run the auth command to enter credentials interactively. Tokens are stored in ~/.openclaw/credentials/yahoo-fantasy/:
oauth2.json — OAuth consumer key/secret and tokens (managed by yahoo_oauth, file permissions set to 0600 on Unix)yahoo-fantasy.json — Default league_id, team_id, seasonLegacy YFPY .env credentials are auto-migrated to oauth2.json on first use.
--setup to create a local venv at .deps/ and install dependencies before first use.league.team_key(). If detection fails, use config --team <ID> to set it manually.