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

1

Bookmarked

121

Total users

0

Monthly active users

5 days ago

Last modified

Security

Limited permissions

Share

MLB Stats API

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

Note: Demo Mode is off by default, so runs fetch real data. Set demoMode to true to get free sample data instead.


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)
demoModebooleanfalseNoReturn 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:

EventWhen it is chargedPrice
Actor startOnce when the run starts, one event per GB of memory (minimum one). At the default 4 GB of memory a run starts at $0.40$0.10 per GB
ResultEach item written to the default dataset$0.00001

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