← 返回 Skills 市场
khaney64

Baseball

作者 Kevin Haney · GitHub ↗ · v0.1.3 · MIT-0
cross-platform ✓ 安全检测通过
782
总下载
2
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install baseball
功能描述
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...
使用说明 (SKILL.md)

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 games

# Live game status for the Phillies
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live PHI

# Box score for a specific game
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score 718415

# Box score for last Tuesday's Phillies game
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --date 02/15/2026

# Search for a player
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Judge

# Search with team filter
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Wheeler --team PHI

# Player season stats by ID
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats 592450

# Player 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 games

# Games on a specific date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --date 09/15/2025

# Next 7 days of games
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --days 7

# Upcoming week for a specific team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHI --days 7

# Filter by team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py games --team PHI

# JSON 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 PHI

# By game PK
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live 718415

# Game status from a specific date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py live NYY --date 02/10/2026

# JSON 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 PHI

# By game PK (works for any game, past or present)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score 718415

# By team abbreviation for a past date
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py score PHI --date 02/15/2026

# JSON 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 Judge

# Search by full name
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Aaron Judge

# Filter by team
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py player Wheeler --team PHI

# JSON 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 592450

# By player name (auto-resolves if unique match)
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge

# Specific season
python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py stats Aaron Judge --season 2024

# JSON 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

  • game_pk — Unique MLB game identifier
  • status — Game state: Scheduled, Pre-Game, Warmup, In Progress, Final, Postponed, etc.
  • away_team / home_team — Team id, full name, and abbreviation
  • away_record / home_record — Win-loss record (schedule only)
  • away_score / home_score — Current or final score
  • inning / inning_half — 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
  • last_play — Description of the last completed play
  • line_score — Inning-by-inning runs with R/H/E totals
  • venue — Ballpark name
  • start_time — Scheduled start in local time (ISO 8601)
  • id — MLB player identifier (use with stats command)
  • full_name — 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 \x3CID> 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).
安全使用建议
This skill appears to do what it says: it runs local Python scripts that call the public MLB Stats API (statsapi.mlb.com) and prints results. It does not request secrets or access unrelated system files. Before installing, consider whether you are comfortable allowing the skill to make outbound network requests from your agent (the only external traffic is to the MLB API). If you have strict egress controls, you can restrict or monitor outbound calls to the MLB API host. If you want extra assurance, a quick code review of the included scripts in your environment confirms there are no hidden endpoints or credential leaks.
功能分析
Type: OpenClaw Skill Name: baseball Version: 0.1.3 The baseball skill bundle is a legitimate tool for fetching MLB game schedules, live scores, and player statistics using the official MLB Stats API (statsapi.mlb.com). The implementation in scripts/baseball.py and scripts/mlb_api.py uses standard Python libraries for network requests and data processing, with no evidence of malicious behavior, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
Name/description (MLB schedules, live status, box scores, player search/stats) match the code and runtime instructions. The only required binary is python3, which is appropriate. The code only references MLB endpoints (statsapi.mlb.com) and an internal team map.
Instruction Scope
SKILL.md instructs running the included Python scripts with specific subcommands and arguments. There are no instructions to read unrelated files, prompt for secrets, or transmit data to non-MLB endpoints. The documentation uses an absolute workspace path (/home/claw/.openclaw/...), which is consistent with the agent runtime and not a security concern here.
Install Mechanism
No install spec is provided; the skill is delivered as scripts and docs. No third-party downloads, package managers, or extract/install steps are present.
Credentials
No environment variables, credentials, or config paths are required. The skill does outbound network calls to the MLB Stats API only, which is necessary for its function.
Persistence & Privilege
always is false and the skill does not request elevated or persistent platform privileges. Model invocation is not disabled (default), which is normal for user-invocable skills and reasonable here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install baseball
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /baseball 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.3
- Updated all usage examples to use the full absolute path to the script (python3 /home/claw/.openclaw/workspace/skills/baseball/scripts/baseball.py) - No changes to features or skill logic; documentation updated only
v0.1.2
Player search and stats commands added. - Added player search (`player`) and season stats (`stats`) commands. - You can now look up players by name or team and get up-to-date season statistics. - Documentation expanded with examples and output formats for the new commands. - `description` updated to reflect support for player lookups and stats.
v0.1.1
- Added `--date` option to `live` and `score` commands for fetching game status or box scores for specific dates. - `games` text output now includes a "Game ID" column, making it easier to reference games directly by ID (helpful for doubleheaders). - Updated documentation and examples to explain new usage patterns with `--date` and Game ID.
v0.1.0
- Initial release: fetch MLB game schedules, live statuses, and box scores using the MLB Stats API. - Supports commands to show today's games, upcoming schedules, live game updates, and line scores. - Flexible filtering: query by team, date, or game ID; output in text or JSON. - Live game status includes batter/pitcher matchup, runners, count, inning, and last play. - List all MLB teams or team abbreviations for easy lookup. - No API key required; free, real-time baseball tracking from the command line.
元数据
Slug baseball
版本 0.1.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Baseball 是什么?

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 782 次。

如何安装 Baseball?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install baseball」即可一键安装,无需额外配置。

Baseball 是免费的吗?

是的,Baseball 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Baseball 支持哪些平台?

Baseball 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Baseball?

由 Kevin Haney(@khaney64)开发并维护,当前版本 v0.1.3。

💬 留言讨论