MLB Stats API - schedule, scores, standings, player stats avatar

MLB Stats API - schedule, scores, standings, player stats

Pricing

from $5.00 / 1,000 records

Go to Apify Store
MLB Stats API - schedule, scores, standings, player stats

MLB Stats API - schedule, scores, standings, player stats

Read MLB's public Stats API (statsapi.mlb.com) and get flat rows: games with status, teams, scores and venue; division standings with W-L, pct, GB and streak; team rosters; season hitting or pitching stats per player. Default: schedule for today +/-3 days (standings if no games).

Pricing

from $5.00 / 1,000 records

Rating

0.0

(0)

Developer

RetrainMap Team

RetrainMap Team

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Categories

Share

MLB Stats API — schedule, scores, standings, player stats

Flat rows from MLB's public Stats API (statsapi.mlb.com, no key): every game in a date range with status, teams, scores, records and venue; regular-season standings with W-L, pct, games back, streak, run differential and home/away/last-ten splits; team rosters with position and jersey number; per-player season hitting or pitching stats. Normalised, one row per game / team / player, ready for CSV or JSON.

The default input (schedule, today ±3 days) succeeds within 5 minutes and returns rows — Apify auto-tests it daily. In the off-season, when that window has no games and no dates were given, the Actor writes the last completed season's standings instead and says so in the log, the status message and RUN_SUMMARY.details.fallback_mode.

Data source and status

PublisherMLB Advanced Media, L.P. (Major League Baseball)
APIhttps://statsapi.mlb.com/api/v1 — public, no key. MLB publishes no formal documentation; the endpoints used are the ones behind mlb.com and are documented by the community (e.g. https://github.com/toddrob99/MLB-StatsAPI/wiki)
What this Actor readsGET /schedule?sportId=1&startDate=&endDate=, GET /standings?leagueId=103,104&season=&standingsTypes=regularSeason&hydrate=division,league,team, GET /teams?sportId=1&season= + GET /teams/{id}/roster?season=&rosterType=, `GET /people/{id}/stats?stats=season&group=hitting
Refresh cadenceLive: scores and game status update during games (status = In Progress / Final …); standings carry last_updated; rosters change with transactions; season stats update after each game. The Actor reads live on every run; fetched_at on each row is the fetch time
Terms / attributionEvery API response carries MLB's notice: use of the content acknowledges agreement to the terms at http://gdx.mlb.com/components/copyright.txt (MLBAM copyright; personal, non-commercial use unless licensed). The notice is stored verbatim in RUN_SUMMARY.copyright. You are responsible for using the data within those terms
Known caveatsschedule returns all game types in the range (spring training, regular season, postseason, All-Star, exhibitions — see game_type_name); scores are absent until a game starts; a range may span at most 62 days. standings are regular-season only; games_back, magic_number, elimination_number are the API's strings (- when not applicable). team_roster needs numeric team ids (30 listed at https://statsapi.mlb.com/api/v1/teams?sportId=1); an unknown id fails the run with the valid list. player_stats: an unknown person id or a player without appearances answers an empty list — the Actor warns and writes no row; a traded player yields one row per team plus a season total row; rate stats (avg, era …) are the API's strings. Dates are UTC

Honesty note: sports data only, as published by MLB's API — nothing is inferred; for information, not for wagering; not affiliated with Major League Baseball.

Identification: the requests carry a product-token User-Agent and the operator's contact address in the standard From: header (RFC 9110 §10.1.2).

Input

FieldTypeMeaning
modeselectschedule (default), standings, team_roster, player_stats
date_from / date_toYYYY-MM-DDschedule only; both empty = today ±3 days (UTC); at most 62 days
seasonintegerYear for standings / roster / stats; empty = current year
team_idsarrayteam_roster only: e.g. 147 (Yankees), 119 (Dodgers)
roster_typeselectactive (default), 40Man, fullSeason, fullRoster
player_idsarrayplayer_stats only: e.g. 660271 (Ohtani), 592450 (Judge)
groupselecthitting (default) or pitching
max_recordsintegerDefault 500
request_interval_msintegerDefault 500 (floor 250)
contact_emailstringSent in the From: header

Example — 2026 hitting lines for Ohtani, Judge and Soto (3 requests):

{ "mode": "player_stats", "player_ids": ["660271", "592450", "665742"], "group": "hitting", "season": 2026 }

Output (dataset row)

Every row carries mode, mlb_url and fetched_at.

  • schedule: game_pk, date, game_datetime_utc, season, game_type, game_type_name, status, status_code, abstract_state, away_team_id, away_team, away_score, away_record, away_is_winner, home_team_id, home_team, home_score, home_record, home_is_winner, venue_id, venue, day_night, double_header, game_number, series_description, series_game_number, games_in_series, scheduled_innings, is_tie.
  • standings: season, league, division, division_short, team_id, team, team_abbrev, wins, losses, pct, games_played, games_back, wild_card_games_back, division_rank, league_rank, wild_card_rank, sport_rank, streak, runs_scored, runs_allowed, run_differential, home_record, away_record, last_ten, division_leader, clinched, magic_number, elimination_number, last_updated.
  • team_roster: season, roster_type, team_id, team, team_abbrev, player_id, player_name, jersey_number, position, position_code, position_abbrev, position_type, status, parent_team_id.
  • player_stats: player_id, player_name, season, group, game_type, team_id, team, league, then hitting (games_played, plate_appearances, at_bats, runs, hits, doubles, triples, home_runs, rbi, stolen_bases, walks, strikeouts, avg, obp, slg, ops) or pitching (games_played, games_started, wins, losses, saves, innings_pitched, era, whip, strikeouts, walks, hits_allowed, home_runs_allowed, earned_runs) columns, plus stats = the API's complete stat object.

A run summary (mode, filters, MLB's copyright notice, requests, off-season fallback, whether the pay-per-event budget stopped the run) is stored as RUN_SUMMARY in the run's key-value store.

Pricing (pay per event)

EventPrice
run-start — once per run$0.10
record — per row written$0.005

A full week of regular-season games (~100 rows) costs about $0.60; standings (30 rows) $0.25. Rows stop when your run's maximum charge is reached; the run summary says so.

Operator

Steelyard Ventures LLC (RetrainMap) — info@steelyardclinical.com. Not affiliated with Major League Baseball or MLB Advanced Media. The Actor writes only to its own dataset and key-value store; it stores no credentials and sends nothing else.