Baseball
by @khaney64
Fetch MLB game schedules, live game status, box scores, player search, and season statistics via the MLB Stats API. Use when the user asks about baseball gam...
clawhub install baseballπ About This Skill
name: baseball description: > Fetch MLB game schedules, live game status, box scores, player search, and season statistics via the MLB Stats API. Use when the user asks about baseball games, scores, who is playing today, game results, live updates, pitching matchups, MLB schedule information, player lookups, or player stats. metadata: {"openclaw":{"emoji":"βΎ","requires":{"bins":["python3"]}}}
Baseball β MLB Game Tracker
Fetch real-time MLB game schedules, live game status, box scores, player search, and season statistics via the MLB Stats API.
Quick Start
# List today's games
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py gamesLive game status for the Phillies
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHIBox score for a specific game
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score 718415Box score for last Tuesday's Phillies game
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --date 02/15/2026Search for a player
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player JudgeSearch with team filter
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Wheeler --team PHIPlayer season stats by ID
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450Player season stats by name
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge --season 2025
Usage
List Teams
# Show all team abbreviations
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py teams
List Games
# Today's games
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py gamesGames on a specific date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --date 09/15/2025Next 7 days of games
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --days 7Upcoming week for a specific team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHI --days 7Filter by team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHIJSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --format json
Live Game Status
Show live count, runners, batter/pitcher matchup, and line score for an in-progress game.
# By team abbreviation (finds today's game)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHIBy game PK
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live 718415Game status from a specific date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live NYY --date 02/10/2026JSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHI --format json
Box Score
Show the line score for any game (in-progress or final).
# By team abbreviation (today's game)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHIBy game PK (works for any game, past or present)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score 718415By team abbreviation for a past date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --date 02/15/2026JSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --format json
Search Players
# Search by last name
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player JudgeSearch by full name
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Aaron JudgeFilter by team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Wheeler --team PHIJSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Judge --format json
Player Stats
# By player ID (from player search results)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450By player name (auto-resolves if unique match)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron JudgeSpecific season
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge --season 2024JSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450 --format json
Output Format
Text (Default)
games:
MLB Games - 09/15/2025
Away Record Home Record Time Status Game ID
-----------------------------------------------------------------------------------------------
PHI Phillies 85-62 NYM Mets 80-67 7:10 PM In Progress 718415
BOS Red Sox 72-75 TB Rays 78-69 6:40 PM Final (5-3) 718420
live:
PHI Phillies 3 @ NYM Mets 5
Top 6th | 1 out | 2-1 count
Bases: 1B [X] 2B [ ] 3B [X]
AB: Kyle Schwarber vs P: Sean Manaea
Last: Trea Turner singled on a line drive to left field. 1 2 3 4 5 6 7 8 9 R H E
PHI 0 1 0 2 0 0 - - - 3 7 1
NYM 2 0 0 1 2 0 - - - 5 9 0
score:
Final: PHI Phillies 6 @ NYM Mets 4 1 2 3 4 5 6 7 8 9 R H E
PHI 0 1 0 2 0 0 2 0 1 6 11 0
NYM 2 0 0 1 2 0 0 0 0 4 9 1
player:
Player Search: "Judge"
ID Name Pos Team # B/T Age
--------------------------------------------------------------------------------
592450 Aaron Judge RF NYY Yankees 99 R/R 33
stats (batting):
Aaron Judge #99 RF | New York Yankees | R/R | Age 33
2025 Season Batting Statistics
G AB R H 2B 3B HR RBI SB BB K AVG OBP SLG OPS
152 541 137 179 30 2 53 114 12 124 160 .331 .457 .688 1.145
stats (pitching):
Zack Wheeler #45 P | Philadelphia Phillies | L/R | Age 35
2025 Season Pitching Statistics
G GS W L ERA IP H R ER HR SO BB SV HLD WHIP K/9 BB/9
30 30 14 6 2.85 198.1 155 68 63 18 210 42 0 0 0.99 9.55 1.91
JSON
{
"date": "09/15/2025",
"games": [
{
"game_pk": 718415,
"status": "In Progress",
"away_team": {"id": 143, "name": "Philadelphia Phillies", "abbreviation": "PHI"},
"home_team": {"id": 121, "name": "New York Mets", "abbreviation": "NYM"},
"away_record": "85-62",
"home_record": "80-67",
"away_score": 3,
"home_score": 5,
"venue": "Citi Field",
"start_time": "2025-09-15T19:10:00-04:00"
}
]
}
player search (JSON):
{
"query": "Judge",
"players": [
{
"id": 592450,
"full_name": "Aaron Judge",
"position": "RF",
"position_name": "Right Fielder",
"primary_number": "99",
"bats": "R",
"throws": "R",
"age": 33,
"team": "New York Yankees",
"team_abbreviation": "NYY",
"active": true
}
]
}
Output Fields
stats command)Team Abbreviations
Run python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py teams to list all abbreviations. Partial team names also work (e.g., "Phillies", "Dodgers", "Red Sox").
ARI, ATL, BAL, BOS, CHC, CWS, CIN, CLE, COL, DET, HOU, KC, LAA, LAD, MIA, MIL, MIN, NYM, NYY, OAK, PHI, PIT, SD, SF, SEA, STL, TB, TEX, TOR, WSH
Notes
live and score commands accept either a numeric game PK or a team abbreviation. When using an abbreviation, the script looks up today's schedule to find the team's game. Use --date MM/DD/YYYY to look up a game on a different date.games text output includes a Game ID column. Use this ID with score or live to drill into a specific game β especially useful for doubleheaders where team abbreviation alone is ambiguous.player command searches active MLB players. Use stats with the player ID from search results to view season statistics.stats command accepts either a numeric player ID or a player name. If a name matches multiple players, you'll be prompted to use a specific ID.--season to view stats from a previous year (e.g., --season 2025).π‘ Examples
List Teams
# Show all team abbreviations
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py teams
List Games
# Today's games
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py gamesGames on a specific date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --date 09/15/2025Next 7 days of games
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --days 7Upcoming week for a specific team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHI --days 7Filter by team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHIJSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --format json
Live Game Status
Show live count, runners, batter/pitcher matchup, and line score for an in-progress game.
# By team abbreviation (finds today's game)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHIBy game PK
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live 718415Game status from a specific date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live NYY --date 02/10/2026JSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHI --format json
Box Score
Show the line score for any game (in-progress or final).
# By team abbreviation (today's game)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHIBy game PK (works for any game, past or present)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score 718415By team abbreviation for a past date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --date 02/15/2026JSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --format json
Search Players
# Search by last name
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player JudgeSearch by full name
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Aaron JudgeFilter by team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Wheeler --team PHIJSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Judge --format json
Player Stats
# By player ID (from player search results)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450By player name (auto-resolves if unique match)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron JudgeSpecific season
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge --season 2024JSON output
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450 --format json
π Tips & Best Practices
live and score commands accept either a numeric game PK or a team abbreviation. When using an abbreviation, the script looks up today's schedule to find the team's game. Use --date MM/DD/YYYY to look up a game on a different date.games text output includes a Game ID column. Use this ID with score or live to drill into a specific game β especially useful for doubleheaders where team abbreviation alone is ambiguous.player command searches active MLB players. Use stats with the player ID from search results to view season statistics.stats command accepts either a numeric player ID or a player name. If a name matches multiple players, you'll be prompted to use a specific ID.--season to view stats from a previous year (e.g., --season 2025).