Skip to main content

NFL — additional Python functions — ESPN

espn_nfl_calendar​

espn_nfl_calendar(season=None, ondays=None, return_as_pandas=False, **kwargs) -> 'pl.DataFrame'

espn_nfl_calendar - look up the NFL calendar for a given season

Parameters

ParameterTypeDefaultDescription
seasonintNoneUsed to define different seasons. 2002 is the earliest available season.
ondaysbooleanNoneUsed to return dates for calendar ondays
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

One row per calendar week of the requested season (week, week_label, week_start_date, season_type, ...); season is the season argument as passed (null when omitted). With ondays=True it is a different frame: one row per date with games (dates, dateURL, url).

col_nametypedescription
week_labelStringWeek label as ESPN's calendar names it, e.g. Week 1.
week_alternate_labelStringAlternate week label ESPN ships next to week_label; usually the same text.
week_detailStringDate span of the week as display text.
weekStringSeason week.
week_start_dateStringStart of the week window, an ISO 8601 UTC timestamp string.
week_end_dateStringEnd of the week window, an ISO 8601 UTC timestamp string (the last minute before the next week).
season_type_labelStringName of the season segment the week belongs to, e.g. Regular Season.
season_typeStringREG or POST indicating if the timeframe belongs to regular or post season.
season_type_start_dateStringStart of that season segment, an ISO 8601 UTC timestamp string.
season_type_end_dateStringEnd of that season segment, an ISO 8601 UTC timestamp string.
seasonInt64The season argument as passed (null when the call omits it); ondays=True returns a different frame (dates, dateURL, url).

Raises

ExceptionDescription
ValueErrorIf season is less than 2002.

Example

from sportsdataverse.nfl import espn_nfl_calendar
cal = espn_nfl_calendar(season=2024)

# Fetch the ondays-style flattened schedule URLs

on_days = espn_nfl_calendar(season=2024, ondays=True)

# Pandas round-trip

cal_pd = espn_nfl_calendar(season=2024, return_as_pandas=True)

espn_nfl_game_rosters​

espn_nfl_game_rosters(game_id: 'int', raw=False, return_as_pandas=False, **kwargs) -> 'pl.DataFrame | pd.DataFrame | dict'

espn_nfl_game_rosters() - Pull the game by id.

Parameters

ParameterTypeDefaultDescription
game_idintUnique game_id, can be obtained from espn_nfl_schedule().
rawboolFalseIf True, returns the Core v2 competitors payload (dict) as ESPN sent it; its roster, team and athlete $ref links are not followed.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe of game roster data with columns: 'athlete_id', 'athlete_uid', 'athlete_guid', 'athlete_type', 'first_name', 'last_name', 'full_name', 'athlete_display_name', 'short_name', 'weight', 'display_weight', 'height', 'display_height', 'age', 'date_of_birth', 'slug', 'jersey', 'linked', 'active', 'alternate_ids_sdr', 'birth_place_city', 'birth_place_state', 'birth_place_country', 'headshot_href', 'headshot_alt', 'experience_years', 'experience_display_value', 'experience_abbreviation', 'status_id', 'status_name', 'status_type', 'status_abbreviation', 'hand_type', 'hand_abbreviation', 'hand_display_value', 'draft_display_text', 'draft_round', 'draft_year', 'draft_selection', 'player_id', 'starter', 'valid', 'did_not_play', 'display_name', 'ejected', 'athlete_href', 'position_href', 'statistics_href', 'team_id', 'team_guid', 'team_uid', 'team_slug', 'team_location', 'team_name', 'team_nickname', 'team_abbreviation', 'team_display_name', 'team_short_display_name', 'team_color', 'team_alternate_color', 'is_active', 'is_all_star', 'team_alternate_ids_sdr', 'logo_href', 'logo_dark_href', 'game_id' plus the athlete's position_id, position_name, position_display_name, position_abbreviation and position_leaf (a leaf position also position_parent_href). With raw=True, the competitors payload (dict).

