Skip to main content
Version: 0.0.70

MLB — ESPN site API (v2)

sportsdataverse.mlb — 24 endpoints.

espn_mlb_scoreboard

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard?dates=20240115

API ParameterPythonPatternRequiredNullableDescription
datesdatesYDate or date range filter (YYYYMMDD or YYYYMMDD-YYYYMMDD).
weekweekYWeek number within the season (football).
seasontypeseason_typeYSeason phase: 1=preseason, 2=regular season, 3=postseason.
groupsgroupsYConference or group id filter (e.g. an ESPN conference id).
limitlimitYMaximum number of items to return.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
game_idcharacterESPN event id.
uidcharacterESPN UID string.
datecharacterMatch start timestamp (ISO 8601, UTC).
namecharacterFull event name (e.g. 'Team A at Team B').
short_namecharacterAbbreviated event name (e.g. 'TA @ TB').
season_yearintegerSeason year string ('YYYY-YY' format).
season_typeintegerSeason-type id.
season_slugcharacterSeason slug.
status_type_idcharacterUnique identifier for status type.
status_type_namecharacterStatus type name.
status_type_statecharacterStatus state (pre/in/post).
status_type_completedlogicalWhether the game is complete.
status_type_descriptioncharacterStatus type description.
status_type_detailcharacterStatus type detail.
status_type_short_detailcharacterStatus type short detail.
status_clockdoubleGame clock in seconds.
status_display_clockcharacterStatus display clock.
status_periodintegerCurrent period.
neutral_sitelogicalWhether the match is played at a neutral venue.
conference_competitionlogicalConference competition.
attendanceintegerReported game attendance.
venue_idcharacterMLBAM venue ID.
venue_full_namecharacterVenue full name.
venue_citycharacterVenue city.
venue_statecharacterVenue state / province.
venue_indoorlogicalWhether the home venue is indoors.
broadcastcharacterBroadcast information string.
notecharacterGame note or headline.
home_idcharacterUnique identifier for home.
home_namecharacterHome team display name.
home_abbreviationcharacterHome team's abbreviation.
home_display_namecharacterHome team display name.
home_locationcharacterHome team's location.
home_colorcharacterHome team primary color hex.
home_alternate_colorcharacterColor code (hex) for home alternate.
home_logocharacterHome team logo URL.
home_scorecharacterHome team's score. For cricket, the innings string (e.g. '161/5 (18/20 ov, target 156)').
home_winnerlogicalWhether the home team won.
home_rankcharacterHome team rank (if ranked).
away_idcharacterUnique identifier for away.
away_namecharacterAway team display name.
away_abbreviationcharacterAway team's abbreviation.
away_display_namecharacterAway team display name.
away_locationcharacterAway team's location.
away_colorcharacterAway team primary color hex.
away_alternate_colorcharacterColor code (hex) for away alternate.
away_logocharacterAway team logo URL.
away_scorecharacterAway team's score. For cricket, the innings string.
away_winnerlogicalWhether the away team won.
away_rankcharacterAway team rank (if ranked).

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_scoreboard(dates='20240115')

Last validated n/a.

espn_mlb_summary

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/summary

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/summary

API ParameterPythonPatternRequiredNullableDescription
eventevent_idYevent query parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame. boxscore_player

