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
CODEBLOCK0
Usage
List Teams
CODEBLOCK1
List Games
CODEBLOCK2
Live Game Status
Show live count, runners, batter/pitcher matchup, and line score for an in-progress game.
CODEBLOCK3
Box Score
Show the line score for any game (in-progress or final).
CODEBLOCK4
Search Players
CODEBLOCK5
Player Stats
CODEBLOCK6
Output Format
Text (Default)
games:
CODEBLOCK7
live:
CODEBLOCK8
score:
CODEBLOCK9
player:
CODEBLOCK10
stats (batting):
CODEBLOCK11
stats (pitching):
CODEBLOCK12
JSON
CODEBLOCK13
player search (JSON):
CODEBLOCK14
Output Fields
- - gamepk — Unique MLB game identifier
- status — Game state: Scheduled, Pre-Game, Warmup, In Progress, Final, Postponed, etc.
- awayteam / hometeam — Team id, full name, and abbreviation
- awayrecord / homerecord — Win-loss record (schedule only)
- awayscore / homescore — Current or final score
- inning / inninghalf — Current inning number and half (Top/Bottom)
- balls / strikes / outs — Current count
- runners — Base occupancy: first, second, third (true/false)
- matchup — Current batter and pitcher names
- lastplay — Description of the last completed play
- linescore — Inning-by-inning runs with R/H/E totals
- venue — Ballpark name
- starttime — Scheduled start in local time (ISO 8601)
- id — MLB player identifier (use with
stats command) - fullname — Player's full name
- position — Position abbreviation (RF, P, C, SS, etc.)
- primary_number — Jersey number
- bats / throws — Batting side and throwing hand (R, L, S)
- batting — Season batting stats (avg, obp, slg, ops, hr, rbi, etc.)
- pitching — Season pitching stats (era, wins, losses, whip, strikeouts, etc.)
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
- - Data is sourced from the MLB Stats API. See copyright.
- The MLB Stats API is free and open — no API key or authentication is required. Please don't abuse it. Excessive requests (rapid polling, bulk scraping, etc.) may result in your IP being blocked. When checking live games, poll no more than once every 15 seconds.
- The
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. - The
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. - The
player command searches active MLB players. Use stats <ID> with the player ID from search results to view season statistics. - The
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. - During the offseason, use
--season to view stats from a previous year (e.g., --season 2025).
棒球 — MLB 比赛追踪器
通过 MLB Stats API 获取实时 MLB 比赛日程、比赛实时状态、比分详情、球员搜索和赛季统计数据。
快速开始
bash
列出今日比赛
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games
费城人队比赛实时状态
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHI
指定比赛的比分详情
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score 718415
上周二费城人队的比分详情
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --date 02/15/2026
搜索球员
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Judge
按球队筛选搜索
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Wheeler --team PHI
按ID查询球员赛季数据
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450
按姓名查询球员赛季数据
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge --season 2025
使用方法
列出球队
bash
显示所有球队缩写
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py teams
列出比赛
bash
今日比赛
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games
指定日期的比赛
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --date 09/15/2025
未来7天的比赛
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --days 7
指定球队未来一周的比赛
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHI --days 7
按球队筛选
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHI
JSON 输出
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --format json
比赛实时状态
显示进行中比赛的实时计数、跑垒员、击球员/投手对决和逐局得分。
bash
按球队缩写(查找今日比赛)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHI
按比赛PK
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live 718415
指定日期的比赛状态
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live NYY --date 02/10/2026
JSON 输出
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHI --format json
比分详情
显示任何比赛(进行中或已结束)的逐局得分。
bash
按球队缩写(今日比赛)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI
按比赛PK(适用于任何比赛,过去或现在)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score 718415
按球队缩写查询过去日期
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --date 02/15/2026
JSON 输出
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --format json
搜索球员
bash
按姓氏搜索
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Judge
按全名搜索
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Aaron Judge
按球队筛选
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Wheeler --team PHI
JSON 输出
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Judge --format json
球员数据
bash
按球员ID(来自球员搜索结果)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450
按球员姓名(唯一匹配时自动解析)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge
指定赛季
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge --season 2024
JSON 输出
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450 --format json
输出格式
文本(默认)
比赛列表:
MLB 比赛 - 2025年9月15日
客队 战绩 主队 战绩 时间 状态 比赛ID
PHI 费城人队 85-62 NYM 大都会队 80-67 7:10 PM 进行中 718415
BOS 红袜队 72-75 TB 光芒队 78-69 6:40 PM 已结束 (5-3) 718420
实时状态:
PHI 费城人队 3 @ NYM 大都会队 5
第6局上半 | 1出局 | 2-1球数
跑垒员: 一垒 [X] 二垒 [ ] 三垒 [X]
打席: Kyle Schwarber vs 投手: Sean Manaea
上一球: Trea Turner 左外野平飞安打。
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
比分详情:
已结束: PHI 费城人队 6 @ NYM 大都会队 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
球员:
球员搜索: Judge
ID 姓名 位置 球队 号码 B/T 年龄
592450 Aaron Judge RF NYY 洋基队 99 R/R 33
数据(击球):
Aaron Judge #99 RF | 纽约洋基队 | R/R | 年龄 33
2025赛季击球数据
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
数据(投球):
Zack Wheeler #45 P | 费城费城人队 | L/R | 年龄 35
2025赛季投球数据
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
json
{
date