col_nametypedescription
athlete_idInt64
athlete_uidString
athlete_guidString
athlete_typeString
first_nameStringFirst name of player
last_nameStringLast name of player
full_nameStringFull name as per NFL.com
athlete_display_nameString
short_nameStringPlayer short name (i.e. "F.Last")
weightFloat64Official weight, in pounds
display_weightString
heightFloat64Official height, in inches
display_heightString
ageInt64Age as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
date_of_birthString
debut_yearInt64
slugString
jerseyString
linkedBoolean
activeBoolean
alternate_ids_sdrString
birth_place_cityString
birth_place_stateString
birth_place_countryString
headshot_hrefStringLink to ESPN Headshot of Player
headshot_altString
projections_hrefStringESPN API hyperlink reference URL for the player's statistical projection resource.
contracts_hrefStringESPN API hyperlink reference URL for the full list of the player's historical contract records.
experience_yearsInt64
college_athlete_hrefStringESPN API hyperlink reference URL for the athlete's college profile resource.
contract_hrefStringESPN API hyperlink reference URL for the player's full contract resource.
contract_option_typeInt64
contract_salaryInt64
contract_bonusInt64Signing or roster bonus amount (in dollars) associated with the player's current contract.
contract_years_remainingInt64
contract_signed_throughInt64Final year of the player's current contract, expressed as a four-digit season year.
contract_season_hrefStringESPN API hyperlink reference URL for the specific season-level contract detail resource.
contract_team_hrefStringESPN API hyperlink reference URL for the team associated with the player's contract.
contract_activeBoolean
status_idInt64
status_nameString
status_typeString
status_abbreviationString
position_idInt64ESPN's numeric identifier of the athlete's listed position (the Core v2 position resource id).
position_nameStringName of the athlete's listed position from ESPN's position resource, e.g. Guard or Offensive Lineman.
position_display_nameStringDisplay form of the athlete's listed position as ESPN renders it; usually equal to position_name.
position_abbreviationStringShort code of the athlete's listed position (e.g. G, F, RW, OL), from ESPN's position resource.
position_leafBooleanWhether the position is a leaf of ESPN's position tree; False marks a grouping, not a specific role.
position_parent_hrefStringESPN API URL of the broader position group above a leaf position; null for a grouping position.
contract_salary_remainingInt64
draft_display_textString
draft_roundInt64Round that player was drafted in
draft_yearInt64Year that player was drafted
draft_selectionInt64
draft_team_hrefStringESPN API hyperlink reference URL for the team that originally drafted this player.
draft_pick_hrefStringESPN API hyperlink reference URL for the draft-pick record associated with this player.
hand_typeString
hand_abbreviationString
hand_display_valueString
starterBoolean
jersey_rightStringSecondary or alternate jersey number display string used by ESPN (e.g., for special-game uniforms).
validBoolean
did_not_playBoolean
display_nameStringFull name of player
athlete_hrefStringESPN API hyperlink reference URL for the athlete resource.
position_hrefStringESPN API hyperlink reference URL for the player's positional classification resource.
statistics_hrefStringESPN API hyperlink reference URL for the player's career statistics resource.
team_idInt64
orderInt64
home_awayString
winnerBoolean
team_guidString
team_uidString
team_slugString
team_locationString
team_nameString
team_nicknameString
team_abbreviationString
team_display_nameString
team_short_display_nameString
team_colorString
team_alternate_colorString
is_activeBooleanActive contract
is_all_starBoolean
team_alternate_ids_sdrStringSportsDataverse SDR alternate identifier for the team, used for cross-source joins.
logo_hrefString
logo_dark_hrefString
game_idInt64Ten digit identifier for NFL game.

Raises

ExceptionDescription
NoDataErrorESPN has no competitors, roster or athlete resource for the game (404), or every rostered athlete's $ref answered 404. A single 404 athlete is left out with a UserWarning and the rest of the roster is returned.
AssetFetchErrorA fetch failed (403, 429, 5xx, a dropped connection); never treated as a missing athlete.

Example

from sportsdataverse.nfl import espn_nfl_game_rosters
rosters = espn_nfl_game_rosters(game_id=401220403)
rosters.shape

# Pandas round-trip with home/away split

rosters_pd = espn_nfl_game_rosters(game_id=401220403, return_as_pandas=True)
home = rosters_pd[rosters_pd["home_away"] == "home"]
away = rosters_pd[rosters_pd["home_away"] == "away"]

espn_nfl_play_participants​

