MLB Stats API - Baseball Data avatar

MLB Stats API - Baseball Data

Pricing

from $0.01 / 1,000 results

Go to Apify Store
MLB Stats API - Baseball Data

MLB Stats API - Baseball Data

Comprehensive MLB baseball statistics including player stats, game logs, standings & historical data. Perfect for fantasy sports, betting & analytics.

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

The Howlers

The Howlers

Maintained by Community

Actor stats

0

Bookmarked

7

Total users

1

Monthly active users

3 days ago

Last modified

Share

MLB Stats API

Fetch MLB baseball data including teams, players, schedules, standings, and game statistics from the official MLB Stats API.


Quick Start

Test with Demo Mode (free, no API key needed)

{
"demoMode": true
}

Run with real data

{
"demoMode": false,
"task": "standings",
"leaderCategory": "homeRuns"
}

Input Parameters

ParameterTypeDefaultRequiredDescription
taskstring"standings"Yes*What data to fetch
teamIdinteger-NoMLB team ID (e.g., 147 for New York Yankees, 111 for Boston Red Sox). Required for team_roster and team_schedule.
playerIdinteger-NoMLB player ID for player_stats task
gameIdinteger-NoMLB game ID (gamePk) for game_boxscore task
seasoninteger-NoSeason year (e.g., 2024). Defaults to current season.
datestring-NoDate for schedule (YYYY-MM-DD format). Defaults to today.
leaderCategorystring"homeRuns"NoCategory for leaders (homeRuns, battingAverage, rbi, wins, era, strikeouts)
demoModebooleantrueNoReturn sample data without making API calls
webhookUrlstring-NoURL to receive results via POST request (Zapier, Make, n8n, or custom endpoint)

Pricing

This actor uses pay-per-event billing:

EventDescriptionPrice
MLB Teams ListFetch all MLB teams with basic info (name, abbreviation, division, league)$0.01
Team RosterGet complete roster for a team including player positions, numbers, and status$0.01
Team ScheduleFetch team's upcoming and past games with scores and opponents$0.01
League StandingsCurrent MLB standings by division with wins, losses, PCT, GB$0.01
Player StatisticsDetailed player stats - batting (AVG, HR, RBI, OPS) or pitching (ERA, WHIP, K)$0.02
Game BoxscoreComplete game boxscore with batting/pitching lines, play-by-play summary$0.02
League ScheduleFull MLB schedule for a date range with game times and broadcasts$0.01
Stat LeadersLeague leaders in batting average, home runs, RBI, ERA, strikeouts, saves$0.02
Fantasy ProjectionsPlayer fantasy projections for DraftKings/FanDuel with projected points$0.03
Betting OddsGame betting lines including moneyline, run line, totals from multiple sportsbooks$0.05

Demo mode is free -- no charges for sample data.


Troubleshooting

"API error 429" or "Rate limit"

Too many requests. Wait a minute and try again, or reduce the number of items per run.

No results or empty dataset

Check the run log for error messages. Common causes:

  • Invalid input format (check the examples above)
  • The target data doesn't exist or is too small to track

How do I test without an API key?

Enable Demo Mode in the input. This returns realistic sample data so you can verify the output format works for your workflow.


Built by John Rippy | Actor Arsenal