col_nametypedescription
team_idcharacterTeam id.
team_abbreviationcharacterTeam abbreviation.
team_display_namecharacterTeam display name.
team_locationcharacterTeam location.
athlete_idcharacterAthlete id.
athlete_display_namecharacterAthlete display name.
athlete_short_namecharacterAthlete short name.
athlete_jerseycharacterAthlete jersey.
athlete_positioncharacterAthlete position.
starterlogicalStarter.
activelogicalActive.
did_not_playcharacterDid not play.
ejectedcharacterEjected.
reasoncharacterReason.
hits_at_batscharacterHitting performance ratio expressed as hits divided by at-bats for the player in the box score.
at_batscharacterAt bats.
runscharacterRuns scored.
hitscharacterHits.
rb_ischaracterRuns batted in and other secondary hitting statistics for the player in the box score.
home_runscharacterHome runs.
walkscharacterNumber of base-on-balls (walks) recorded by the player in the box score.
strikeoutscharacterNumber of strikeouts recorded by the player, either as a batter or pitcher, in the box score.
pitchescharacterTotal number of pitches thrown or faced by the player in the box score.
avgcharacterBatting average.
on_base_pctcharacterPercentage of plate appearances in which the player reached base safely in the game.
slug_avgcharacterSlugging average reflecting the total bases per at-bat recorded by the player in the box score.
full_innings.part_inningscharacterInnings pitched expressed as full innings and fractional partial innings for the pitcher in the box score.
earned_runscharacterEarned runs allowed.
pitches_strikescharacterCombined count of pitches thrown and strikes recorded for the pitcher in the box score.
eracharacterEarned run average.

boxscore_team

col_nametypedescription
team_idcharacterTeam id.
team_abbreviationcharacterTeam abbreviation.
team_display_namecharacterTeam display name.
home_awaycharacterHome away.
display_orderintegerDisplay order.
stat_namecharacterStat name.
stat_labelcharacterStat label.
stat_display_valuecharacterStat display value.
stat_valuecharacterStat value.

plays

col_nametypedescription
idcharacterId.
sequence_numbercharacterSequence number.
textcharacterText.
away_scoreintegerAway score.
home_scoreintegerHome score.
scoring_playlogicalScoring play.
score_valueintegerScore value.
wallclockcharacterWallclock.
at_bat_idcharacterIdentifier of the at-bat the play belongs to.
summary_typecharacterPlay summary type.
outsintegerOuts in the inning after the play.
type_idcharacterType id.
type_textcharacterType text.
type_typecharacterPlay type category.
period_typecharacterPeriod type ('inning').
period_numberintegerPeriod number.
period_display_valuecharacterPeriod display value.
team_idcharacterTeam id.
pitch_count_ballsintegerBalls in the count when the pitch was thrown.
pitch_count_strikesintegerStrikes in the count when the pitch was thrown.
result_count_ballsintegerBalls in the count after the pitch.
result_count_strikesintegerStrikes in the count after the pitch.
participantscharacterParticipants.
bat_orderdoubleSpot in the batting order (1-9; NA if not applicable).
type_alternative_textcharacterAlternative play type text.
bats_typecharacterBats type.
bats_abbreviationcharacterBats abbreviation.
bats_display_valuecharacterBats display value.
at_bat_pitch_numberdoublePitch number within the at-bat.
pitch_velocitydoublePitch velocity (mph).
trajectorycharacterBatted-ball trajectory.
type_abbreviationcharacterPlay type abbreviation.
pitch_coordinate_xdoublePitch location x-coordinate.
pitch_coordinate_ydoublePitch location y-coordinate.
pitch_type_idcharacterPitch type identifier.
pitch_type_textcharacterPitch type description (e.g. 'Four-seam FB').
pitch_type_abbreviationcharacterPitch type abbreviation.
hit_coordinate_xdoubleBatted-ball location x-coordinate.
hit_coordinate_ydoubleBatted-ball location y-coordinate.
alternative_playcharacterAlternative play flag.
alternative_type_idcharacterAlternative play type id.
alternative_type_textcharacterAlternative play type text.
alternative_type_abbreviationcharacterAlternative play type abbreviation.
alternative_type_alternative_textcharacterAlternative type alternative text.
alternative_type_typecharacterAlternative play type category.
on_first_athlete_idcharacterAthlete id of the runner on first base.
on_second_athlete_idcharacterAthlete id of the runner on second base.
on_third_athlete_idcharacterAthlete id of the runner on third base.

winprobability

col_nametypedescription
home_win_percentagedoubleHome win percentage.
tie_percentagedoubleTie percentage.
play_idcharacterPlay id.

game_info