espn_nfl_play_participants(game_id: 'int', *, raw: 'bool' = False, return_as_pandas: 'bool' = False, resolve_missing: 'bool' = True, resolve_missing_max: 'int' = 50, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame | dict[str, Any]'

Pull ESPN per-play participants for an NFL game.

One row per play keyed by play_id with {type}_player_name / {type}_player_id scalars (first occurrence) and {type}_player_names / {type}_player_ids lists for every participant type ESPN ships (passer, rusher, receiver, tackler, sacked_by, forced_by, pass_defender, kicker, punter, returner, recoverer, scorer, pat_scorer, penalized, assisted_by). NFLPlayProcess runs it on the live path to overwrite the text-extracted names and ids.

Parameters

ParameterTypeDefaultDescription
game_idintESPN game / event identifier.
rawboolFalseIf True, returns the raw list of play-items dicts.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; otherwise polars.
resolve_missingboolTrueFetch athletes the sidecar omits from their $ref.
resolve_missing_maxint50Cap on those per-athlete requests (default 50).

Returns

Polars (or pandas) DataFrame, one row per play with at least one participant (a play whose participants[] is empty has no row); the raw play dicts when raw=True.

col_nametypedescription
game_idInt64Ten digit identifier for NFL game.
play_idInt64Numeric play id that when used with game_id and drive provides the unique identifier for a single play.
kicker_player_nameStringString name for the kicker on FG or kickoff.
returner_player_nameString
assisted_by_player_nameString
other_player_nameString
passer_player_nameStringString name for the player that attempted the pass.
receiver_player_nameStringString name for the targeted receiver.
rusher_player_nameStringString name for the player that attempted the run.
tackler_player_nameString
pass_defender_player_nameString
scorer_player_nameString
pat_scorer_player_nameString
penalized_player_nameString
punter_player_nameStringString name for the punter.
fumbler_player_nameString
forced_by_player_nameString
recoverer_player_nameString
sacked_by_player_nameString
snapper_player_nameString
holder_player_nameString
kicker_player_idStringUnique identifier for the kicker on FG or kickoff.
returner_player_idString
assisted_by_player_idString
other_player_idString
passer_player_idStringUnique identifier for the player that attempted the pass.
receiver_player_idStringUnique identifier for the receiver that was targeted on the pass.
rusher_player_idStringUnique identifier for the player that attempted the run.
tackler_player_idString
pass_defender_player_idString
scorer_player_idString
pat_scorer_player_idString
penalized_player_idString
punter_player_idStringUnique identifier for the punter.
fumbler_player_idString
forced_by_player_idString
recoverer_player_idString
sacked_by_player_idString
snapper_player_idString
holder_player_idString
kicker_position_idString
returner_position_idString
assisted_by_position_idString
other_position_idString
passer_position_idString
receiver_position_idString
rusher_position_idString
tackler_position_idString
pass_defender_position_idString
scorer_position_idString
pat_scorer_position_idString
penalized_position_idString
punter_position_idString
fumbler_position_idString
forced_by_position_idString
recoverer_position_idString
sacked_by_position_idString
snapper_position_idString
holder_position_idString
kicker_player_namesList
returner_player_namesList
assisted_by_player_namesList
other_player_namesList
passer_player_namesList
receiver_player_namesList
rusher_player_namesList
tackler_player_namesList
pass_defender_player_namesList
scorer_player_namesList
pat_scorer_player_namesList
penalized_player_namesList
punter_player_namesList
fumbler_player_namesList
forced_by_player_namesList
recoverer_player_namesList
sacked_by_player_namesList
snapper_player_namesList
holder_player_namesList
kicker_player_idsList
returner_player_idsList
assisted_by_player_idsList
other_player_idsList
passer_player_idsList
receiver_player_idsList
rusher_player_idsList
tackler_player_idsList
pass_defender_player_idsList
scorer_player_idsList
pat_scorer_player_idsList
penalized_player_idsList
punter_player_idsList
fumbler_player_idsList
forced_by_player_idsList
recoverer_player_idsList
sacked_by_player_idsList
snapper_player_idsList
holder_player_idsList

Example

from sportsdataverse.nfl import espn_nfl_play_participants
participants = espn_nfl_play_participants(game_id=401872922)
print(participants.select("play_id", "passer_player_name", "passer_player_id").head())

espn_nfl_player_stats​

espn_nfl_player_stats(athlete_id: 'int', season: 'int', *, season_type: 'str' = 'regular', total: 'bool' = False, raw: 'bool' = False, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame | dict[str, Any]'

Pull an NFL athlete's ESPN season stat line as one wide row.

See sportsdataverse.wbb.espn_wbb_player_stats for full documentation of the wide return shape, the {category}_{stat} stat columns (for football: passing_*, rushing_*, receiving_*, scoring_*, ...), the athlete / team metadata blocks, and the season_type / total parameters. For the richer multi-category web-v3 payload use sportsdataverse.nfl.espn_nfl_player_stats_v3.

Parameters

ParameterTypeDefaultDescription
athlete_idintESPN NFL athlete identifier (e.g. 3139477 for Patrick Mahomes).
seasonintSeason year, used in the core-v2 path.
season_typestr'regular'"regular" (type 2) or "postseason" (type 3).
totalboolFalseForward-compat totals passthrough.
rawboolFalseIf True, returns the raw core-v2 statistics JSON dict.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; else polars.

Returns

A single-row wide DataFrame (polars by default). When raw=True returns the raw statistics JSON dict.

col_nametypedescription
seasonInt644 digit number indicating to which season(s) the specified timeframe belongs to.
season_typeStringREG or POST indicating if the timeframe belongs to regular or post season.
totalBooleanThe sum of each team's score in the game. Equals h_score + v_score. Is NA for games which haven't yet been played. Convenient for evaluating over/under total bets.
athlete_idInt64
athlete_uidString
athlete_guidString
athlete_typeString
first_nameStringFirst name of player
last_nameStringLast name of player
full_nameStringFull name as per NFL.com
display_nameStringFull name of player
short_nameStringPlayer short name (i.e. "F.Last")
weightFloat64Official weight, in pounds
display_weightString
heightFloat64Official height, in inches
display_heightString
ageInt64Age as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
date_of_birthString
jerseyString
slugString
activeBoolean
position_idInt64
position_nameString
position_display_nameString
position_abbreviationString
college_nameStringOfficial college (usually the last one attended)
status_idInt64
status_nameString
general_fumblesFloat64Total number of times the player fumbled the ball regardless of who recovered it.
general_fumbles_lostFloat64Number of fumbles by the player that were subsequently recovered by the opposing team.
general_fumbles_forcedFloat64Number of fumbles the player forced from opposing ball carriers.
general_fumbles_forced_primaryFloat64Number of fumbles forced where the player was credited as the primary forcer rather than an assist.
general_fumbles_recoveredFloat64Number of fumbles (own or opponent's) recovered by the player.
general_fumbles_recovered_yardsFloat64Total yards gained on fumble recoveries returned by the player.
general_fumbles_touchdownsFloat64Number of touchdowns scored by the player on fumble recoveries.
general_games_playedFloat64
general_offensive_two_pt_returnsFloat64Number of two-point conversion attempts the player's offense returned defensively for a score.
general_offensive_fumbles_touchdownsFloat64Number of touchdowns scored by recovering an offensive team fumble (e.g., a fumble recovered in the end zone).
general_defensive_fumbles_touchdownsFloat64Number of touchdowns scored by recovering or returning an opponent's fumble on the defensive side.
passing_avg_gainFloat64Average yards gained per passing attempt including sacks.
passing_completion_pctFloat64Percentage of pass attempts that resulted in a completed reception (completions divided by attempts).
passing_completionsFloat64
passing_espnqb_ratingFloat64ESPN's proprietary composite quarterback rating blending efficiency, usage, and situational performance into a single metric.
passing_interception_pctFloat64Percentage of pass attempts that resulted in an interception (interceptions divided by attempts).
passing_interceptionsFloat64Total number of passes thrown that were intercepted by the opposing defense.
passing_long_passingFloat64Longest completed pass in yards recorded by the player during the period.
passing_net_passing_yardsFloat64Passing yards minus yards lost on sacks, giving a net aerial production figure.
passing_net_passing_yards_per_gameFloat64Net passing yards (after sack yardage deduction) per game played.
passing_net_total_yardsFloat64Combined net rushing and net passing yards accumulated by the player.
passing_net_yards_per_gameFloat64Net total offensive yards (rushing plus net passing) per game.
passing_passing_attemptsFloat64Total number of pass attempts thrown by the player.
passing_passing_big_playsFloat64Number of passing plays that gained 20 or more yards.
passing_passing_first_downsFloat64Number of pass completions that resulted in a first down.
passing_passing_fumblesFloat64Number of times the player fumbled while in the act of passing or being sacked.
passing_passing_fumbles_lostFloat64Number of passing-related fumbles that were recovered by the opposing team.
passing_passing_touchdown_pctFloat64Percentage of pass attempts that resulted in a touchdown (touchdowns divided by attempts).
passing_passing_touchdownsFloat64Total number of touchdown passes thrown by the player.
passing_passing_yardsFloat64Total aerial yards gained on completions thrown by the player.
passing_passing_yards_after_catchFloat64Total yards gained by receivers after catching the ball on passes thrown by the player.
passing_passing_yards_at_catchFloat64Total yards gained through the air (prior to the catch) on completions thrown by the player.
passing_passing_yards_per_gameFloat64Gross passing yards per game played by the quarterback.
passing_qb_ratingFloat64Traditional NFL passer rating computed from completion percentage, yards per attempt, touchdown percentage, and interception percentage on a roughly 0–158.3 scale.
passing_sacksFloat64Total number of times the player was sacked behind the line of scrimmage while attempting to pass.
passing_sack_yards_lostFloat64Total yards lost by the player as a result of being sacked behind the line of scrimmage.
passing_net_passing_attemptsFloat64Total pass attempts minus sacks taken, representing meaningful dropbacks.
passing_team_games_playedFloat64Number of games played by the player's team during which the player accumulated passing statistics.
passing_total_offensive_playsFloat64Total number of offensive plays (pass attempts, rushes, and sacks) run with the player as the primary ball handler.
passing_total_points_per_gameFloat64Average total points scored by the player's team per game.
passing_total_touchdownsFloat64Total touchdowns (passing, rushing, and receiving) scored by or credited to the player.
passing_total_yardsFloat64Combined total of passing, rushing, and receiving yards accumulated by the player.
passing_total_yards_from_scrimmageFloat64Total yards from scrimmage (rushing plus receiving) credited to the player in addition to passing yards.
passing_two_point_pass_convsFloat64Number of successful two-point conversion attempts thrown by the player.
passing_two_pt_passFloat64Number of two-point conversion passes the player successfully completed.
passing_two_pt_pass_attemptsFloat64Number of two-point conversion pass attempts thrown by the player regardless of outcome.
passing_yards_from_scrimmage_per_gameFloat64Yards from scrimmage (rushing plus receiving) per game for a player who also has passing statistics recorded.
passing_yards_per_completionFloat64Average yards gained per completed pass attempt.
passing_yards_per_gameFloat64Gross passing yards per game (equivalent to passing_passing_yards_per_game; alternate label).
passing_yards_per_pass_attemptFloat64Gross passing yards divided by total pass attempts, not penalizing for sacks.
passing_net_yards_per_pass_attemptFloat64Net passing yards divided by total pass attempts including sacks, penalizing passers for yardage lost in the pocket.
passing_qbrFloat64
passing_adj_qbrFloat64ESPN's Adjusted Total Quarterback Rating, which adjusts raw QBR for opponent strength and clutch situations on a 0–100 scale.
passing_quarterback_ratingFloat64Alternate or supplemental quarterback rating value; may represent a different calculation context from passing_qb_rating (e.g., situational or opponent-adjusted).
rushing_avg_gainFloat64Average yards gained per rushing attempt by the player.
rushing_espnrb_ratingFloat64ESPN's proprietary composite running back rating blending efficiency and usage metrics.
rushing_long_rushingFloat64Longest single rushing play in yards recorded by the player during the period.
rushing_net_total_yardsFloat64Combined net rushing and receiving yards accumulated by the player.
rushing_net_yards_per_gameFloat64Net total offensive yards per game for the player.
rushing_rushing_attemptsFloat64Total number of rushing attempts carried by the player.
rushing_rushing_big_playsFloat64Number of rushing plays that gained 10 or more yards.
rushing_rushing_first_downsFloat64Number of rushing attempts that resulted in a first down.
rushing_rushing_fumblesFloat64Number of times the player fumbled while carrying the ball on a rushing play.
rushing_rushing_fumbles_lostFloat64Number of rushing fumbles by the player that were recovered by the opposing team.
rushing_rushing_touchdownsFloat64Total number of rushing touchdowns scored by the player.
rushing_rushing_yardsFloat64Total yards gained by the player on all rushing attempts.
rushing_rushing_yards_per_gameFloat64Rushing yards per game played by the player.
rushing_stuffsFloat64Number of rushing attempts where the player was tackled at or behind the line of scrimmage.
rushing_stuff_yards_lostFloat64Total yards lost on rushing plays where the player was tackled behind the line of scrimmage (stuffed).
rushing_team_games_playedFloat64Number of games played by the player's team during which the player accumulated rushing statistics.
rushing_total_offensive_playsFloat64Total number of offensive plays run with the player active in a rushing role.
rushing_total_points_per_gameFloat64Average total points scored by the player's team per game.
rushing_total_touchdownsFloat64Total touchdowns (rushing and receiving) scored by the player.
rushing_total_yardsFloat64Combined total rushing and receiving yards accumulated by the player.
rushing_total_yards_from_scrimmageFloat64Total yards from scrimmage (rushing plus receiving) credited to the player.
rushing_two_point_rush_convsFloat64Number of successful two-point conversion rushes scored by the player.
rushing_two_pt_rushFloat64Number of two-point conversion rushes the player successfully converted.
rushing_two_pt_rush_attemptsFloat64Number of two-point conversion rush attempts by the player regardless of outcome.
rushing_yards_from_scrimmage_per_gameFloat64Total yards from scrimmage per game for the player.
rushing_yards_per_gameFloat64Rushing yards per game (equivalent label to rushing_rushing_yards_per_game).
rushing_yards_per_rush_attemptFloat64Average yards gained per rushing attempt by the player.
receiving_avg_gainFloat64Average yards gained per reception by the player.
receiving_espnwr_ratingFloat64ESPN's proprietary composite wide receiver / pass-catcher rating blending efficiency and usage metrics.
receiving_long_receptionFloat64Longest single reception in yards recorded by the player during the period.
receiving_net_total_yardsFloat64Combined net rushing and receiving yards accumulated by the player.
receiving_net_yards_per_gameFloat64Net total offensive yards (rushing plus receiving) per game for the player.
receiving_receiving_big_playsFloat64Number of receptions that gained 20 or more yards.
receiving_receiving_first_downsFloat64Number of receptions that resulted in a first down.
receiving_receiving_fumblesFloat64Number of times the player fumbled after making a reception.
receiving_receiving_fumbles_lostFloat64Number of post-reception fumbles by the player that were recovered by the opposing team.
receiving_receiving_targetsFloat64Total number of times the player was the intended target of a pass attempt.
receiving_receiving_touchdownsFloat64Total number of touchdown receptions credited to the player.
receiving_receiving_yardsFloat64Total yards gained by the player on all receptions.
receiving_receiving_yards_after_catchFloat64Total yards gained by the player after making contact with the ball (yards after catch).
receiving_receiving_yards_at_catchFloat64Total air yards at the point of the catch (depth of target) on receptions by the player.
receiving_receiving_yards_per_gameFloat64Receiving yards per game played by the player.
receiving_receptionsFloat64Total number of passes successfully caught by the player.
receiving_team_games_playedFloat64Number of games played by the player's team during which the player accumulated receiving statistics.
receiving_total_offensive_playsFloat64Total number of offensive plays run during which the player was active on the field.
receiving_total_points_per_gameFloat64Average total points scored by the player's team per game (context for the receiver's role).
receiving_total_touchdownsFloat64Total touchdowns (rushing and receiving) scored by the player.
receiving_total_yardsFloat64Combined total rushing and receiving yards accumulated by the player.
receiving_total_yards_from_scrimmageFloat64Total yards from scrimmage (rushing plus receiving) credited to the player.
receiving_two_point_rec_convsFloat64Number of successful two-point conversion receptions caught by the player.
receiving_two_pt_receptionFloat64Number of two-point conversion passes the player successfully caught.
receiving_two_pt_reception_attemptsFloat64Number of two-point conversion targets thrown to the player regardless of outcome.
receiving_yards_from_scrimmage_per_gameFloat64Total yards from scrimmage per game for the player.
receiving_yards_per_gameFloat64Receiving yards per game (equivalent label to receiving_receiving_yards_per_game).
receiving_yards_per_receptionFloat64Average yards gained per reception, also known as yards per catch.
defensive_assist_tacklesFloat64Number of assisted tackles credited to the player (helped bring down the ball carrier but was not the primary tackler).
defensive_avg_interception_yardsFloat64Average yards gained per interception returned by the player.
defensive_avg_sack_yardsFloat64Average yards lost per sack the player recorded against the opposing quarterback.
defensive_avg_stuff_yardsFloat64Average yards lost per run stuff (tackle behind the line of scrimmage) recorded by the player.
defensive_blocked_field_goal_touchdownsFloat64Number of touchdowns scored by the player after blocking an opponent's field goal attempt and returning it.
defensive_blocked_punt_touchdownsFloat64Number of touchdowns scored by the player after blocking an opponent's punt and returning it.
defensive_hurriesFloat64Number of times the player pressured the quarterback into an early or errant throw without recording a sack.
defensive_kicks_blockedFloat64Total number of kicks (field goals or extra points) the player blocked.
defensive_long_interceptionFloat64Longest single interception return in yards recorded by the player.
defensive_misc_touchdownsFloat64Number of defensive touchdowns scored via miscellaneous means not captured by other specific categories.
defensive_passes_batted_downFloat64Number of passes the player knocked down at the line of scrimmage without recording an interception.
defensive_passes_defendedFloat64Total number of passes the player broke up or deflected, including both pass deflections and interceptions.
defensive_qb_hitsFloat64Number of times the player legally hit the quarterback during or just after a pass attempt.
defensive_two_pt_returnsFloat64Number of two-point conversion attempts the player's defense returned for a defensive conversion score.
defensive_sacksFloat64
defensive_sack_yardsFloat64Total yards lost by the opposing offense as a result of the player's sacks.
defensive_safetiesFloat64Number of safeties recorded by the player (tackling the ball carrier in their own end zone).
defensive_solo_tacklesFloat64Number of unassisted tackles credited solely to the player.
defensive_stuffsFloat64Number of times the player tackled a ball carrier for a loss on a rushing play.
defensive_stuff_yardsFloat64Total yards lost by the offense on run stuffs recorded by the player.
defensive_tackles_for_lossFloat64Total number of tackles resulting in a loss of yards for the opposing offense.
defensive_tackles_yards_lostFloat64Total yards lost by the opposing offense on the player's tackles for loss.
defensive_team_games_playedFloat64Number of games played by the player's team in which the player appeared on the defensive side.
defensive_total_tacklesFloat64Combined total of solo tackles and assisted tackles recorded by the player.
defensive_yards_allowedFloat64Total yards allowed by the player's defense during games the player appeared in.
defensive_points_allowedFloat64Total points allowed by the player's team during games the player appeared in.
defensive_one_pt_safeties_madeFloat64Number of one-point safeties recorded by the player's defense (scored when the opposing team is downed in their own end zone during a try).
defensive_missed_field_goal_return_tdFloat64Number of touchdowns scored by returning a missed field goal attempt.
defensive_blocked_punt_ez_rec_tdFloat64Number of touchdowns scored by recovering a blocked punt in the end zone.
defensive_interceptions_interceptionsFloat64Total number of passes intercepted by the player.
defensive_interceptions_interception_touchdownsFloat64Number of touchdowns scored by the player on interception returns.
defensive_interceptions_interception_yardsFloat64Total yards gained by the player on interception returns.
scoring_defensive_pointsFloat64Total points scored by the player's defense via safeties, defensive touchdowns, and blocked kick returns.
scoring_field_goalsFloat64Total number of field goals successfully made by the player during the period.
scoring_kick_extra_pointsFloat64Total number of extra point attempts (PAT kicks) by the player.
scoring_kick_extra_points_madeFloat64Total number of extra points successfully kicked through the uprights by the player.
scoring_misc_pointsFloat64Points scored via miscellaneous methods not captured by other scoring categories.
scoring_passing_touchdownsFloat64Total passing touchdowns thrown by the player, contributing to their total scoring line.
scoring_receiving_touchdownsFloat64Total receiving touchdowns scored by the player.
scoring_return_touchdownsFloat64Total touchdowns scored by the player on kick or punt returns.
scoring_rushing_touchdownsFloat64Total rushing touchdowns scored by the player.
scoring_total_pointsFloat64Total points contributed by the player across all scoring methods (touchdowns, PATs, field goals, etc.).
scoring_total_points_per_gameFloat64Average total points contributed by the player per game.
scoring_total_touchdownsFloat64Total touchdowns scored or thrown by the player across all methods.
scoring_total_two_point_convsFloat64Total number of successful two-point conversions scored or thrown by the player.
scoring_two_point_pass_convsFloat64Number of successful two-point conversion passes thrown by the player.
scoring_two_point_rec_convsFloat64Number of successful two-point conversion receptions caught by the player.
scoring_two_point_rush_convsFloat64Number of successful two-point conversion rushes scored by the player.
scoring_one_pt_safeties_madeFloat64Number of one-point safeties recorded, scored when the defense stops an offense that is attempting a two-point conversion in their own end zone.
team_idInt64
team_uidString
team_guidString
team_slugString
team_locationString
team_nameString
team_abbreviationString
team_display_nameString
team_short_display_nameString
team_colorString
team_alternate_colorString
team_is_activeBoolean
team_logo_hrefString
general_defensive_fumbles_forcedFloat64Fumbles the player forced on defense, excluding miscellaneous and special-teams plays (ESPN defensiveFumblesForced, as a float); 0.0 in the single sampled row.
general_misc_fumbles_forcedFloat64Fumbles the player forced when not on defense or special teams (ESPN miscFumblesForced, as a float); 0.0 in the single sampled row.
general_special_teams_fumbles_forcedFloat64Fumbles the player forced on special-teams plays (ESPN specialTeamsFumblesForced, as a float); 0.0 in the single sampled row.
passing_offensive_snap_pctFloat64ESPN's offensiveSnapPct stat (described upstream as '% of plays the player was on the field'); 0.0 for every athlete checked, including a 175-target receiver (Ja'Marr Chase, 2024), so ESPN does not appear to populate it.
passing_target_share_pctFloat64ESPN's targetSharePct stat (described upstream as '% of total team targets'); 0.0 for every athlete checked, including a 175-target receiver (Ja'Marr Chase, 2024), so ESPN does not appear to populate it.
passing_yards_per_route_runFloat64ESPN's yardsPerRouteRun stat (yards per route run, YPRR) under the passing category; 0.0 for every athlete checked, including a 175-target receiver (Ja'Marr Chase, 2024), so ESPN does not appear to populate it.
passing_avg_depth_of_targetFloat64ESPN's avgDepthOfTarget stat (average depth of target, aDOT) under the passing category; 0.0 for every athlete checked, including a 175-target receiver (Ja'Marr Chase, 2024), so ESPN does not appear to populate it.

