Skip to main content
Version: 0.2.0

College football — additional Python functions — Yahoo Sports Shangrila

yahoo_cfb_boxscore​

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

Yahoo CFB box score: player stats from the game lineups, one row per player stat.

Wraps the shangrila playbookBoxscore query. Each side's lineup lists the players Yahoo features, each with up to 12 headline stats (passing, rushing and receiving yards and touchdowns, receptions, tackles, sacks, field goals and extra points made); names come from the payload's footballStatTypes. Pivot on stat_type_id for a wide box.

Yahoo retired the editorial boxscore this used to wrap on 2026-11-20. Shangrila has no full box score: there are no team-stat rows, a lineup covers about a dozen players per side, and stat ids are shangrila names (PASSING_YARDS) rather than ncaaf.stat_type.<n>. Pass return_parsed=False for the raw payload, which also carries drives, play-by-play and the win-probability timeline.

Parameters

ParameterTypeDefaultDescription
game_idUnion[int, str]Dotted Yahoo game id (e.g. "ncaaf.g.202509200023").
return_parsedboolTrueIf True (default) decode the box score into 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 by default (pandas when return_as_pandas=True) with one row per player stat, every column Utf8, and zero rows (same columns) for an empty payload; the raw playbookBoxscore JSON dict when return_parsed=False.

col_nametypedescription
game_idStringDotted Yahoo game id ("ncaaf.g.").
team_idStringDotted Yahoo team id ("ncaaf.t.").
home_awayString"home" or "away".
player_idStringDotted Yahoo player id ("ncaaf.p.").
stat_categoryString"Passing", "Rushing", "Receiving", "Defense" or "Kicking".
stat_type_idStringShangrila stat id ("PASSING_YARDS").
stat_nameStringStat name ("Passing Yards").
stat_abbreviationStringShort stat label.
stat_variationStringStat scope of the row; always "Game" because the shangrila lineup carries single-game stats only.
valueStringStat value as Yahoo sends it ("188").

Raises

ExceptionDescription
NoDataErrorYahoo answered 404.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, or an empty or unreadable 200 body).

Example

from sportsdataverse.cfb import yahoo_cfb_boxscore
box = yahoo_cfb_boxscore("ncaaf.g.202509200023")

# Raw JSON (includes drives and play-by-play)

raw = yahoo_cfb_boxscore("ncaaf.g.202509200023", return_parsed=False)

# Wide player box (one line)

box.pivot("stat_type_id", index="player_id", values="value")

yahoo_cfb_player_season_stats​

