
Mlb Data
- 570 installs
- 201 repo stars
- Updated August 5, 2026
- machina-sports/sports-skills
mlb-data is a Claude Code skill that pulls MLB schedules, box scores, play-by-play, and player stats into fantasy, betting research, or editorial baseball products via standardized ingestion recipes.
About
mlb-data is a Machina Sports agent skill from machina-sports/sports-skills for ingesting Major League Baseball data into applications. It provides standardized recipes to fetch schedules, box scores, play-by-play events, and player statistics so fantasy tools, betting research dashboards, or editorial baseball products stay current without hand-rolling MLB API clients. Developers reach for mlb-data when they need repeatable pipelines for game-day updates, historical stat joins, or content feeds grounded in official game data. The skill focuses on ingestion patterns and normalized outputs agents can wire into databases, APIs, or editorial workflows rather than one-off CSV downloads.
- Schedules, standings, and game metadata
- Box scores and play-by-play events
- Player and team season statistics
- Historical season backfill patterns
- Fantasy and content-ready export shapes
Mlb Data by the numbers
- 570 all-time installs (skills.sh)
- +9 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #421 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/machina-sports/sports-skills --skill mlb-dataAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 570 |
|---|---|
| repo stars | ★ 201 |
| Last updated | August 5, 2026 |
| Repository | machina-sports/sports-skills ↗ |
How do you ingest MLB schedules and box scores into an app?
Pull MLB schedules, box scores, play-by-play, and player stats into fantasy, betting research, or editorial baseball products via standardized ingestion recipes.
Who is it for?
Developers building fantasy baseball, betting research, or sports editorial tools who need repeatable MLB schedule, box score, and play-by-play ingestion.
Skip if: Products covering non-MLB leagues only or teams that need live broadcast rights and video pipelines instead of structured game and player statistics.
When should I use this skill?
A developer asks to fetch MLB schedules, box scores, play-by-play, player stats, or standardized baseball data ingestion for an app.
What you get
Structured MLB schedule, box score, play-by-play, and player stat datasets ready for fantasy, betting, or editorial product pipelines.
- MLB schedule datasets
- Box score and play-by-play extracts
Files
MLB Data
Before writing queries, consult references/api-reference.md for endpoints, ID conventions, and data shapes.
Setup
Before first use, check if the CLI is available:
which sports-skills || pip install sports-skillsIf pip install fails with a Python version error, the package requires Python 3.10+. Find a compatible Python:
python3 --version # check version
# If < 3.10, try: python3.12 -m pip install sports-skills
# On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skillsNo API keys required.
Quick Start
Prefer the CLI — it avoids Python import path issues:
sports-skills mlb get_scoreboard
sports-skills mlb get_standings --season=2025
sports-skills mlb get_teamsCRITICAL: Before Any Query
CRITICAL: Before calling any data endpoint, verify:
- Season year is derived from the system prompt's
currentDate— never hardcoded. - If only a team name is provided, call
get_teamsto resolve the team ID before using team-specific commands.
Choosing the Season
Derive the active season from the system prompt's date — not just the calendar year.
- If the user specifies a season, use it as-is.
- If the user says "current", "this season", or doesn't specify: The MLB season runs late March/April through October. If the current month is January–March, the last completed season was the prior calendar year. From April onward, use the current calendar year.
Commands
| Command | Description |
|---|---|
get_scoreboard | Live/recent MLB scores |
get_standings | Standings by league and division |
get_teams | All 30 MLB teams |
get_team_roster | Full roster for a team |
get_team_schedule | Schedule for a specific team |
get_game_summary | Detailed box score and scoring plays |
get_leaders | MLB statistical leaders |
get_news | MLB news articles |
get_play_by_play | Full play-by-play for a game |
get_win_probability | Win probability chart data |
get_schedule | Schedule for a specific date or season |
get_injuries | Injury reports across all teams |
get_transactions | Recent transactions |
get_depth_chart | Depth chart for a team |
get_team_stats | Team statistical profile |
get_player_stats | Player statistical profile |
See references/api-reference.md for full parameter lists and return shapes.
Examples
Example 1: Today's scores User says: "What are today's MLB scores?" Actions: 1. Call get_scoreboard() Result: All live and recent MLB games with scores by inning and status
Example 2: Division standings User says: "Show me the AL East standings" Actions: 1. Derive season year from currentDate 2. Call get_standings(season=<derived_year>) 3. Filter results for American League East Result: AL East standings with W-L, PCT, GB, run differential
Example 3: Team roster User says: "Who's on the Yankees roster?" Actions: 1. Call get_team_roster(team_id="10") Result: Full Yankees roster with name, position, bats/throws, height, weight
Example 4: Game box score User says: "Show me the full box score for last night's Dodgers game" Actions: 1. Call get_scoreboard(date="<yesterday>") to find the event_id 2. Call get_game_summary(event_id=<id>) for full box score Result: Complete box score with batting/pitching stats per player
Example 5: Injury report User says: "Who's on the IL for the Yankees?" Actions: 1. Call get_injuries() 2. Filter results for New York Yankees (team_id=10) Result: Yankees IL list with player name, position, IL type, and injury detail
Example 6: Player statistics User says: "Show me Shohei Ohtani's stats" Actions: 1. Derive season year from currentDate 2. Call get_player_stats(player_id="39832", season_year=<derived_year>) Result: Season stats by category (batting, pitching) with value, rank, and per-game averages
Commands that DO NOT exist — never call these
- ~~
get_odds~~ / ~~get_betting_odds~~ — not available. For prediction market odds, use the polymarket or kalshi skill. - ~~
search_teams~~ — does not exist. Useget_teamsinstead. - ~~
get_box_score~~ — does not exist. Useget_game_summaryinstead. - ~~
get_player_ratings~~ — does not exist. Useget_player_statsinstead.
If a command is not listed in the Commands table above, it does not exist.
Error Handling
When a command fails, do not surface raw errors to the user. Instead: 1. Catch silently and try alternatives 2. If team name given instead of ID, use get_teams to find the ID first 3. Only report failure with a clean message after exhausting alternatives
Troubleshooting
Error: sports-skills command not found Cause: Package not installed Solution: Run pip install sports-skills
Error: Team not found by ID Cause: Wrong or outdated ESPN team ID used Solution: Call get_teams to get the current list of all 30 MLB teams with their IDs
Error: No data returned for a future game Cause: ESPN only returns data for completed or in-progress games Solution: Use get_schedule to see upcoming game details; get_scoreboard only covers active/recent games
Error: Offseason — scoreboard returns 0 events Cause: No games scheduled during the offseason (November–March) Solution: Use get_standings or get_news instead; MLB offseason transactions are available via get_transactions
MLB Data — API Reference
Commands
get_scoreboard
Get live/recent MLB scores.
date(str, optional): Date in YYYY-MM-DD format. Defaults to today.
Returns events[] with game info, scores (by inning), status, and competitors.
get_standings
Get MLB standings by league and division.
season(int, optional): Season year
Returns groups[] with AL/NL leagues and East/Central/West division standings including W-L, PCT, GB, runs scored/allowed, run differential, and streak.
get_teams
Get all 30 MLB teams. No parameters.
Returns teams[] with id, name, abbreviation, logo, and location.
get_team_roster
Get full roster for a team.
team_id(str, required): ESPN team ID (e.g., "10" for Yankees)
Returns athletes[] with name, position, jersey number, height, weight, experience, bats/throws, and birthplace.
get_team_schedule
Get schedule for a specific team.
team_id(str, required): ESPN team IDseason(int, optional): Season year
Returns events[] with opponent, date, score (if played), and venue.
get_game_summary
Get detailed box score and scoring plays.
event_id(str, required): ESPN event ID
Returns game_info, competitors, boxscore (batting/pitching stats per player), scoring_plays, and leaders.
get_leaders
Get MLB statistical leaders (batting avg, home runs, ERA, etc.).
season(int, optional): Season year
Returns categories[] with leader rankings per stat category.
get_news
Get MLB news articles.
team_id(str, optional): Filter by team
Returns articles[] with headline, description, published date, and link.
get_play_by_play
Get full play-by-play data for a game.
event_id(str, required): ESPN event ID
Returns play-by-play detail including inning, outs, batter, pitcher, play description, and scoring plays.
get_win_probability
Get win probability chart data for a game.
event_id(str, required): ESPN event ID
Returns timestamped home/away win probability percentages throughout the game.
get_schedule
Get MLB schedule for a specific date or season.
date(str, optional): Date in YYYY-MM-DD formatseason(int, optional): Season year (used only if no date provided)
Returns events[] for the specified date.
get_injuries
Get current MLB injury reports across all teams. No parameters.
Returns teams[] with per-team injury lists including player name, position, status (10-Day IL/15-Day IL/60-Day IL/Day-To-Day), injury type, and detail.
get_transactions
Get recent MLB transactions (trades, signings, DFA, IL moves).
limit(int, optional): Max transactions to return. Defaults to 50.
Returns transactions[] with date, team, and description.
get_depth_chart
Get depth chart for a specific team.
team_id(str, required): ESPN team ID
Returns charts[] with positional depth (lineup, rotation, bullpen) and player depth order.
get_team_stats
Get full team statistical profile for a season.
team_id(str, required): ESPN team IDseason_year(int, optional): Season year. Defaults to current.season_type(int, optional): 2=regular (default), 3=postseason.
Returns categories[] (Batting, Pitching, Fielding) with detailed stats including value, rank, and per-game averages.
get_player_stats
Get full player statistical profile for a season.
player_id(str, required): ESPN athlete IDseason_year(int, optional): Season year. Defaults to current.season_type(int, optional): 2=regular (default), 3=postseason.
Returns categories[] with detailed stats including value, rank, and per-game averages.
Team IDs
| Team | ID | Team | ID |
|---|---|---|---|
| Arizona Diamondbacks | 29 | Milwaukee Brewers | 8 |
| Atlanta Braves | 15 | Minnesota Twins | 9 |
| Baltimore Orioles | 1 | New York Mets | 21 |
| Boston Red Sox | 2 | New York Yankees | 10 |
| Chicago Cubs | 16 | Oakland Athletics | 11 |
| Chicago White Sox | 4 | Philadelphia Phillies | 22 |
| Cincinnati Reds | 17 | Pittsburgh Pirates | 23 |
| Cleveland Guardians | 5 | San Diego Padres | 25 |
| Colorado Rockies | 27 | San Francisco Giants | 26 |
| Detroit Tigers | 6 | Seattle Mariners | 12 |
| Houston Astros | 18 | St. Louis Cardinals | 24 |
| Kansas City Royals | 7 | Tampa Bay Rays | 30 |
| Los Angeles Angels | 3 | Texas Rangers | 13 |
| Los Angeles Dodgers | 19 | Toronto Blue Jays | 14 |
| Miami Marlins | 28 | Washington Nationals | 20 |
Use get_teams for the complete, authoritative list.
MLB Team IDs
| Team | ID | Team | ID |
|---|---|---|---|
| Arizona Diamondbacks | 29 | Milwaukee Brewers | 8 |
| Atlanta Braves | 15 | Minnesota Twins | 9 |
| Baltimore Orioles | 1 | New York Mets | 21 |
| Boston Red Sox | 2 | New York Yankees | 10 |
| Chicago Cubs | 16 | Oakland Athletics | 11 |
| Chicago White Sox | 4 | Philadelphia Phillies | 22 |
| Cincinnati Reds | 17 | Pittsburgh Pirates | 23 |
| Cleveland Guardians | 5 | San Diego Padres | 25 |
| Colorado Rockies | 27 | San Francisco Giants | 26 |
| Detroit Tigers | 6 | Seattle Mariners | 12 |
| Houston Astros | 18 | St. Louis Cardinals | 24 |
| Kansas City Royals | 7 | Tampa Bay Rays | 30 |
| Los Angeles Angels | 3 | Texas Rangers | 13 |
| Los Angeles Dodgers | 19 | Toronto Blue Jays | 14 |
| Miami Marlins | 28 | Washington Nationals | 20 |
Tip: Use get_teams to get the full, accurate list of team IDs.
#!/bin/bash
# Validates parameters before executing sports-skills commands
SPORT="mlb"
MONTH=$(date +%m)
case "$SPORT" in
mlb)
if [[ $MONTH -ge 11 || $MONTH -le 2 ]]; then
echo "WARNING: MLB is in off-season (late Mar–Oct). Scoreboard may be empty."
echo "SUGGESTION: Use get_news or get_standings with a prior season."
fi
;;
esac
if [[ "$*" == *"--date="* ]]; then
DATE=$(echo "$*" | grep -o '\-\-date=[^ ]*' | cut -d= -f2)
if [[ ! "$DATE" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
echo "ERROR: Date must be YYYY-MM-DD format. Got: $DATE"
exit 1
fi
fi
if [[ "$*" == *"--team_id="* ]]; then
TEAM_ID=$(echo "$*" | grep -o '\-\-team_id=[^ ]*' | cut -d= -f2)
if [[ -z "$TEAM_ID" ]]; then
echo "ERROR: --team_id requires a value. Use get_teams to find valid IDs."
exit 1
fi
fi
echo "OK"
Related skills
How it compares
Use mlb-data when you need opinionated MLB ingestion recipes; build custom clients when you only need a single endpoint and will not reuse sports pipeline patterns.
FAQ
What MLB data does mlb-data ingest?
mlb-data ingests MLB schedules, box scores, play-by-play sequences, and player statistics through standardized recipes. Outputs feed fantasy platforms, betting research tools, and editorial baseball products that need structured game and player feeds.
Who is mlb-data designed for?
mlb-data targets developers building fantasy baseball, betting research, or editorial baseball experiences. It emphasizes repeatable ingestion pipelines instead of manual exports or ad hoc API scripts per feature.
Does mlb-data handle non-MLB sports?
mlb-data focuses on Major League Baseball datasets—schedules, box scores, play-by-play, and player stats. Other leagues require different Machina Sports skills or custom ingestion outside this MLB scope.