col_nametypedescription
attendanceintegerAttendance.
venue_idcharacterVenue id.
venue_full_namecharacterVenue full name.
venue_short_namecharacterVenue short name.
venue_address_citycharacterVenue address city.
venue_address_statecharacterVenue address state.
venue_address_zip_codecharacterPostal zip code of the venue where the game was played.

officials

col_nametypedescription
display_namecharacterDisplay name.
orderintegerOrder.
position_namecharacterPosition name.
position_display_namecharacterPosition display name.
position_idcharacterPosition id.

header

col_nametypedescription
idcharacterId.
uidcharacterUid.
time_validlogicalTime valid.
competitionscharacterCompetitions.
linkscharacterLinks.
game_notecharacterOptional editorial note or context annotation attached to the game in the header.
season_yearintegerSeason year.
season_currentlogicalSeason current.
season_typeintegerSeason type.
league_idcharacterLeague id.
league_uidcharacterLeague uid.
league_namecharacterLeague name.
league_abbreviationcharacterLeague abbreviation.
league_midsize_namecharacterMedium-length display name for the league or competition as shown in the game header.
league_slugcharacterLeague slug.
league_is_tournamentlogicalLeague is tournament.
league_linkscharacterLeague links.
league_logoscharacterLeague logos.

season_series

col_nametypedescription
typecharacterType.
titlecharacterTitle.
descriptioncharacterDescription.
summarycharacterSummary.
completedlogicalCompleted.
total_competitionsintegerTotal competitions.
series_scorecharacterSeries score.
eventscharacterEvents.
series_labelcharacterSeries label.
short_summarycharacterShort summary.
roundcharacterDraft round number.

standings

col_nametypedescription
group_headercharacterGroup header.
conference_headercharacterConference header.
division_headercharacterDivision header.
team_idcharacterTeam id.
team_uidcharacterTeam uid.
team_locationcharacterTeam location.
games_behindcharacterGames behind.
lossescharacterLosses.
streakcharacterStreak.
win_percentcharacterWin percent.
winscharacterWins.

broadcasts

col_nametypedescription
stationcharacterStation full name (e.g. "FanDuel Sports Network Detroit").
station_keycharacterMachine-readable key identifying the broadcasting station airing the game.
langcharacterBroadcast language (e.g. "en").
regioncharacterRegion label.
is_nationallogicalBoolean flag indicating whether the broadcast is a nationally distributed feed.
type_idcharacterType id.
type_short_namecharacterBroadcast type short name (e.g. "TV").
type_long_namecharacterBroadcast type long name (e.g. "Television").
type_slugcharacterBroadcast-type slug (e.g. streaming, tv).
market_idcharacterESPN futures-market identifier.
market_typecharacterMarket type code (winLeague, winConference, winDivision, ...).
media_call_letterscharacterBroadcast call letters for the outlet.
media_namecharacterESPN media name for the outlet.
media_short_namecharacterShort ESPN media name for the outlet.

format

col_nametypedescription
regulation_periodsintegerRegulation periods.
regulation_display_namecharacterRegulation display name.
regulation_slugcharacterRegulation slug.

article

col_nametypedescription
idintegerId.
now_idcharacterNow id.
content_keycharacterContent key.
data_source_identifiercharacterData source identifier.
publishedkeycharacterPublishedkey.
typecharacterType.
game_idcharacterGame id.
headlinecharacterHeadline.
descriptioncharacterDescription.
link_textcharacterLink text.
categorizedcharacterCategorized.
originally_postedcharacterOriginally posted.
last_modifiedcharacterLast modified.
publishedcharacterPublished.
sectioncharacterSection.
sourcecharacterSource.
imagescharacterImages.
videocharacterVideo.
categoriescharacterCategories.
keywordscharacterKeywords.
storycharacterStory.
premiumlogicalPremium.
is_live_bloglogicalIs live blog.
allow_commentslogicalAllow comments.
allow_searchlogicalAllow search.
allow_content_reactionslogicalAllow content reactions.
links_web_hrefcharacterLinks web href.
links_mobile_hrefcharacterLinks mobile href.
links_api_self_hrefcharacterLinks api self href.
links_app_sportscenter_hrefcharacterLinks app sportscenter href.