Raises

ExceptionDescription
ValueErrorseason_type is not "regular"/"postseason".
sportsdataverse.errors.NoDataErrorESPN returned 404.
sportsdataverse.errors.AssetFetchErrorThe statistics, athlete or team fetch failed (403, 429, 5xx, a dead connection); only a 404 on the athlete or team node leaves those columns null.

Example

from sportsdataverse.nfl import espn_nfl_player_stats
df = espn_nfl_player_stats(athlete_id=3139477, season=2023)
df.select(["full_name", "team_display_name", "passing_passing_yards"])

espn_nfl_schedule​

espn_nfl_schedule(dates=None, week=None, season_type=None, groups=None, limit=500, return_as_pandas=False, **kwargs) -> 'pl.DataFrame'

espn_nfl_schedule - look up the NFL schedule for a given season

Parameters

ParameterTypeDefaultDescription
datesintNoneUsed to define different seasons. 2002 is the earliest available season.
weekintNoneWeek of the schedule.
season_typeintNone2 for regular season, 3 for post-season, 4 for off-season.
groupsNone
limitint500number of records to return, default: 500.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing schedule dates for the requested season. A day with no games returns a zero-row frame carrying the documented columns.

col_nametypedescription
idInt64ID of the player in the 'name' column.
uidString
dateString
attendanceInt64
time_validBoolean
neutral_siteBoolean
conference_competitionBoolean
play_by_play_availableBoolean
recentBoolean
start_dateString
broadcastString
highlightsString
notes_typeString
notes_headlineString
broadcast_marketString
broadcast_nameString
type_idInt64
type_abbreviationString
venue_idInt64
venue_full_nameString
venue_address_cityString
venue_address_stateString
venue_address_countryStringTwo-letter ISO country code or country name for the country where the venue is located.
venue_indoorBoolean
status_clockFloat64
status_display_clockString
status_periodInt64
status_type_idInt64
status_type_nameString
status_type_stateString
status_type_completedBoolean
status_type_descriptionString
status_type_detailString
status_type_short_detailString
status_is_tbd_flexBooleanBoolean flag indicating whether the game's broadcast slot is designated as a flex/TBD window.
format_regulation_periodsInt64
home_idInt64
home_uidString
home_locationString
home_nameString
home_abbreviationString
home_display_nameString
home_short_display_nameString
home_colorString
home_alternate_colorString
home_is_activeBoolean
home_venue_idInt64
home_logoString
home_scoreStringThe number of points the home team scored. Is NA for games which haven't yet been played.
home_current_rankInt64Always null. The NFL has no poll, so ESPN ships no curatedRank; kept so the column set matches the college schedules.
home_linescoresListComma-separated or serialized quarter-by-quarter score totals for the home team.
home_recordsStringSerialized win-loss-tie record(s) for the home team (e.g., overall, home, away, conference).
away_idInt64
away_uidString
away_locationString
away_nameString
away_abbreviationString
away_display_nameString
away_short_display_nameString
away_colorString
away_alternate_colorString
away_is_activeBoolean
away_venue_idInt64
away_logoString
away_scoreStringThe number of points the away team scored. Is NA for games which haven't yet been played.
away_current_rankInt64Always null. The NFL has no poll, so ESPN ships no curatedRank; kept so the column set matches the college schedules.
away_linescoresListComma-separated or serialized quarter-by-quarter score totals for the away team.
away_recordsStringSerialized win-loss-tie record(s) for the away team (e.g., overall, home, away, conference).
game_idInt64Ten digit identifier for NFL game.
seasonInt644 digit number indicating to which season(s) the specified timeframe belongs to.
season_typeInt64REG or POST indicating if the timeframe belongs to regular or post season.
weekInt64Season week.
format_overtime_periodsInt64
home_logo_darkString
away_logo_darkString
home_winnerBooleanTrue when the home team won, from ESPN's winner flag; null before the game ends.
away_winnerBooleanTrue when the away team won, from ESPN's winner flag; null before the game ends.

