Skip to main content

MBB — additional Python functions — Fox

fox_mbb_boxscore​

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

MBB boxscore (long: one row per player-stat).

Parameters

ParameterTypeDefaultDescription
game_idUnion[int, str]Fox Bifrost event id.
return_parsedboolTrueIf True (default) flatten the per-team stat tables 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.mbb import fox_mbb_boxscore
df = fox_mbb_boxscore("...")

fox_mbb_event_matchup​

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

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

Wraps cbk/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.mbb import fox_mbb_event_matchup
df = fox_mbb_event_matchup("...")

fox_mbb_event_recap​

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

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

Wraps cbk/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.mbb import fox_mbb_event_recap
df = fox_mbb_event_recap("...")

fox_mbb_event_standings​

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

Fox Sports cbk the two teams' standings context.

Wraps cbk/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.mbb import fox_mbb_event_standings
df = fox_mbb_event_standings("...")

fox_mbb_league_conferences​

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

Fox Sports cbk conference / group directory.

Wraps cbk/league/conferences.

Returns

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

col_nametypedescription
groupcharacterGroup identifier (e.g. conference 'group_id').
fox_idcharacterFox Sports conference id as a string, the trailing number of content_uri; ids are assigned per feed and usually differ between the men's and women's feeds (ACC 11 vs 12), though some coincide (America East is 9 in both), so never join the two feeds on it.
abbreviationcharacterShort abbreviation.
namecharacterDisplay name.
content_uricharacterFox Bifrost content URI identifying the conference (e.g. 'basketball/cbk/groups/11'); fox_id is its trailing number.
content_typecharacterFox entity type from the conference's entity link; always 'league' in sampled data, even though each row is a conference.
web_urlcharacterSite-relative foxsports.com path of the conference page (e.g. '/college-basketball/acc').
colorcharacterPrimary color (hex without leading '#').
logo_urlcharacterNBA CDN primary logo URL.

Example

from sportsdataverse.mbb import fox_mbb_league_conferences
df = fox_mbb_league_conferences()

fox_mbb_league_header​

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

Fox Sports cbk league header (one row).

Wraps cbk/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 block; always 'entity-header' in sampled data.
titlecharacterTitle or label for the record.
entity_idcharacterFox id of the league entity as a string: the trailing number of the league's Fox contentUri.
content_uricharacterFox Bifrost content URI of the league entity ('basketball/cbk/league/1' in sampled data).
content_typecharacterFox entity type of the header's entity; 'league' in sampled data.
colorcharacterPrimary color (hex without leading '#').
logo_urlcharacterNBA CDN primary logo URL.
image_alt_textcharacterAlt text Fox attaches to the header image, which reads as the league's display name ('College Basketball' in sampled data).
rankcharacterRank.
detailscharacterDetails.

Example

from sportsdataverse.mbb import fox_mbb_league_header
df = fox_mbb_league_header()

fox_mbb_league_leaders​

fox_mbb_league_leaders(category: 'str' = 'scoring', 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]]"

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

Parameters

ParameterTypeDefaultDescription
categorystr'scoring'Stat category. Defaults to "scoring".
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.
v1characterLeader's name as Fox abbreviates it, first initial plus surname (e.g. 'T. Moore'); the column is named v1 because its table header cell is blank.
gpcharacterGames played.
entity_idcharacterFox id of the row's linked player or team as a string: the trailing number of the row's entityLink contentUri.
gscharacterGames started.
mpgcharacterMinutes per game.
ppgcharacterPoints per game.
ptscharacterPoints scored.

Example

from sportsdataverse.mbb import fox_mbb_league_leaders
df = fox_mbb_league_leaders("scoring")

fox_mbb_league_odds​

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

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

Wraps cbk/league/odds.

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.mbb import fox_mbb_league_odds
df = fox_mbb_league_odds()

fox_mbb_league_player_news​

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

Fox Sports cbk league-wide player news feed.

Wraps cbk/league/playernews.

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.mbb import fox_mbb_league_player_news
df = fox_mbb_league_player_news()

fox_mbb_league_polls​

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

Fox Sports cbk rankings / polls rendered as standings tables.

Wraps cbk/league/polls.

Returns

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