injuries

col_nametypedescription
injuriescharacterInjuries.
team_idcharacterTeam id.
team_uidcharacterTeam uid.
team_display_namecharacterTeam display name.
team_abbreviationcharacterTeam abbreviation.
team_linkscharacterTeam links.
team_logocharacterTeam logo.
team_logoscharacterTeam logos.

news

col_nametypedescription
idintegerId.
now_idcharacterNow id.
content_keycharacterContent key.
data_source_identifiercharacterData source identifier.
typecharacterType.
headlinecharacterHeadline.
descriptioncharacterDescription.
last_modifiedcharacterLast modified.
publishedcharacterPublished.
imagescharacterImages.
categoriescharacterCategories.
premiumlogicalPremium.
links_web_hrefcharacterLinks web href.
links_mobile_hrefcharacterLinks mobile href.
links_api_self_hrefcharacterLinks api self href.
links_app_sportscenter_hrefcharacterLinks app sportscenter href.
links_web_self_hrefcharacterURL for the canonical web page of the associated article or editorial content.
links_web_self_dsi_hrefcharacterData-source-identified URL for the web page of the associated article content.
links_api_artwork_hrefcharacterAPI endpoint URL for artwork or imagery associated with the article.
links_sportscenter_hrefcharacterURL for the article's page on ESPN's SportsCenter platform.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_summary()

Last validated n/a.

espn_mlb_calendar

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/calendar

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/calendar

API ParameterPythonPatternRequiredNullableDescription

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_calendar()

Last validated n/a.

espn_mlb_news

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/news

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/news

API ParameterPythonPatternRequiredNullableDescription
limitlimitYMaximum number of items to return.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idintegerESPN numeric identifier for the article.
now_idcharacterESPN 'now' feed id.
content_keycharacterInternal content key.
data_source_identifiercharacterSource-system identifier.
typecharacterArticle type (Story, Media, HeadlineNews, etc.).
headlinecharacterArticle headline.
descriptioncharacterArticle summary/description.
last_modifiedcharacterLast-modified timestamp (ISO 8601).
publishedcharacterPublish timestamp (ISO 8601).
imagescharacterArticle images (list, stringified).
categoriescharacterArticle categories (list, stringified).
premiumlogicalWhether the article is premium/paywalled.
links_web_hrefcharacterWeb article URL.
links_mobile_hrefcharacterMobile article URL.
links_api_self_hrefcharacterESPN API canonical self-link for the article resource.
links_app_sportscenter_hrefcharacterSportsCenter app deep link.
links_web_self_hrefcharacterPrimary canonical web URL for this news article on ESPN.com.
links_web_self_dsi_hrefcharacterAlternate canonical web URL for this news article using ESPN's DSI routing.
links_api_artwork_hrefcharacterESPN API URL for the artwork image associated with this news article.
links_sportscenter_hrefcharacterDeep-link URL to this news article within the ESPN SportsCenter app or web experience.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_news()

Last validated n/a.

espn_mlb_injuries

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/injuries

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/injuries

API ParameterPythonPatternRequiredNullableDescription

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idcharacterESPN numeric identifier for the athlete.
display_namecharacterAthlete's full display name as shown on ESPN.
injuriescharacterInjury entries for the athlete (list of dicts, stringified): status, type, details, dates.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_injuries()

Last validated n/a.

espn_mlb_transactions

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/transactions

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/transactions

API ParameterPythonPatternRequiredNullableDescription

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_transactions()

Last validated n/a.

espn_mlb_conferences

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/groups

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/groups

API ParameterPythonPatternRequiredNullableDescription

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_groups); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_conferences()

Last validated n/a.

espn_mlb_statistics_league

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/statistics

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/statistics

API ParameterPythonPatternRequiredNullableDescription

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_statistics_league()

Last validated n/a.

espn_mlb_draft

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/draft

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/draft

API ParameterPythonPatternRequiredNullableDescription

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_draft()

Last validated n/a.

espn_mlb_teams_site

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams

