Skip to main content

MLB — additional Python functions — Fox

fox_mlb_event_matchup​

fox_mlb_event_matchup(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb pregame team-stat comparison (one row per stat).

Wraps mlb/event/{game_id}/matchup.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_event_matchup
df = fox_mlb_event_matchup("...")

fox_mlb_event_recap​

fox_mlb_event_recap(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb postgame top performers (one row per player).

Wraps mlb/event/{game_id}/recap.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_event_recap
df = fox_mlb_event_recap("...")

fox_mlb_event_standings​

fox_mlb_event_standings(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb the two teams' standings context.

Wraps mlb/event/{game_id}/standings.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_event_standings
df = fox_mlb_event_standings("...")

fox_mlb_league_conferences​

fox_mlb_league_conferences(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb conference / group directory.

Wraps mlb/league/conferences.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_league_conferences
df = fox_mlb_league_conferences()

fox_mlb_league_header​

fox_mlb_league_header(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb league header (one row).

Wraps mlb/league/header.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
templatecharacterFox layout template name for the header payload; always 'entity-header' in sampled data.
titlecharacterSpecific role title for the assignment.
entity_idcharacterFox id of the league entity as a string: the trailing number of the league's Fox contentUri.
content_uricharacterFox content URI of the league entity (e.g., 'baseball/mlb/league/1'); entity_id is its trailing number.
content_typecharacterFox entity type of the header payload; always 'league' for the league header.
colorcharacterPrimary color (hex, no leading '#').
logo_urlcharacterNBA CDN primary logo URL.
image_alt_textcharacterImage alt text Fox ships with the header, the full league name (e.g., 'Major League Baseball').
rankcharacterRank within the team leaderboard.
detailscharacterDetails.

Example

from sportsdataverse.mlb import fox_mlb_league_header
df = fox_mlb_league_header()

fox_mlb_league_leaders​

fox_mlb_league_leaders(category: 'str' = 'batting', who: 'str' = 'player', page: 'int' = 0, *, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

MLB statistical leaders (stats-con); who=player|team.

Parameters

ParameterTypeDefaultDescription
categorystr'batting'Stat category. Defaults to "batting".
whostr'player'"player" or "team". Defaults to "player".
pageint00-based result page. Defaults to 0.
return_parsedboolTrueIf True (default) flatten the leader tables to a DataFrame; if False return the raw JSON dict.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
playerscharacterNested list of per-player box scores.
v1characterAbbreviated player name (e.g., 'M. Olson'), from the leader table's unlabeled second column.
gcharacterGoals (skaters).
entity_idcharacterFox id of the row's linked player or team as a string: the trailing number of the row's entityLink contentUri.
pacharacterPlate appearances from the PA leader table, as a string (e.g., '687'); null on rows that come from another stat's leader table (G, AB, H).
abcharacterAt-bats.
hcharacterHits.

Example

from sportsdataverse.mlb import fox_mlb_league_leaders
df = fox_mlb_league_leaders("batting")

fox_mlb_league_odds​

fox_mlb_league_odds(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb league odds board (one row per team per game).

Wraps mlb/league/odds.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
sectioncharacterTitle of the odds-board section the game sits in; always 'GAMES' in sampled data.
game_idcharacterUnique ESPN game/event identifier.
event_timecharacterScheduled start time as an ISO 8601 UTC timestamp (e.g., '2026-09-17T16:35:00Z').
event_statusintegerFox numeric event status code; 2 for every sampled game, all scheduled to start after the sample was taken (Fox uses 3 for final).
teamcharacterTeam.
run_linecharacterTeam's run-line spread as a signed string ('-1.5' or '+1.5').
to_wincharacterTeam's moneyline in American odds, as a signed string (e.g., '-142', '+118').
totalcharacterTotal.

Example

from sportsdataverse.mlb import fox_mlb_league_odds
df = fox_mlb_league_odds()

fox_mlb_league_player_news​

fox_mlb_league_player_news(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb league-wide player news feed.

Wraps mlb/league/playernews.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
titlecharacterSpecific role title for the assignment.
subtitlecharacterPlayer's team abbreviation, jersey number and position formatted 'TEAM #NN - POS' (e.g., 'AZ #14 - C').
headlinecharacterNews headline.
descriptioncharacterLong-form description text.
impact_titlecharacterHeading label for the impact paragraph; always 'Impact' in sampled data.
impactcharacterFree-text analysis paragraph Fox shows under the item's impact_title heading.
datecharacterDate in YYYY-MM-DD format.
sourcecharacterSource.
athlete_idcharacterUnique ESPN athlete identifier.
content_uricharacterFox content URI of the player the item is about (e.g., 'baseball/mlb/athletes/11258'); athlete_id is its trailing number.
web_urlcharacterSite-relative foxsports.com path of the player's page (e.g., '/mlb/gabriel-moreno-player').

Example

from sportsdataverse.mlb import fox_mlb_league_player_news
df = fox_mlb_league_player_news()

fox_mlb_league_polls​

fox_mlb_league_polls(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb rankings / polls rendered as standings tables.

Wraps mlb/league/polls.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_league_polls
df = fox_mlb_league_polls()

fox_mlb_league_schedule​

fox_mlb_league_schedule(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb league schedule nav selections.

Wraps mlb/league/schedule.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
selection_listcharacterWhich Fox navigation list the row came from ('groupList', 'dailyList' or 'selectionList'); always 'dailyList' (one row per date) in sampled data.
idcharacterId.
titlecharacterSpecific role title for the assignment.
datecharacterDate in YYYY-MM-DD format.
uricharacterAbsolute Bifrost API URL of that date's schedule segment payload (e.g., 'https://api.foxsports.com/bifrost/v1/mlb/league/schedule-segment/2026-20260220').
web_urlcharacterSite-relative foxsports.com schedule page path for that date (e.g., '/mlb/schedule?date=2026-02-20').
selectedcharacterFox's default-selection flag, which Fox sets only on group-filter (groupList) items; this league's navigation payload has no groupList, so the column is null on every row. The current date or week is marked by the payload-level currentSelectionId, which the parser does not return.
group_idcharacterESPN group id.

Example

from sportsdataverse.mlb import fox_mlb_league_schedule
df = fox_mlb_league_schedule()

fox_mlb_league_scores​

fox_mlb_league_scores(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb league scores nav selections.

Wraps mlb/league/scores.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
selection_listcharacterWhich Fox navigation list the row came from ('groupList', 'dailyList' or 'selectionList'); always 'dailyList' (one row per date) in sampled data.
idcharacterId.
titlecharacterSpecific role title for the assignment.
datecharacterDate in YYYY-MM-DD format.
uricharacterAbsolute Bifrost API URL of that date's scores segment payload (e.g., 'https://api.foxsports.com/bifrost/v1/mlb/league/scores-segment/20260220').
web_urlcharacterSite-relative foxsports.com scores page path for that date (e.g., '/mlb/scores?date=2026-02-20').
selectedcharacterFox's default-selection flag, which Fox sets only on group-filter (groupList) items; this league's navigation payload has no groupList, so the column is null on every row. The current date or week is marked by the payload-level currentSelectionId, which the parser does not return.
group_idcharacterESPN group id.

Example

from sportsdataverse.mlb import fox_mlb_league_scores
df = fox_mlb_league_scores()

fox_mlb_league_standings​

fox_mlb_league_standings(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb league-wide standings tables.

Wraps mlb/league/standings.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
sectioncharacterTitle of the standings section the row's table sits in ('DIVISION', 'WILD CARD' or 'SPRING TRAINING'); each team appears once per section.
al_eastcharacterPosition number ('1'-'5') from the first column of Fox's AL EAST division table, whose header text names this column; null on rows from every other table.
v1characterTeam nickname (e.g., 'Rays'), from the standings table's unlabeled second column.
w_lcharacterW l.
pctcharacterWin percentage.
gbcharacterAverage exit velocity on ground balls (mph).
homecharacterHome.
awaycharacterAway team shots in the period.
rscharacterRuns scored (RS column), as a string (e.g., '688'); null on SPRING TRAINING rows, whose tables carry no RS column.
racharacterRuns allowed (RA column), as a string (e.g., '617'); null on SPRING TRAINING rows, whose tables carry no RA column.
diffcharacterScoring margin.
l10characterLast-ten record.
strkcharacterCurrent streak.
entity_idcharacterFox id of the row's linked team as a string: the trailing number of the row's entityLink contentUri.
al_centralcharacterPosition number ('1'-'5') from the first column of Fox's AL CENTRAL division table, whose header text names this column; null on rows from every other table.
al_westcharacterPosition number ('1'-'5') from the first column of Fox's AL WEST division table, whose header text names this column; null on rows from every other table.
nl_eastcharacterPosition number ('1'-'5') from the first column of Fox's NL EAST division table, whose header text names this column; null on rows from every other table.
nl_centralcharacterPosition number ('1'-'5') from the first column of Fox's NL CENTRAL division table, whose header text names this column; null on rows from every other table.
nl_westcharacterPosition number ('1'-'5') from the first column of Fox's NL WEST division table, whose header text names this column; null on rows from every other table.
division_leaderscharacterNumber string from the first column of Fox's DIVISION LEADERS tables (one per league, WILD CARD section); Fox does not label it, sampled values '1'-'4' repeat and do not follow row order. Null on rows from every other table.
wild_cardcharacterPosition number ('1'-'12') from the first column of Fox's WILD CARD tables (one per league, WILD CARD section), whose header text names this column; null on rows from every other table.
cactus_leaguecharacterPosition number ('1'-'15') from the first column of Fox's CACTUS LEAGUE spring-training table, not ordered by win percentage in sampled data; null on rows from every other table.
grapefruit_leaguecharacterPosition number ('1'-'15') from the first column of Fox's GRAPEFRUIT LEAGUE spring-training table, whose header text names this column; null on rows from every other table.

Example

from sportsdataverse.mlb import fox_mlb_league_standings
df = fox_mlb_league_standings()

fox_mlb_league_stat_leaders​

fox_mlb_league_stat_leaders(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb league stats landing leaders.

Wraps mlb/league/stats.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
categorycharacterCategory label.
statcharacterStat.
stat_abbreviationcharacterFox's short label for the leader's stat (e.g., 'HR', 'ERA', 'ISO').
playercharacterPlayer name.
valuecharacterNumeric value.

Example

from sportsdataverse.mlb import fox_mlb_league_stat_leaders
df = fox_mlb_league_stat_leaders()

fox_mlb_odds​

fox_mlb_odds(game_id: 'Union[int, str]', *, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

MLB game odds six-pack (run line / to-win / total per team).

Parameters

ParameterTypeDefaultDescription
game_idUnion[int, str]Fox Bifrost event id.
return_parsedboolTrueIf True (default) flatten the six-pack market to a DataFrame; if False return the raw JSON dict.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_odds
df = fox_mlb_odds("...")

fox_mlb_scoreboard​

fox_mlb_scoreboard(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb scoreboard nav selections (weeks / dates / groups).

Wraps mlb/scoreboard/main.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
selection_listcharacterWhich Fox navigation list the row came from ('groupList', 'dailyList' or 'selectionList'); always 'dailyList' (one row per date) in sampled data.
idcharacterId.
titlecharacterSpecific role title for the assignment.
datecharacterDate in YYYY-MM-DD format.
uricharacterAbsolute Bifrost API URL of that date's scoreboard segment payload (e.g., 'https://api.foxsports.com/bifrost/v1/mlb/scoreboard/segment/20260220').
web_urlcharacterSite-relative foxsports.com scoreboard page path for that date (e.g., '/scores/mlb?date=2026-02-20').
selectedcharacterFox's default-selection flag, which Fox sets only on group-filter (groupList) items; this league's navigation payload has no groupList, so the column is null on every row. The current date or week is marked by the payload-level currentSelectionId, which the parser does not return.
group_idcharacterESPN group id.

Example

from sportsdataverse.mlb import fox_mlb_scoreboard
df = fox_mlb_scoreboard()

fox_mlb_scorechip​

fox_mlb_scorechip(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb compact live score chip (raw dict -- live-only, uncaptured shape).

Wraps mlb/scorechip/{chip_id}.

Returns

The raw JSON dict.

Example

from sportsdataverse.mlb import fox_mlb_scorechip
df = fox_mlb_scorechip("nfl12345")

fox_mlb_scores_segment​

fox_mlb_scores_segment(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb one row per game in a scoreboard segment.

Wraps mlb/league/scores-segment/{segment_id}.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_scores_segment
df = fox_mlb_scores_segment("...")

fox_mlb_standings​

fox_mlb_standings(team_id: 'Union[int, str]', *, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

MLB standings for a team's division/league.

Parameters

ParameterTypeDefaultDescription
team_idUnion[int, str]Fox Bifrost team id.
return_parsedboolTrueIf True (default) flatten the standings tables to a DataFrame; if False return the raw JSON dict.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_standings
df = fox_mlb_standings("...")

fox_mlb_team_gamelog​

fox_mlb_team_gamelog(team_id: 'Union[int, str]', *, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

MLB team game log (long: one row per game-stat).

Parameters

ParameterTypeDefaultDescription
team_idUnion[int, str]Fox Bifrost team id.
return_parsedboolTrueIf True (default) flatten to long form; if False return the raw JSON dict.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_team_gamelog
df = fox_mlb_team_gamelog("...")

fox_mlb_team_header​

fox_mlb_team_header(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb team header (one row).

Wraps mlb/team/{team_id}/header.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_team_header
df = fox_mlb_team_header("...")

fox_mlb_team_roster​

fox_mlb_team_roster(team_id: 'Union[int, str]', *, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

MLB team roster (one row per player).

Parameters

ParameterTypeDefaultDescription
team_idUnion[int, str]Fox Bifrost team id.
return_parsedboolTrueIf True (default) flatten the position-group tables to a DataFrame; if False return the raw JSON dict.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_team_roster
df = fox_mlb_team_roster("...")

fox_mlb_team_stats​

fox_mlb_team_stats(team_id: 'Union[int, str]', *, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

MLB team stat leaders by category.

Parameters

ParameterTypeDefaultDescription
team_idUnion[int, str]Fox Bifrost team id.
return_parsedboolTrueIf True (default) flatten the leader sections to a DataFrame; if False return the raw JSON dict.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

Example

from sportsdataverse.mlb import fox_mlb_team_stats
df = fox_mlb_team_stats("...")

fox_mlb_teamnav​

fox_mlb_teamnav(*args: 'Any', **kwargs: 'Any') -> 'Any'

Fox Sports mlb team directory (one row per team).

Wraps mlb/league/teamnav.

Returns

A polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False.

col_nametypedescription
groupcharacterStat group (e.g. "hitting", "pitching", "fielding").
fox_idcharacterFox Sports team id as a string (e.g., '18'), the trailing number of content_uri.
abbreviationcharacterShort abbreviation.
namecharacterDisplay name.
content_uricharacterFox content URI of the team (e.g., 'baseball/mlb/teams/18'); fox_id is its trailing number.
content_typecharacterFox entity type of the nav item; always 'team' in sampled data.
web_urlcharacterSite-relative foxsports.com path of the team page (e.g., '/mlb/philadelphia-phillies-team').
colorcharacterPrimary color (hex, no leading '#').
logo_urlcharacterNBA CDN primary logo URL.

Example

from sportsdataverse.mlb import fox_mlb_teamnav
df = fox_mlb_teamnav()