col_nametypedescription
sectioncharacterRanking the row belongs to: 'ASSOCIATED PRESS', 'USA TODAY COACHES POLL' or 'RPI RANKINGS' (25 rows each in sampled data).
rankingcharacterTeam recruiting ranking.
v1characterUnlabeled second table column whose meaning depends on section: in the two polls it is Fox's rank-change cell, an unsigned number string (e.g. '5') that is null when no change is shown; on 'RPI RANKINGS' rows it holds the team name.
v2characterTeam name on poll rows, with first-place votes in parentheses when the team received any (e.g. 'Michigan (57)'); null on 'RPI RANKINGS' rows, where the name is in v1.
ptscharacterPoints scored.
entity_idcharacterFox id of the row's linked team as a string: the trailing number of the row's entityLink contentUri.
rpicharacterRPI value as a decimal string with a leading dot (e.g. '.6808'); populated only on 'RPI RANKINGS' rows and null on both poll sections.
soscharacterStrength of schedule.
homecharacterHome.
awaycharacterAway record.
neutralcharacterNeutral.

Example

from sportsdataverse.mbb import fox_mbb_league_polls
df = fox_mbb_league_polls()

fox_mbb_league_schedule​

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

Fox Sports cbk league schedule nav selections.

Wraps cbk/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' (group filters such as FEATURED, TOP 25 and each conference; uri is null) or 'dailyList' (one row per game date).
idcharacterId.
titlecharacterTitle or label for the record.
datecharacterDate in YYYY-MM-DD format.
uricharacterAbsolute api.foxsports.com Bifrost URL of that date's segment payload (.../league/schedule-segment/-YYYYMMDD?groupId=...); null on groupList rows.
web_urlcharacterSite-relative foxsports.com path of the page the selection opens (e.g. '/college-basketball/schedule?groupId=top25').
selectedlogicalFox's default-selection flag: True on the one group filter (a groupList row) Fox pre-selects, and null (never False) on every other row.
group_idcharacterESPN group id.

Example

from sportsdataverse.mbb import fox_mbb_league_schedule
df = fox_mbb_league_schedule()

fox_mbb_league_scores​

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

Fox Sports cbk league scores nav selections.

Wraps cbk/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' (group filters such as FEATURED, TOP 25 and each conference; uri is null) or 'dailyList' (one row per game date).
idcharacterId.
titlecharacterTitle or label for the record.
datecharacterDate in YYYY-MM-DD format.
uricharacterAbsolute api.foxsports.com Bifrost URL of that date's segment payload (.../league/scores-segment/YYYYMMDD?groupId=...); null on groupList rows.
web_urlcharacterSite-relative foxsports.com path of the page the selection opens (e.g. '/college-basketball/scores?groupId=top25').
selectedlogicalFox's default-selection flag: True on the one group filter (a groupList row) Fox pre-selects, and null (never False) on every other row.
group_idcharacterESPN group id.

Example

from sportsdataverse.mbb import fox_mbb_league_scores
df = fox_mbb_league_scores()

fox_mbb_league_standings​

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

Fox Sports cbk league-wide standings tables.

Wraps cbk/league/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.mbb import fox_mbb_league_standings
df = fox_mbb_league_standings()

fox_mbb_league_stat_leaders​

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

Fox Sports cbk league stats landing leaders.

Wraps cbk/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 code for the leader stat, such as 'PPG', 'RPG', '3FGM/G', 'TS%' or 'HIGH'; the spelled-out name is in stat.
playercharacterPlayer name.
valuecharacterNumeric or string value field.

Example

from sportsdataverse.mbb import fox_mbb_league_stat_leaders
df = fox_mbb_league_stat_leaders()

fox_mbb_odds​

fox_mbb_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]]"

MBB game odds six-pack (spread / 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.mbb import fox_mbb_odds
df = fox_mbb_odds("...")

fox_mbb_pbp​

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

MBB play-by-play (one row per play; period-based).

Parameters

ParameterTypeDefaultDescription
game_idUnion[int, str]Fox Bifrost event id.
return_parsedboolTrueIf True (default) flatten the pbp layout 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.mbb import fox_mbb_pbp
df = fox_mbb_pbp("...")

fox_mbb_scoreboard​

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

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

Wraps cbk/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' (group filters such as FEATURED, TOP 25 and each conference; uri is null) or 'dailyList' (one row per game date).
idcharacterId.
titlecharacterTitle or label for the record.
datecharacterDate in YYYY-MM-DD format.
uricharacterAbsolute api.foxsports.com Bifrost URL of that date's segment payload (.../scoreboard/segment/YYYYMMDD?groupId=...); null on groupList rows.
web_urlcharacterSite-relative foxsports.com path of the page the selection opens (e.g. '/scores/college-basketball?groupId=top25').
selectedlogicalFox's default-selection flag: True on the one group filter (a groupList row) Fox pre-selects, and null (never False) on every other row.
group_idcharacterESPN group id.

Example

from sportsdataverse.mbb import fox_mbb_scoreboard
df = fox_mbb_scoreboard()

fox_mbb_scorechip​

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

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

Wraps cbk/scorechip/{chip_id}.

Returns

The raw JSON dict.

Example

from sportsdataverse.mbb import fox_mbb_scorechip
df = fox_mbb_scorechip("nfl12345")

fox_mbb_scores_segment​

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

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

Wraps cbk/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.mbb import fox_mbb_scores_segment
df = fox_mbb_scores_segment("...")

fox_mbb_standings​

fox_mbb_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]]"