API ParameterPythonPatternRequiredNullableDescription
limitlimitYMaximum number of items to return.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
team_abbreviationcharacterShort team abbreviation (e.g. "BOS").
team_alternate_colorcharacterSecondary team color as a hex string (no leading '#').
team_colorcharacterPrimary team color as a hex string (no leading '#').
team_display_namecharacterFull team display name (location + nickname).
team_idcharacterESPN team id (stable join key across ESPN endpoints).
team_is_activelogicalWhether the team is currently active.
team_is_all_starlogicalWhether the entry is an all-star squad rather than a franchise.
team_locationcharacterTeam location / city (e.g. "Boston").
team_logoscharacterPipe-delimited logo image URLs.
team_namecharacterTeam nickname/mascot (e.g. "Celtics").
team_nicknamecharacterTeam nickname as ESPN labels it (often equals team_name).
team_short_display_namecharacterAbbreviated display name for compact UIs.
team_slugcharacterURL slug used in ESPN web paths.
team_uidcharacterESPN global UID (encodes sport/league/team).

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_teams_site()

Last validated n/a.

espn_mlb_team

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_single_entity); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team(team_id='4')

Last validated n/a.

espn_mlb_team_roster

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/roster

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/roster

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
position_groupcharacterPosition group of the recruits (e.g. Offensive Line, Defensive Back).
idcharacterId.
uidcharacterUid.
guidcharacterGuid.
first_namecharacterFirst name.
last_namecharacterLast name.
full_namecharacterFull name.
display_namecharacterDisplay name.
nicknamecharacterTeam nickname.
short_namecharacterShort name.
weightdoubleWeight.
display_weightcharacterDisplay weight.
heightdoubleHeight.
display_heightcharacterDisplay height.
ageintegerAge.
date_of_birthcharacterDate of birth.
debut_yearintegerDebut year.
linkscharacterLinks.
slugcharacterSlug.
jerseycharacterJersey.
positionscharacterPositions.
injuriescharacterInjuries.
teamscharacterTeams.
contractscharacterContracts.
alternate_ids_sdrcharacterAlternate ids sdr.
birth_place_citycharacterBirth place city.
birth_place_statecharacterBirth place state.
birth_place_countrycharacterBirth place country.
birth_place_display_textcharacterBirth place display text.
college_idcharacterCollege id.
college_guidcharacterCollege guid.
college_mascotcharacterCollege mascot.
college_namecharacterCollege name.
college_short_namecharacterCollege short name.
college_abbrevcharacterCollege abbrev.
college_logoscharacterCollege logos.
headshot_hrefcharacterHeadshot href.
headshot_altcharacterHeadshot alt.
position_idcharacterPosition id.
position_namecharacterPosition name.
position_display_namecharacterPosition display name.
position_abbreviationcharacterPosition abbreviation.
position_leaflogicalPosition leaf.
position_parent_idcharacterESPN id of the parent position; position_detail = TRUE only.
position_parent_namecharacterParent position name.
position_parent_display_namecharacterParent position display name.
position_parent_abbreviationcharacterParent position abbreviation.
position_parent_leaflogicalWhether parent position is leaf.
experience_yearsintegerExperience years.
status_idcharacterStatus id.
status_namecharacterStatus name.
status_typecharacterStatus type.
status_abbreviationcharacterStatus abbreviation.
bats_typecharacterBats type.
bats_abbreviationcharacterBats abbreviation.
bats_display_valuecharacterBats display value.
throws_typecharacterThrows type.
throws_abbreviationcharacterThrows abbreviation.
throws_display_valuecharacterThrows display value.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_roster(team_id='4')

Last validated n/a.

