Overview
The API Playground is an interactive tool that allows you to:- Browse all available MLB Stats API endpoints
- Configure path and query parameters
- Send requests and view live responses
- Copy working examples to use in your code
- Discover entity IDs (teams, players, games, etc.)
Accessing the Playground
The playground is available in the application UI. Navigate to the playground section to start exploring.Endpoint Categories
Endpoints are organized into the following categories:Sport
- Sports - List all sports with their IDs (MLB=1, AAA=11, etc.)
- Divisions - Get division info (AL East, NL West, etc.) with standings
- Leagues - Get league details (American/National League)
Schedule
- Schedule - Get game schedules by date, team, or venue
- Postseason Schedule - Postseason bracket and series information
Game
- Live Feed - Complete live game data with all plays and matchups
- Boxscore - Traditional box score with batting/pitching lines
- Linescore - Inning-by-inning runs, hits, errors
- Content - Game media including highlight videos
- Context Metrics - Advanced stats like leverage index
- Win Probability - Win probability after each play
- Play by Play - Chronological list of all plays
- Game Changes - Games updated since a given date
- Game Pace - Pace of play statistics
Teams
- Teams - List all teams with IDs and metadata
- Team Details - Detailed information for a specific team
- Roster - Current or historical roster
- Coaches - Coaching staff information
- Team History - Franchise history and former names
- Affiliates - Minor league affiliates
People
- Person - Player biographical information
- Person Stats - Player statistics (season or career)
- Game Stats - Player’s stats from a specific game
- Free Agents - List of free agents by offseason
- People Changes - Players whose records changed since a date
- People Search - Search players by name
Standings
- Standings - Current standings with W-L records and splits
Stats
- Stats - General stats query for aggregated data
- Leaders - League leaders in specific categories
Other
- Seasons - Season metadata and important dates
- Venues - Ballpark information and dimensions
- Draft - MLB Draft results by year
- Transactions - Roster transactions (trades, signings, etc.)
- Jobs - Game officials (umpires, scorers)
- Uniforms - Uniform details for specific games
- Attendance - Attendance figures by team and season
Meta
- Baseball Stats - All available stat types and categories
- Game Status - All possible game status codes
- Game Types - Game type codes and descriptions
Using Parameters
Parameters are divided into two types:Path Parameters
Path parameters are part of the endpoint URL:119- Los Angeles Dodgers147- New York Yankees
Query Parameters
Query parameters are added to the URL:Filter by sport (1=MLB, 11=AAA, 51=International)
Year for seasonal data
Specific date in ISO format (YYYY-MM-DD)
Comma-separated field paths to include in response
Additional data to include (e.g., “team”, “person”, “linescore”)
Field Filtering
Thefields parameter allows you to limit the response to specific fields:
dates,games,gamePk- Include dates, games within dates, and gamePk within gamesteams,team,name- Include teams, team object, and team name
Hydrations
Thehydrate parameter adds related data to the response:
team- Include team detailsperson- Include person/player detailslinescore- Include linescore dataflags- Include game flags (no-hitter, perfect game)
Example Queries
Get Today’s Schedule
Get Live Game Feed
Get Player Stats
Get Team Roster
Custom Endpoints
The playground includes a custom endpoint option for exploring unlisted API paths:Next Steps
View All Endpoints
Browse complete endpoint documentation
Fetch Library
Use endpoints in your TypeScript code