MBB standings for a team's conference/division.

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.mbb import fox_mbb_standings
df = fox_mbb_standings("...")

fox_mbb_team_gamelog​

fox_mbb_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]]"

MBB 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.mbb import fox_mbb_team_gamelog
df = fox_mbb_team_gamelog("...")

fox_mbb_team_header​

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

Fox Sports cbk team header (one row).

Wraps cbk/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.mbb import fox_mbb_team_header
df = fox_mbb_team_header("...")

fox_mbb_team_roster​

fox_mbb_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]]"

MBB 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.mbb import fox_mbb_team_roster
df = fox_mbb_team_roster("...")

fox_mbb_team_stats​

fox_mbb_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]]"

MBB 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.mbb import fox_mbb_team_stats
df = fox_mbb_team_stats("...")

fox_mbb_teamnav​

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

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

Wraps cbk/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
groupcharacterGroup identifier (e.g. conference 'group_id').
fox_idcharacterFox Sports team id as a string, the trailing number of content_uri; ids are league-specific, so a school can have different ids in the men's and women's feeds.
abbreviationcharacterShort abbreviation.
namecharacterDisplay name.
content_uricharacterFox Bifrost content URI identifying the team, shaped 'basketball/cbk/teams/<fox_id>'.
content_typecharacterFox entity type from the team's entity link; always 'team' in sampled data.
web_urlcharacterSite-relative foxsports.com path of the team page (e.g. '/college-basketball/michigan-wolverines-team').
colorcharacterPrimary color (hex without leading '#').
logo_urlcharacterNBA CDN primary logo URL.

Example

from sportsdataverse.mbb import fox_mbb_teamnav
df = fox_mbb_teamnav()

fox_mbb_teams​

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

MBB team directory for one seed team's conference.

College basketball standings are per-conference, so one call returns only the seed team's league. Use fox_mbb_teams_all for the full directory the hoopR MBB team crosswalk consumes.

Parameters

ParameterTypeDefaultDescription
team_idUnion[int, str]'150'Seed Fox Bifrost team id whose standings page is read. Defaults to "150".
return_parsedboolTrueIf True (default) flatten the standings to the team directory; 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
fox_team_idcharacterFox Bifrost team id (NA if unmatched).
fox_team_namecharacterFox team name (NA if unmatched).
fox_sectioncharacterFox conference/section label (NA if unmatched).

Example

from sportsdataverse.mbb import fox_mbb_teams
df = fox_mbb_teams("150")

fox_mbb_teams_all​

fox_mbb_teams_all(max_id: 'int' = 500, max_calls: 'int' = 60, *, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame']"

Full MBB team directory by walking seed ids across conferences.

A single fox_mbb_teams call only returns the seed team's conference, so this walks candidate team ids (skipping ids already seen in an earlier conference) and unions the results, spending at most max_calls standings fetches. Mirrors fox_wbb_teams_all.

Parameters

ParameterTypeDefaultDescription
max_idint500Highest candidate team id to try. Defaults to 500.
max_callsint60Budget of standings fetches. Defaults to 60.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars.

Returns

A polars DataFrame (default) or pandas DataFrame, one row per team: fox_team_id / fox_team_name / fox_section.

col_nametypedescription
fox_team_idcharacterFox Bifrost team id (NA if unmatched).
fox_team_namecharacterFox team name (NA if unmatched).
fox_sectioncharacterFox conference/section label (NA if unmatched).

Example

from sportsdataverse.mbb import fox_mbb_teams_all
df = fox_mbb_teams_all()

# Pipeline next step (one line)

df.group_by("fox_section").len().sort("len", descending=True).head()