espn_mlb_team_schedule

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/schedule

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/schedule

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.
seasonseasonYSeason year (e.g. 2024).

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idcharacterESPN numeric event identifier.
datecharacterEvent timestamp (ISO 8601, UTC).
namecharacterFull event name (e.g. 'Team A at Team B').
short_namecharacterAbbreviated event name (e.g. 'TA @ TB').
time_validlogicalWhether the event time is confirmed.
competitionscharacterCompetition detail (list of dicts, stringified): competitors, venue, status.
linkscharacterRelated links (list, stringified).
season_yearintegerFour-digit season year.
season_display_namecharacterHuman-readable season label (e.g. '2024-25').
season_type_idcharacterESPN numeric identifier for the season type.
season_type_typeintegerSeason type numeric code.
season_type_namecharacterSeason type name (e.g. Regular Season).
season_type_abbreviationcharacterSeason type abbreviation.
week_numberdoubleWeek number.
week_textcharacterHuman-readable label for the week or scheduling block in which the event falls (e.g., 'Week 3', 'Bowl Week'), as returned by the ESPN schedule API.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_schedule(team_id='4')

Last validated n/a.

espn_mlb_team_record

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/record

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/record

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_record(team_id='4')

Last validated n/a.

espn_mlb_team_depthcharts

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/depthcharts

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/depthcharts

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_depthcharts(team_id='4')

Last validated n/a.

espn_mlb_team_injuries

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/injuries

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/injuries

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idcharacterESPN numeric identifier for the athlete.
display_namecharacterAthlete's full display name as shown on ESPN.
injuriescharacterInjury entries for the athlete (list of dicts, stringified): status, type, details, dates.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_injuries(team_id='4')

Last validated n/a.

espn_mlb_team_transactions

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/transactions

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/transactions

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_transactions(team_id='4')

Last validated n/a.

espn_mlb_team_history

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/history

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/history

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_history(team_id='4')

Last validated n/a.

espn_mlb_team_news

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/news

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/news

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.
limitlimitYMaximum number of items to return.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idintegerESPN numeric identifier for the article.
now_idcharacterESPN 'now' feed id.
content_keycharacterInternal content key.
data_source_identifiercharacterSource-system identifier.
typecharacterArticle type (Story, Media, HeadlineNews, etc.).
headlinecharacterArticle headline.
descriptioncharacterArticle summary/description.
last_modifiedcharacterLast-modified timestamp (ISO 8601).
publishedcharacterPublish timestamp (ISO 8601).
imagescharacterArticle images (list, stringified).
categoriescharacterArticle categories (list, stringified).
premiumlogicalWhether the article is premium/paywalled.
links_web_hrefcharacterWeb article URL.
links_mobile_hrefcharacterMobile article URL.
links_api_self_hrefcharacterESPN API canonical self-link for the article resource.
links_app_sportscenter_hrefcharacterSportsCenter app deep link.
links_web_self_hrefcharacterPrimary canonical web URL for this news article on ESPN.com.
links_web_self_dsi_hrefcharacterAlternate canonical web URL for this news article using ESPN's DSI routing.
links_api_artwork_hrefcharacterESPN API URL for the artwork image associated with this news article.
links_sportscenter_hrefcharacterDeep-link URL to this news article within the ESPN SportsCenter app or web experience.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_news(team_id='4')

Last validated n/a.

espn_mlb_team_leaders

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/{team_id}/leaders

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/4/leaders

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_items); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_team_leaders(team_id='4')

Last validated n/a.

espn_mlb_player_info

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/athletes/{athlete_id}

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/athletes/4239

API ParameterPythonPatternRequiredNullableDescription
athlete_idathlete_idYathlete_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_single_entity); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_player_info(athlete_id='4239')

Last validated n/a.

espn_mlb_player_bio

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/athletes/{athlete_id}/bio

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/athletes/4239/bio

API ParameterPythonPatternRequiredNullableDescription
athlete_idathlete_idYathlete_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_single_entity); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_player_bio(athlete_id='4239')

Last validated n/a.

espn_mlb_player_news

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/athletes/{athlete_id}/news

Valid URL: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/athletes/4239/news