yahoo_cfb_player_season_stats(season: 'int' = 2024, *, league_structure: 'str' = 'ncaaf.struct.div.1', count: 'int' = 200, qualified: 'bool' = False, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

Yahoo CFB player season stats (modern; one wide row per player).

Wraps the shangrila leagueStatsIndividual query, which returns every stat group (passing/rushing/receiving/...) in one call, pivoted wide with one column per statId. NCAAF data is available 2013-present.

Parameters

ParameterTypeDefaultDescription
seasonint2024Season year (2013-present). Defaults to 2024.
league_structurestr'ncaaf.struct.div.1'Yahoo league-structure id (division filter). Defaults to "ncaaf.struct.div.1" (FBS).
countint200Maximum number of players to request. Defaults to 200.
qualifiedboolFalseRestrict to qualified leaders only. Defaults to False.
return_parsedboolTrueIf True (default) flatten 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 wide polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False. Includes a self-describing season column.

col_nametypedescription
player_idStringESPN player id from the roster entry.
display_nameStringHuman-readable metric name.
teamStringTeam name.
team_abbreviationStringTeam abbreviation.
passing_completionsStringPass completions (split from CFBD's C/ATT field).
rushing_attempts_per_gameString
sacks_yards_lostString
solo_tacklesString
kickoff_return_touchdownsString
field_goals_30_to_39String
longest_puntString
passing_touchdownsString
field_goals_20_to_29String
kickoff_returnsString
field_goals_made_20_29String
games_rushingString
games_defenseString
forced_fumblesString
interception_return_yardsString
punt_return_touchdownsString
longest_field_goalString
sacks_takenString
receiving_yards_per_receptionString
receiving_yardsString
field_goals_made_30_39String
field_goals_made_50_plusString
games_offenseString
puntsString
field_goals_madeString
field_goals_50_plusString
all_purpose_yardsString
interception_return_touchdownsString
field_goal_percentageString
field_goals_made_0_19String
rushing_touchdownsString
punt_yards_per_puntString
field_goal_attempts_40_49String
sacksStringTeam sacks.
field_goals_made_40_49String
longest_rushString
games_returnsString
return_yards_per_kickoffString
rushing_yards_per_gameString
longest_receptionString
rushing_yardsStringTeam rushing yards.
games_kickingString
passing_yards_per_attemptString
rushing_yards_per_attemptString
completion_percentageString
total_tacklesString
games_puntingString
passing_yards_per_gameString
passes_defendedString
longest_passString
points_scored_kickingString
passing_yardsString
receiving_yards_per_gameString
rushing_attemptsStringTeam rushing attempts.
games_passingString
field_goal_attempts_50_plusString
targetsString
qb_ratingString
games_receivingString
longest_kickoff_returnString
safetiesString
tackle_assistsString
passing_attemptsStringPass attempts (split from CFBD's C/ATT field).
extra_point_attemptsString
interceptions_forcedString
extra_points_madeString
punt_yardsString
receptionsString
field_goal_attempts_30_39String
field_goals_40_to_49String
punt_return_yardsStringTeam punt return yards.
field_goal_attemptsString
longest_punt_returnString
field_goal_attempts_20_29String
field_goal_attempts_0_19String
kickoff_return_yardsString
punt_returnsStringNumber of punt returns.
sacks_yardsString
field_goals_0_to_19String
receiving_touchdownsString
extra_point_percentageString
tackles_for_lossStringTeam tackles for a loss.
passing_interceptionsString
return_yards_per_puntString
seasonInt64Season (4-digit year).

Raises

ExceptionDescription
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, or an empty or unreadable 200 body).

Example

from sportsdataverse.cfb import yahoo_cfb_player_season_stats
df = yahoo_cfb_player_season_stats(season=2024)

yahoo_cfb_player_season_stats_legacy​

yahoo_cfb_player_season_stats_legacy(season: 'int' = 2024, category: 'str' = 'Passing', sort_stat: 'str' = 'PASSING_YARDS', *, league_structure: 'str' = 'ncaaf.struct.div.1', count: 'int' = 200, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

Yahoo CFB legacy per-category player leaders (one wide row per player).

Wraps the legacy seasonStatsFootball{Category}Ncaaf query (one stat category per call), pivoted wide with one column per statId.

Parameters

ParameterTypeDefaultDescription
seasonint2024Season year (2013-present). Defaults to 2024.
categorystr'Passing'Stat category, one of {"Passing", "Rushing", "Receiving", "Defense", "Kicking", "Punting", "Returns"}. Defaults to "Passing".
sort_statstr'PASSING_YARDS'Required FootballStatId to sort by (see the catalog vocab). Defaults to "PASSING_YARDS".
league_structurestr'ncaaf.struct.div.1'Yahoo league-structure id (division filter). Defaults to "ncaaf.struct.div.1" (FBS).
countint200Maximum number of players to request. Defaults to 200.
return_parsedboolTrueIf True (default) flatten 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 wide polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False. Includes self-describing season and category columns.

col_nametypedescription
player_idStringESPN player id from the roster entry.
display_nameStringHuman-readable metric name.
teamStringTeam name.
team_abbreviationStringTeam abbreviation.
games_rushingString
rushing_attemptsStringTeam rushing attempts.
rushing_yardsStringTeam rushing yards.
rushing_yards_per_gameString
rushing_yards_per_attemptString
rushing_touchdownsString
longest_rushString
seasonInt64Season (4-digit year).
categoryStringCFBD stats category name (e.g. passing, rushing, defensive).

Raises

ExceptionDescription
ValueErrorcategory is not one of LEGACY_PLAYER_CATEGORIES.

Example

from sportsdataverse.cfb import yahoo_cfb_player_season_stats_legacy
df = yahoo_cfb_player_season_stats_legacy(
season=2024, category="Rushing", sort_stat="RUSHING_YARDS"
)

yahoo_cfb_scoreboard​

yahoo_cfb_scoreboard(season: 'int', week: 'int' = 1, *, count: 'int' = 500, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

Yahoo CFB scoreboard (one row per game).

Two shangrila calls: leagueGameIdsByDate lists the week's game ids (every division Yahoo carries, FBS through NAIA), then scoreboardGame fetches those games in one comma-joined batch. season is required -- there is no meaningful default for a weekly scoreboard. Postseason games carry on the week count (bowls and the CFP run to about week 21); a week with no games returns zero rows. Unscheduled postseason slots are listed too, as TBD @ TBD games whose team ids are both ncaaf.t.0.

Yahoo retired the editorial scoreboard this used to wrap on 2026-11-20. Shangrila has no counterpart for its global_gameid, and the columns are new: they are listed below.

Parameters

ParameterTypeDefaultDescription
seasonintSeason year (required).
weekint1Schedule week number. Defaults to 1.
countint500Ignored. Kept so existing calls still work; leagueGameIdsByDate returns the whole week.
return_parsedboolTrueIf True (default) flatten the games to a DataFrame; if False return {"data": {"games": [...]}}, the merged raw scoreboardGame entries (odds, records and venue included).
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default; pandas when return_as_pandas=True) with one row per game, and zero rows with the same columns for an empty week.

col_nametypedescription
game_idStringDotted Yahoo game id ("ncaaf.g.202508230021").
display_nameString"Away @ Home" label.
start_timeStringKickoff, ISO-8601 with the US Central offset; null while the time is TBA.
start_dateStringKickoff date with offset ("2025-08-23-05:00").
statusString"PREGAME", "FINAL", or an in-game status while live.
status_display_nameStringDisplay status ("Final").
seasonInt64Season year the game belongs to (the fall year, so a January bowl is the prior season).
season_phaseString"REGULAR_SEASON" or "POSTSEASON".
weekInt64Yahoo week number.
home_team_idStringDotted home team id ("ncaaf.t.").
home_teamStringHome team full name ("Kansas State Wildcats").
home_abbreviationStringHome team abbreviation.
home_scoreInt64Home points; null before kickoff.
away_team_idStringDotted away team id.
away_teamStringAway team full name.
away_abbreviationStringAway team abbreviation.
away_scoreInt64Away points; null before kickoff.
winning_team_idStringDotted id of the winner; null until final.
display_resultStringScore line ("24-21").
venueStringName of the stadium the game is played in, as Yahoo lists it.

Raises

ExceptionDescription
NoDataErrorYahoo answered 404.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, or an empty or unreadable 200 body).

Example

from sportsdataverse.cfb import yahoo_cfb_scoreboard
df = yahoo_cfb_scoreboard(season=2024, week=1)

yahoo_cfb_team_season_stats​

yahoo_cfb_team_season_stats(season: 'int' = 2024, *, league_structure: 'str' = 'ncaaf.struct.div.1', count: 'int' = 200, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

Yahoo CFB team season stats (modern; one wide row per team).

Wraps the shangrila leagueStatsByTeam query (all stat groups in one call, pivoted wide with one column per statId).

Parameters

ParameterTypeDefaultDescription
seasonint2024Season year (2013-present). Defaults to 2024.
league_structurestr'ncaaf.struct.div.1'Yahoo league-structure id (division filter). Defaults to "ncaaf.struct.div.1" (FBS).
countint200Maximum number of teams to request. Defaults to 200.
return_parsedboolTrueIf True (default) flatten 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 wide polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False. Includes a self-describing season column.

col_nametypedescription
teamStringTeam name.
team_abbreviationStringTeam abbreviation.
receiving_yards_rankString
passing_touchdownsString
rushing_attemptsStringTeam rushing attempts.
rushing_yards_allowed_per_attemptString
points_per_gameString
receiving_first_downs_allowedString
receiving_yards_allowed_per_gameString
passing_yards_per_gameString
total_offensive_yards_per_gameString
interceptions_forced_rankString
rushing_yards_allowed_per_gameString
total_offensive_yards_per_game_rankString
receiving_yardsString
points_per_game_rankString
rushing_yards_rankString
receiving_yards_allowedString
rushing_touchdownsString
points_allowed_per_game_rankString
third_down_attemptsString
sacks_takenString
total_yards_allowed_per_game_rankString
rushing_yards_per_attemptString
rushing_touchdowns_allowed_per_gameString
longest_passString
completion_percentageString
receptionsString
receiving_yards_per_receptionString
interceptions_forcedString
passing_completions_per_gameString
team_penaltiesString
rushing_first_downs_allowedString
receiving_yards_per_gameString
points_allowedStringPoints for the opponent.
points_allowed_rankString
total_yards_allowed_per_gameString
rushing_attempts_allowedStringOpponent rushing attempts.
games_kickingString
completion_percentage_allowedString
rushing_yards_allowed_per_game_rankString
receiving_touchdownsString
games_puntingString
total_offensive_yardsString
pointsStringTotal points accumulated by the school in the poll's weighted voting.
rushing_yards_per_game_rankString
passing_yards_per_attemptString
receptions_per_gameString
rushing_first_downsString
receiving_first_downsString
passing_first_downsString
points_rankString
passing_yards_allowed_per_gameString
fourth_down_conversionsString
receptions_allowedString
passing_attempts_per_gameString
passing_yardsString
rushing_touchdowns_allowedString
receiving_touchdowns_allowedString
receptions_allowed_per_gameString
rushing_yards_allowedStringOpponent rushing yards.
games_receivingString
sacks_rankString
points_allowed_per_gameString
rushing_yardsStringTeam rushing yards.
games_rushingString
longest_rushString
games_offenseString
fourth_down_conversion_percentageString
receiving_touchdowns_allowed_per_gameString
passing_attempts_allowed_per_gameString
passing_first_downs_allowedString
passing_completionsStringPass completions (split from CFBD's C/ATT field).
total_offensive_yards_rankString
time_of_possession_per_game_rankString
offensive_penalty_yards_lostString
team_penalty_yards_lostString
passing_yards_per_game_rankString
interception_return_touchdownsString
passing_yards_allowed_per_game_rankString
sacks_yards_lostString
games_defenseString
passing_yards_allowedString
passing_touchdowns_allowedString
games_passingString
passing_completions_allowed_per_gameString
passing_touchdowns_allowed_per_gameString
rushing_yards_per_gameString
fourth_down_attemptsString
passing_yards_rankString
rushing_attempts_per_gameString
third_down_conversion_percentageString
passing_attemptsStringPass attempts (split from CFBD's C/ATT field).
passing_interceptionsString
first_downsStringFirst downs earned by the team.
first_downs_per_gameString
rushing_attempts_allowed_per_gameString
third_down_conversionsString
time_of_possession_per_gameString
offensive_penaltiesString
seasonInt64Season (4-digit year).

Raises

ExceptionDescription
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, or an empty or unreadable 200 body).

Example

from sportsdataverse.cfb import yahoo_cfb_team_season_stats
df = yahoo_cfb_team_season_stats(season=2024)

yahoo_cfb_team_season_stats_legacy​

yahoo_cfb_team_season_stats_legacy(season: 'int' = 2024, category: 'str' = 'Passing', sort_stat: 'str' = 'PASSING_YARDS', *, league_structure: 'str' = 'ncaaf.struct.div.1', count: 'int' = 200, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> "Union[pl.DataFrame, 'pd.DataFrame', Dict[str, Any]]"

Yahoo CFB legacy per-category team stats (one wide row per team).

Wraps the legacy seasonTeamStatsFootball{Category} query (one stat category per call), pivoted wide with one column per statId.

Parameters

ParameterTypeDefaultDescription
seasonint2024Season year (2013-present). Defaults to 2024.
categorystr'Passing'Stat category, one of {"Passing", "Rushing", "Receiving", "Defense", "Kicking", "Punting", "Returns", "Kickoffs", "Offense"}. Defaults to "Passing".
sort_statstr'PASSING_YARDS'Required FootballStatId to sort by. Defaults to "PASSING_YARDS".
league_structurestr'ncaaf.struct.div.1'Yahoo league-structure id (division filter). Defaults to "ncaaf.struct.div.1" (FBS).
countint200Maximum number of teams to request. Defaults to 200.
return_parsedboolTrueIf True (default) flatten 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 wide polars DataFrame (default), a pandas DataFrame when return_as_pandas=True, or the raw JSON dict when return_parsed=False. Includes self-describing season and category columns.

col_nametypedescription
teamStringTeam name.
team_abbreviationStringTeam abbreviation.
games_rushingString
rushing_attemptsStringTeam rushing attempts.
rushing_yardsStringTeam rushing yards.
rushing_yards_per_attemptString
rushing_attempts_per_gameString
rushing_yards_per_gameString
rushing_touchdownsString
rushing_first_downsString
longest_rushString
rushing_fumblesString
rushing_fumbles_lostString
seasonInt64Season (4-digit year).
categoryStringCFBD stats category name (e.g. passing, rushing, defensive).

Raises

ExceptionDescription
ValueErrorcategory is not one of LEGACY_TEAM_CATEGORIES.

Example

from sportsdataverse.cfb import yahoo_cfb_team_season_stats_legacy
df = yahoo_cfb_team_season_stats_legacy(
season=2024, category="Rushing", sort_stat="RUSHING_YARDS"
)

yahoo_cfb_teams​

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

Yahoo CFB team directory (one row per team).

Wraps the shangrila leagueTeams query (league=ncaaf): every team Yahoo carries, about 540 across FBS, FCS, D2, D3, NAIA and USCAA, keyed by the dotted ncaaf.t.<n> id. It is the Yahoo side of sportsdataverse.cfb.cfb_teams_crosswalk.

Until 2026-11-20 this read the team map embedded in the editorial scoreboard (about 265 FBS + FCS teams). Yahoo retired that feed. Shangrila has no conference abbreviation and no SeatGeek id, so conference_abbreviation and seatgeek_id stay as all-null columns, and conference_id / division_id are shangrila's own ids (ACC is "1"), not the editorial ones.

Parameters

ParameterTypeDefaultDescription
seasonintSeason year. Sent to Yahoo, but leagueTeams answers with the current directory for any season (2004 and 2025 return the same ids).
weekint1Ignored. Kept so existing calls still work.
return_parsedboolTrueIf True (default) project the teams to a DataFrame; if False return the raw leagueTeams JSON dict.
return_as_pandasboolFalseIf True return a pandas DataFrame; otherwise polars. Ignored when return_parsed=False.

Returns

A polars DataFrame (default; pandas when return_as_pandas=True) with one row per team, every column Utf8.

col_nametypedescription
team_idStringDotted Yahoo team id ("ncaaf.t.1").
abbreviationStringTeam abbreviation ("CLEM").
display_nameStringShort name ("Clemson").
full_nameStringSchool and nickname ("Clemson Tigers").
locationStringSchool / place name.
nicknameStringTeam nickname ("Tigers").
conferenceStringConference name ("Atlantic Coast").
conference_abbreviationStringAlways null: shangrila carries none.
conference_idStringYahoo shangrila conference id as a string ("1" is the ACC); not the old editorial numbering.
divisionString"FBS", "FCS", "D2", "D3", "NAIA" or "USCAA".
division_idStringShangrila division id ("1" is FBS).
seatgeek_idStringAlways null: shangrila carries none.

Raises

ExceptionDescription
NoDataErrorYahoo answered 404.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, or an empty or unreadable 200 body).

Example

from sportsdataverse.cfb import yahoo_cfb_teams
teams = yahoo_cfb_teams(season=2024)
abbr = dict(zip(teams["team_id"], teams["abbreviation"]))