Example

from sportsdataverse.nfl import espn_nfl_schedule
sched = espn_nfl_schedule(dates=20240908)

# Specific week of regular season (``season_type=2``)

wk1 = espn_nfl_schedule(dates=2024, week=1, season_type=2)

# Pandas round-trip

sched_pd = espn_nfl_schedule(dates=20240908, return_as_pandas=True)

espn_nfl_teams​

espn_nfl_teams(return_as_pandas=False, **kwargs) -> 'pl.DataFrame'

espn_nfl_teams - look up NFL teams

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe of the NFL teams, one row per team, with the columns in the returns table. A payload without teams returns a zero-row frame with those columns. The result is not cached: every call fetches (through the package's opt-in TTL response cache, sportsdataverse.cache, when it is on).

col_nametypedescription
team_abbreviationString
team_alternate_colorString
team_colorString
team_display_nameString
team_idInt64
team_is_activeBoolean
team_is_all_starBoolean
team_locationString
team_logosInt64
team_nameString
team_nicknameString
team_short_display_nameString
team_slugString
team_uidString

Raises

ExceptionDescription
NoDataErrorESPN answered 404 for the teams resource.
AssetFetchErrorThe fetch failed (403, 429, 5xx, a dropped connection); never returned as an empty frame.

Example

from sportsdataverse.nfl import espn_nfl_teams
teams = espn_nfl_teams()
teams.shape

# Pandas round-trip

teams_pd = espn_nfl_teams(return_as_pandas=True)
teams_pd[["team_abbreviation", "team_display_name"]].head()

# Pipeline next step (build a team_id to abbreviation map)

abbr_map = dict(zip(teams["team_id"], teams["team_abbreviation"]))

scoreboard_event_parsing​

scoreboard_event_parsing(event)

Normalize one ESPN scoreboard event into a flatter shape.

Splits the competitors list into home / away siblings, hoists notes / broadcast metadata onto the competition root, and drops the fields the schedule helper does not need (odds, leaders, geoBroadcasts, etc.). Used internally by espn_nfl_schedule.

Parameters

ParameterTypeDefaultDescription
eventDictA single events[i] dict from the ESPN scoreboard endpoint.

Returns

The mutated event dict with normalized home / away / broadcast keys.

Example

from sportsdataverse.nfl import espn_nfl_scoreboard
from sportsdataverse.nfl.nfl_schedule import scoreboard_event_parsing
payload = espn_nfl_scoreboard(dates=20240115, return_parsed=False)
for ev in payload.get("events", []):
scoreboard_event_parsing(ev)
ev["competitions"][0]["home"]["abbreviation"]