API ParameterPythonPatternRequiredNullableDescription
athlete_idathlete_idYathlete_id path parameter.

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idintegerESPN numeric identifier for the article.
now_idcharacterESPN 'now' feed id.
content_keycharacterInternal content key.
data_source_identifiercharacterSource-system identifier.
typecharacterArticle type (Story, Media, HeadlineNews, etc.).
headlinecharacterArticle headline.
descriptioncharacterArticle summary/description.
last_modifiedcharacterLast-modified timestamp (ISO 8601).
publishedcharacterPublish timestamp (ISO 8601).
imagescharacterArticle images (list, stringified).
categoriescharacterArticle categories (list, stringified).
premiumlogicalWhether the article is premium/paywalled.
links_web_hrefcharacterWeb article URL.
links_mobile_hrefcharacterMobile article URL.
links_api_self_hrefcharacterESPN API canonical self-link for the article resource.
links_app_sportscenter_hrefcharacterSportsCenter app deep link.
links_web_self_hrefcharacterPrimary canonical web URL for this news article on ESPN.com.
links_web_self_dsi_hrefcharacterAlternate canonical web URL for this news article using ESPN's DSI routing.
links_api_artwork_hrefcharacterESPN API URL for the artwork image associated with this news article.
links_sportscenter_hrefcharacterDeep-link URL to this news article within the ESPN SportsCenter app or web experience.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_player_news(athlete_id='4239')

Last validated n/a.

espn_mlb_standings

ESPN endpoint.

Endpoint URL: GET https://site.api.espn.com/apis/v2/sports/baseball/mlb/standings

Valid URL: https://site.api.espn.com/apis/v2/sports/baseball/mlb/standings

API ParameterPythonPatternRequiredNullableDescription
seasonseasonYSeason year (e.g. 2024).
groupgroupYConference or group id filter (e.g. an ESPN conference id).
typestandings_typeYStandings variant (e.g. 'by-division' or 'by-conference').

Returns

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
group_namecharacterGroup name.
group_abbreviationcharacterGroup abbreviation.
team_idcharacterTeam id.
team_namecharacterTeam name.
team_abbreviationcharacterTeam abbreviation.
team_display_namecharacterTeam display name.
team_locationcharacterTeam location.
team_logocharacterTeam logo.
ot_lossesdoubleOvertime losses.
ot_winsdoubleOvertime wins.
avg_points_againstdoubleAvg points against.
avg_points_fordoubleAvg points for.
clincherdoubleClincher.
differentialdoubleDifferential.
division_win_percentdoubleDivision win percent.
games_behinddoubleGames behind.
games_playeddoubleMatches played.
league_win_percentdoubleLeague win percent.
lossesdoubleLosses.
playoff_seeddoublePlayoff seed.
point_differentialdoublePoint differential.
pointsdoublePoints.
points_againstdoublePoints against.
points_fordoublePoints for.
streakdoubleStreak.
tiesdoubleNumber of matches the team has drawn.
win_percentdoubleWin percent.
winsdoubleWins.
division_games_behinddoubleNumber of games the team trails the division leader in the standings, expressed as a decimal (e.g., 0.5 for half a game back).
division_percentdoubleThe team's winning percentage in division games, calculated as division wins divided by total division games played.
division_tieddoubleNumber of games the team has tied against opponents within their own division.
home_lossesdoubleHome team's losses.
home_tiesdoubleTotal home ties.
home_winsdoubleHome team's wins.
magic_number_divisiondoubleCombination of wins needed by the team (or losses needed by the division leader) for the team to clinch a division title.
magic_number_wildcarddoubleCombination of wins needed by the team (or losses needed by the next wildcard team) for the team to clinch a wildcard playoff berth.
playoff_percentdoubleEstimated or model-derived probability that the team will qualify for the playoffs, expressed as a decimal between 0 and 1.
road_lossesdoubleRoad losses.
road_tiesdoubleTies on the road.
road_winsdoubleRoad wins.
wild_card_percentdoubleThe team's winning percentage in games that count toward wildcard standings positioning.
overallcharacterOverall.
homecharacterHome.
roadcharacterRoad.
intradivisioncharacterIntradivision.
intraleaguecharacterIntraleague.
last ten gamescharacterLast ten games.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example

espn_mlb_standings()

Last validated n/a.