Skip to main content
Version: 0.0.56

NFL — additional Python functions

Hand-written wrappers, loaders, and helpers in sportsdataverse.nfl not covered by the generated API-endpoint reference above.

Play-by-play, schedule & rosters

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

espn_nfl_game_rosters() - Pull the game by id.

Parameters

ParameterTypeDefaultDescription
game_idintUnique game_id, can be obtained from espn_nfl_schedule().
rawFalse
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'

col_nametypedescription
athlete_idintegerUnique athlete identifier (ESPN).
athlete_uidcharacterESPN athlete UID (universal identifier).
athlete_guidcharacterESPN athlete GUID.
athlete_typecharacterAthlete type / class.
first_namecharacterFirst name of player
last_namecharacterLast name of player
full_namecharacterFull name as per NFL.com
athlete_display_namecharacterAthlete display name (full).
short_namecharacterPlayer short name (i.e. "F.Last")
weightdoubleOfficial weight, in pounds
display_weightcharacterPlayer weight in display format (e.g. '180 lbs').
heightdoubleOfficial height, in inches
display_heightcharacterPlayer height in display format (e.g. '6-2').
ageintegerAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
date_of_birthcharacterDate of birth (YYYY-MM-DD).
debut_yearintegerYear of professional debut.
slugcharacterURL-safe identifier.
jerseycharacterJersey number worn by the player.
linkedlogicalTRUE if the record is linked to a related entity.
activelogicalTRUE if the row represents an active record (player / team / season).
alternate_ids_sdrcharacterAlternate ids sdr.
birth_place_citycharacterBirth place city.
birth_place_statecharacterBirth place state.
birth_place_countrycharacterBirth place country.
headshot_hrefcharacterLink to ESPN Headshot of Player
headshot_altcharacterAlternative-text label for the headshot.
projections_hrefcharacter
contracts_hrefcharacter
experience_yearsintegerExperience years.
college_athlete_hrefcharacter
contract_hrefcharacter
contract_option_typeintegerContract option type.
contract_salaryintegerContract salary.
contract_bonusinteger
contract_years_remainingintegerContract years remaining.
contract_signed_throughinteger
contract_season_hrefcharacter
contract_team_hrefcharacter
contract_activelogicalContract active.
status_idcharacterStatus identifier.
status_namecharacterStatus label.
status_typecharacterStatus type.
status_abbreviationcharacterStatus abbreviation.
contract_salary_remainingintegerContract salary remaining.
draft_display_textcharacterDraft display text.
draft_roundintegerRound that player was drafted in
draft_yearintegerYear that player was drafted
draft_selectionintegerDraft selection.
draft_team_hrefcharacter
draft_pick_hrefcharacter
hand_typecharacterHand type.
hand_abbreviationcharacterHand abbreviation.
hand_display_valuecharacterHand display value.
starterlogicalTRUE if the player was in the starting lineup; FALSE otherwise.
jersey_rightcharacter
validlogicalValid.
did_not_playlogicalTRUE if the player did not appear in the game.
display_namecharacterFull name of player
athlete_hrefcharacter
position_hrefcharacter
statistics_hrefcharacter
team_idintegerUnique team identifier.
orderintegerDisplay order within the result set.
home_awaycharacterGame venue label ('home' or 'away').
winnerlogicalWinner.
team_guidcharacterESPN team GUID.
team_uidcharacterESPN universal team identifier (UID format 's:40~l:...~t:...').
team_slugcharacterURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_locationcharacterTeam city or location string.
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_nicknamecharacterTeam nickname.
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
team_display_namecharacterFull team display name.
team_short_display_namecharacterShort team display name (e.g. 'Aces').
team_colorcharacterTeam primary color (hex without leading '#').
team_alternate_colorcharacterTeam alternate color (hex without leading '#').
is_activelogicalActive contract
is_all_starlogicalIs all star.
team_alternate_ids_sdrcharacter
logo_hrefcharacterTeam or league logo URL.
logo_dark_hrefcharacterLogo URL for dark backgrounds.
game_idintegerTen digit identifier for NFL game.

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_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
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
totallogicalThe 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_idintegerUnique athlete identifier (ESPN).
athlete_uidcharacterESPN athlete UID (universal identifier).
athlete_guidcharacterESPN athlete GUID.
athlete_typecharacterAthlete type / class.
first_namecharacterFirst name of player
last_namecharacterLast name of player
full_namecharacterFull name as per NFL.com
display_namecharacterFull name of player
short_namecharacterPlayer short name (i.e. "F.Last")
weightdoubleOfficial weight, in pounds
display_weightcharacterPlayer weight in display format (e.g. '180 lbs').
heightdoubleOfficial height, in inches
display_heightcharacterPlayer height in display format (e.g. '6-2').
ageintegerAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
date_of_birthcharacterDate of birth (YYYY-MM-DD).
jerseycharacterJersey number worn by the player.
slugcharacterURL-safe identifier.
activelogicalTRUE if the row represents an active record (player / team / season).
position_idintegerUnique position identifier.
position_namecharacterListed roster position ('Guard', 'Forward', 'Center').
position_display_namecharacterPosition display name.
position_abbreviationcharacterPosition abbreviation ('G' / 'F' / 'C').
college_namecharacterOfficial college (usually the last one attended)
status_idintegerStatus identifier.
status_namecharacterStatus label.
general_fumblesdouble
general_fumbles_lostdouble
general_fumbles_forceddouble
general_fumbles_forced_primarydouble
general_fumbles_recovereddouble
general_fumbles_recovered_yardsdouble
general_fumbles_touchdownsdouble
general_games_playeddoubleGames Played.
general_offensive_two_pt_returnsdouble
general_offensive_fumbles_touchdownsdouble
general_defensive_fumbles_touchdownsdouble
passing_avg_gaindouble
passing_completion_pctdouble
passing_completionsdoublePass completions (split from CFBD's C/ATT field).
passing_espnqb_ratingdouble
passing_interception_pctdouble
passing_interceptionsdouble
passing_long_passingdouble
passing_net_passing_yardsdouble
passing_net_passing_yards_per_gamedouble
passing_net_total_yardsdouble
passing_net_yards_per_gamedouble
passing_passing_attemptsdouble
passing_passing_big_playsdouble
passing_passing_first_downsdouble
passing_passing_fumblesdouble
passing_passing_fumbles_lostdouble
passing_passing_touchdown_pctdouble
passing_passing_touchdownsdouble
passing_passing_yardsdouble
passing_passing_yards_after_catchdouble
passing_passing_yards_at_catchdouble
passing_passing_yards_per_gamedouble
passing_qb_ratingdouble
passing_sacksdouble
passing_sack_yards_lostdouble
passing_net_passing_attemptsdouble
passing_team_games_playeddouble
passing_total_offensive_playsdouble
passing_total_points_per_gamedouble
passing_total_touchdownsdouble
passing_total_yardsdouble
passing_total_yards_from_scrimmagedouble
passing_two_point_pass_convsdouble
passing_two_pt_passdouble
passing_two_pt_pass_attemptsdouble
passing_yards_from_scrimmage_per_gamedouble
passing_yards_per_completiondouble
passing_yards_per_gamedouble
passing_yards_per_pass_attemptdouble
passing_net_yards_per_pass_attemptdouble
passing_qbrdoubleESPN Quarterback Rating (QBR) for the player in this game.
passing_adj_qbrdouble
passing_quarterback_ratingdouble
rushing_avg_gaindouble
rushing_espnrb_ratingdouble
rushing_long_rushingdouble
rushing_net_total_yardsdouble
rushing_net_yards_per_gamedouble
rushing_rushing_attemptsdouble
rushing_rushing_big_playsdouble
rushing_rushing_first_downsdouble
rushing_rushing_fumblesdouble
rushing_rushing_fumbles_lostdouble
rushing_rushing_touchdownsdouble
rushing_rushing_yardsdouble
rushing_rushing_yards_per_gamedouble
rushing_stuffsdouble
rushing_stuff_yards_lostdouble
rushing_team_games_playeddouble
rushing_total_offensive_playsdouble
rushing_total_points_per_gamedouble
rushing_total_touchdownsdouble
rushing_total_yardsdouble
rushing_total_yards_from_scrimmagedouble
rushing_two_point_rush_convsdouble
rushing_two_pt_rushdouble
rushing_two_pt_rush_attemptsdouble
rushing_yards_from_scrimmage_per_gamedouble
rushing_yards_per_gamedouble
rushing_yards_per_rush_attemptdouble
receiving_avg_gaindouble
receiving_espnwr_ratingdouble
receiving_long_receptiondouble
receiving_net_total_yardsdouble
receiving_net_yards_per_gamedouble
receiving_receiving_big_playsdouble
receiving_receiving_first_downsdouble
receiving_receiving_fumblesdouble
receiving_receiving_fumbles_lostdouble
receiving_receiving_targetsdouble
receiving_receiving_touchdownsdouble
receiving_receiving_yardsdouble
receiving_receiving_yards_after_catchdouble
receiving_receiving_yards_at_catchdouble
receiving_receiving_yards_per_gamedouble
receiving_receptionsdouble
receiving_team_games_playeddouble
receiving_total_offensive_playsdouble
receiving_total_points_per_gamedouble
receiving_total_touchdownsdouble
receiving_total_yardsdouble
receiving_total_yards_from_scrimmagedouble
receiving_two_point_rec_convsdouble
receiving_two_pt_receptiondouble
receiving_two_pt_reception_attemptsdouble
receiving_yards_from_scrimmage_per_gamedouble
receiving_yards_per_gamedouble
receiving_yards_per_receptiondouble
defensive_assist_tacklesdouble
defensive_avg_interception_yardsdouble
defensive_avg_sack_yardsdouble
defensive_avg_stuff_yardsdouble
defensive_blocked_field_goal_touchdownsdouble
defensive_blocked_punt_touchdownsdouble
defensive_hurriesdouble
defensive_kicks_blockeddouble
defensive_long_interceptiondouble
defensive_misc_touchdownsdouble
defensive_passes_batted_downdouble
defensive_passes_defendeddouble
defensive_qb_hitsdouble
defensive_two_pt_returnsdouble
defensive_sacksdoubleSacks credited to the player.
defensive_sack_yardsdouble
defensive_safetiesdouble
defensive_solo_tacklesdouble
defensive_stuffsdouble
defensive_stuff_yardsdouble
defensive_tackles_for_lossdouble
defensive_tackles_yards_lostdouble
defensive_team_games_playeddouble
defensive_total_tacklesdouble
defensive_yards_alloweddouble
defensive_points_alloweddouble
defensive_one_pt_safeties_madedouble
defensive_missed_field_goal_return_tddouble
defensive_blocked_punt_ez_rec_tddouble
defensive_interceptions_interceptionsdouble
defensive_interceptions_interception_touchdownsdouble
defensive_interceptions_interception_yardsdouble
scoring_defensive_pointsdouble
scoring_field_goalsdouble
scoring_kick_extra_pointsdouble
scoring_kick_extra_points_madedouble
scoring_misc_pointsdouble
scoring_passing_touchdownsdouble
scoring_receiving_touchdownsdouble
scoring_return_touchdownsdouble
scoring_rushing_touchdownsdouble
scoring_total_pointsdouble
scoring_total_points_per_gamedouble
scoring_total_touchdownsdouble
scoring_total_two_point_convsdouble
scoring_two_point_pass_convsdouble
scoring_two_point_rec_convsdouble
scoring_two_point_rush_convsdouble
scoring_one_pt_safeties_madedouble
team_idintegerUnique team identifier.
team_uidcharacterESPN universal team identifier (UID format 's:40~l:...~t:...').
team_guidcharacterESPN team GUID.
team_slugcharacterURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_locationcharacterTeam city or location string.
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
team_display_namecharacterFull team display name.
team_short_display_namecharacterShort team display name (e.g. 'Aces').
team_colorcharacterTeam primary color (hex without leading '#').
team_alternate_colorcharacterTeam alternate color (hex without leading '#').
team_is_activelogicalTRUE if the team is currently active.
team_logo_hrefcharacterDefault team logo URL; team_detail = TRUE only.

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(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. Returns None if no games

col_nametypedescription
idcharacterID of the player in the 'name' column.
uidcharacterESPN UID string.
datecharacterDate in YYYY-MM-DD format.
attendanceintegerReported attendance.
time_validlogicalWhether the start time is confirmed.
neutral_sitelogicalNeutral site.
conference_competitionlogicalConference competition.
play_by_play_availablelogicalWhether play-by-play data is available.
recentlogicalWhether the game is recent.
start_datecharacterStart date (YYYY-MM-DD).
broadcastcharacterBroadcast information string.
highlightscharacterGame highlight urls.
notes_typecharacterNotes type.
notes_headlinecharacterNotes headline.
broadcast_marketcharacterBroadcast market label (e.g. 'national', 'home').
broadcast_namecharacterBroadcast name.
type_idcharacterType identifier (numeric).
type_abbreviationcharacterPlay type abbreviation.
venue_idcharacterUnique venue identifier.
venue_full_namecharacterVenue full name.
venue_address_citycharacterVenue address city.
venue_address_statecharacterVenue address state / region.
venue_address_countrycharacter
venue_indoorlogicalWhether the home venue is indoors.
status_clockdoubleGame clock in seconds.
status_display_clockcharacterStatus display clock.
status_periodintegerCurrent period.
status_type_idcharacterUnique identifier for status type.
status_type_namecharacterStatus type name.
status_type_statecharacterStatus state (pre/in/post).
status_type_completedlogicalWhether the game is complete.
status_type_descriptioncharacterStatus type description.
status_type_detailcharacterStatus type detail.
status_type_short_detailcharacterStatus type short detail.
status_is_tbd_flexlogical
format_regulation_periodsintegerFormat regulation periods.
home_idcharacterUnique identifier for home.
home_uidcharacterHome team's uid.
home_locationcharacterHome team's location.
home_namecharacterHome team display name.
home_abbreviationcharacterHome team's abbreviation.
home_display_namecharacterHome team display name.
home_short_display_namecharacterHome short display name.
home_colorcharacterHome team primary color hex.
home_alternate_colorcharacterColor code (hex) for home alternate.
home_is_activelogicalHome team's is active.
home_venue_idcharacterUnique identifier for home venue.
home_logocharacterHome team logo URL.
home_scorecharacterThe number of points the home team scored. Is NA for games which haven't yet been played.
home_current_rankinteger
home_linescoresinteger
home_recordscharacter
away_idcharacterUnique identifier for away.
away_uidcharacterAway team's uid.
away_locationcharacterAway team's location.
away_namecharacterAway team display name.
away_abbreviationcharacterAway team's abbreviation.
away_display_namecharacterAway team display name.
away_short_display_namecharacterAway short display name.
away_colorcharacterAway team primary color hex.
away_alternate_colorcharacterColor code (hex) for away alternate.
away_is_activelogicalAway team's is active.
away_venue_idcharacterUnique identifier for away venue.
away_logocharacterAway team logo URL.
away_scorecharacterThe number of points the away team scored. Is NA for games which haven't yet been played.
away_current_rankinteger
away_linescoresinteger
away_recordscharacter
game_idintegerTen digit identifier for NFL game.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typeintegerREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.

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)

Dataset loaders

load_combine(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Combine information

Parameters

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

Returns

Polars dataframe containing NFL combine data available.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
draft_yeardoubleYear that player was drafted
draft_teamcharacterTeam that drafted player
draft_rounddoubleRound that player was drafted in
draft_ovrdoubleOverall draft pick selection. This can be a little bit patchy, since MFL does not report this number.
pfr_idcharacterPro-Football-Reference ID for player
cfb_idcharacterSports Reference (CFB) ID for player
player_namecharacterFull name of player
poscharacterPosition as tracked by FP
schoolcharacterCollege of player
htcharacterHeight of player (feet and inches)
wtdoubleWeight of player (lbs)
fortydoublePlayer's 40 yard dash time at combine (seconds)
benchdoubleReps benched by player at combine
verticaldoublePlayer's vertical jump at combine (inches)
broad_jumpdoublePlayer's broad jump at combine (inches)
conedoublePlayer's 3 cone drill time at combine (seconds)
shuttledoublePlayer's shuttle run time at combine (seconds)

Example

from sportsdataverse.nfl import load_nfl_combine
combine = load_nfl_combine()
combine.shape

# Filter by draft year and position

import polars as pl
qbs_2024 = (
load_nfl_combine()
.filter((pl.col("season") == 2024) & (pl.col("pos") == "QB"))
)

load_contracts(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Historical contracts information

Parameters

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

Returns

Polars dataframe containing historical contracts available.

col_nametypedescription
playercharacterPlayer name
positioncharacterPrimary position as reported by NFL.com
teamcharacterNFL team. Uses official abbreviations as per NFL.com
is_activelogicalActive contract
year_signedintegerYear the contract was signed
yearsintegerContract length
valuedoubleTotal contract value
apydoubleAverage money per contract year
guaranteeddoubleTotal guaranteed money
apy_cap_pctdoubleAverage money per contract year as percentage of the team's salary cap at signing
inflated_valuedoubleTotal contract value inflated to account for the rise of the salary cap
inflated_apydoubleAverage money per contract year inflated to account for the rise of the salary cap
inflated_guaranteeddoubleTotal guaranteed money inflated to account for the rise of the salary cap
player_pagecharacterPlayer's OverTheCap url
otc_idintegerOver the Cap ID for player
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
date_of_birthcharacterDate of birth (YYYY-MM-DD).
heightcharacterOfficial height, in inches
weightcharacterOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
draft_yearintegerYear that player was drafted
draft_roundintegerRound that player was drafted in
draft_overallintegerOverall draft selection number.
draft_teamcharacterTeam that drafted player
colsdouble

Example

from sportsdataverse.nfl import load_nfl_contracts
contracts = load_nfl_contracts()
contracts.shape

# Pandas round-trip with sort by APY

contracts_pd = load_nfl_contracts(return_as_pandas=True)
contracts_pd.sort_values("apy", ascending=False).head()

load_depth_charts(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Depth Chart data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2001 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing depth chart data available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
club_codecharacter
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
depth_teamcharacter
last_namecharacterLast name of player
first_namecharacterFirst name of player
football_namecharacterCommon player name (i.e. in most cases common_first_name last_name)
formationcharacter
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
jersey_numbercharacterJersey number. Often useful for joins by name/team/jersey.
positioncharacterPrimary position as reported by NFL.com
elias_idcharacter
depth_positioncharacter
full_namecharacterFull name as per NFL.com

Example

from sportsdataverse.nfl import load_nfl_depth_charts
depth = load_nfl_depth_charts(seasons=[2024])

# Multi-season range

depth = load_nfl_depth_charts(seasons=range(2020, 2025))

load_draft_picks(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Draft picks information

Parameters

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

Returns

Polars dataframe containing NFL Draft picks data available.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
roundintegerDraft round
pickintegerDraft overall pick
teamcharacterNFL team. Uses official abbreviations as per NFL.com
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
pfr_player_idcharacterID from Pro Football Reference
cfb_player_idcharacterID from College Football Reference
pfr_player_namecharacterPlayer's name as recorded by PFR
hoflogicalWhether player has been selected to the Pro Football Hall of Fame
positioncharacterPrimary position as reported by NFL.com
categorycharacterBroader category of player positions
sidecharacterO for offense, D for defense, S for special teams
collegecharacterOfficial college (usually the last one attended)
ageintegerAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
tointegerFinal season played in NFL
allprointegerNumber of AP First Team All-Pro selections as recorded by PFR
probowlsintegerNumber of Pro Bowls
seasons_startedintegerNumber of seasons recorded as primary starter for position
w_avintegerWeighted Approximate Value
car_avlogicalCareer Approximate Value
dr_avintegerDraft Approximate Value
gamesintegerGames played in career
pass_completionsintegerNumber of successful completions for a given game
pass_attemptsintegerCareer pass attempts
pass_yardsintegerNumber of yards gained on pass plays
pass_tdsintegerCareer pass touchdowns thrown
pass_intsintegerCareer pass interceptions thrown
rush_attsintegerCareer rushing attempts
rush_yardsintegerThe number of rushing yards gained
rush_tdsintegerCareer rushing touchdowns
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
rec_yardsintegerCareer receiving yards
rec_tdsintegerCareer receiving touchdowns
def_solo_tacklesintegerCareer solo tackles
def_intsintegerCareer interceptions
def_sacksdoubleNumber of sacks form this player

Example

from sportsdataverse.nfl import load_nfl_draft_picks
picks = load_nfl_draft_picks()
picks.shape

# Filter to a single year and round

import polars as pl
r1_2024 = (
load_nfl_draft_picks()
.filter((pl.col("season") == 2024) & (pl.col("round") == 1))
)

load_ff_opportunity(seasons: 'List[int]', stat_type: 'str' = 'weekly', model_version: 'str' = 'latest', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL fantasy football opportunity data from ffverse/ffopportunity

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2006 is the earliest available season.
stat_typestr'weekly'One of "weekly", "pbp_pass", "pbp_rush". Defaults to "weekly".
model_versionstr'latest'One of "latest", "v1.0.0". Defaults to "latest".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing fantasy football opportunity data for the requested seasons.

col_nametypedescription
seasoncharacter4 digit number indicating to which season(s) the specified timeframe belongs to.
posteamcharacterString abbreviation for the team with possession.
weekdoubleSeason week.
game_idcharacterTen digit identifier for NFL game.
player_idcharacterPlayer ID (aka GSIS ID) as defined by nflreadr::load_rosters
full_namecharacterFull name as per NFL.com
positioncharacterPrimary position as reported by NFL.com
pass_attemptdoubleBinary indicator for if the play was a pass attempt (includes sacks).
rec_attemptdoubleTotal number of targets for a given game
rush_attemptdoubleBinary indicator for if the play was a run.
pass_air_yardsdoubleTotal air yards thrown for a given game
rec_air_yardsdoubleTotal air yards on receiving attempts for a given game
pass_completionsdoubleNumber of successful completions for a given game
receptionsdoubleThe number of pass receptions. Lateral receptions officially don't count as reception.
pass_completions_expdoubleExpected number of pass_completions in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
receptions_expdoubleExpected number of receptions in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_yards_gaineddoubleTotal passing yards gained for a given game
rec_yards_gaineddoubleTotal receiving yards gained for a given game
rush_yards_gaineddoubleTotal rushing yards gained for a given game
pass_yards_gained_expdoubleExpected number of pass_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_yards_gained_expdoubleExpected number of rec_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_yards_gained_expdoubleExpected number of rush_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_touchdowndoubleBinary indicator for if the play resulted in a passing TD.
rec_touchdowndoubleTotal receiving touchdowns
rush_touchdowndoubleBinary indicator for if the play resulted in a rushing TD.
pass_touchdown_expdoubleExpected number of pass_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_touchdown_expdoubleExpected number of rec_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_touchdown_expdoubleExpected number of rush_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_two_point_convdoubleNumber of successful passing two point conversions
rec_two_point_convdoubleNumber of successful receiving two point conversions
rush_two_point_convdoubleNumber of successful rushing two point conversions
pass_two_point_conv_expdoubleExpected number of pass_two_point_conv in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_two_point_conv_expdoubleExpected number of rec_two_point_conv in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_two_point_conv_expdoubleExpected number of rush_two_point_conv in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_first_downdoubleNumber of passing first downs
rec_first_downdoubleNumber of receiving first downs
rush_first_downdoubleNumber of rushing first downs
pass_first_down_expdoubleExpected number of pass_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_first_down_expdoubleExpected number of rec_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_first_down_expdoubleExpected number of rush_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_interceptiondoubleNumber of interceptions thrown
rec_interceptiondoubleNumber of interceptions on targets
pass_interception_expdoubleExpected number of pass_interception in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_interception_expdoubleExpected number of rec_interception in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_fumble_lostdoubleNumber of fumbles on receiving attempts
rush_fumble_lostdoubleNumber of fumbles on rushing attempts
pass_fantasy_points_expdoubleExpected number of pass_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_fantasy_points_expdoubleExpected number of rec_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_fantasy_points_expdoubleExpected number of rush_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_fantasy_pointsdoubleTotal fantasy points from passing, assuming 0.04 points per pass yard, 4 points per pass TD, -2 points per interception
rec_fantasy_pointsdoubleTotal fantasy points from receiving, assuming PPR scoring
rush_fantasy_pointsdoubleTotal fantasy points from rushing, assuming PPR scoring
total_yards_gaineddoubleTotal scrimmage yards (sum of pass, rush, and receiving yards)
total_yards_gained_expdoubleExpected number of total_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
total_touchdowndoubleTotal touchdowns (sum of pass, rush, and receiving touchdowns)
total_touchdown_expdoubleExpected number of total_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
total_first_downdoubleTotal first downs (sum of pass, rush, and receiving first downs)
total_first_down_expdoubleExpected number of total_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
total_fantasy_pointsdoubleTotal fantasy points (sum of pass, rush, and receiving fantasy points)
total_fantasy_points_expdoubleExpected number of total_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_completions_diffdoubleDifference between actual and expected number of pass_completions - often interpreted as efficiency for a given play/game
receptions_diffdoubleDifference between actual and expected number of receptions - often interpreted as efficiency for a given play/game
pass_yards_gained_diffdoubleDifference between actual and expected number of pass_yards_gained - often interpreted as efficiency for a given play/game
rec_yards_gained_diffdoubleDifference between actual and expected number of rec_yards_gained - often interpreted as efficiency for a given play/game
rush_yards_gained_diffdoubleDifference between actual and expected number of rush_yards_gained - often interpreted as efficiency for a given play/game
pass_touchdown_diffdoubleDifference between actual and expected number of pass_touchdown - often interpreted as efficiency for a given play/game
rec_touchdown_diffdoubleDifference between actual and expected number of rec_touchdown - often interpreted as efficiency for a given play/game
rush_touchdown_diffdoubleDifference between actual and expected number of rush_touchdown - often interpreted as efficiency for a given play/game
pass_two_point_conv_diffdoubleDifference between actual and expected number of pass_two_point_conv - often interpreted as efficiency for a given play/game
rec_two_point_conv_diffdoubleDifference between actual and expected number of rec_two_point_conv - often interpreted as efficiency for a given play/game
rush_two_point_conv_diffdoubleDifference between actual and expected number of rush_two_point_conv - often interpreted as efficiency for a given play/game
pass_first_down_diffdoubleDifference between actual and expected number of pass_first_down - often interpreted as efficiency for a given play/game
rec_first_down_diffdoubleDifference between actual and expected number of rec_first_down - often interpreted as efficiency for a given play/game
rush_first_down_diffdoubleDifference between actual and expected number of rush_first_down - often interpreted as efficiency for a given play/game
pass_interception_diffdoubleDifference between actual and expected number of pass_interception - often interpreted as efficiency for a given play/game
rec_interception_diffdoubleDifference between actual and expected number of rec_interception - often interpreted as efficiency for a given play/game
pass_fantasy_points_diffdoubleDifference between actual and expected number of pass_fantasy_points - often interpreted as efficiency for a given play/game
rec_fantasy_points_diffdoubleDifference between actual and expected number of rec_fantasy_points - often interpreted as efficiency for a given play/game
rush_fantasy_points_diffdoubleDifference between actual and expected number of rush_fantasy_points - often interpreted as efficiency for a given play/game
total_yards_gained_diffdoubleDifference between actual and expected number of total_yards_gained - often interpreted as efficiency for a given play/game
total_touchdown_diffdoubleDifference between actual and expected number of total_touchdown - often interpreted as efficiency for a given play/game
total_first_down_diffdoubleDifference between actual and expected number of total_first_down - often interpreted as efficiency for a given play/game
total_fantasy_points_diffdoubleDifference between actual and expected number of total_fantasy_points - often interpreted as efficiency for a given play/game
pass_attempt_teamdoubleTeam-level total pass_attempt for a game, summed across all plays/players for that team.
rec_attempt_teamdoubleTeam-level total rec_attempt for a game, summed across all plays/players for that team.
rush_attempt_teamdoubleTeam-level total rush_attempt for a game, summed across all plays/players for that team.
pass_air_yards_teamdoubleTeam-level total pass_air_yards for a game, summed across all plays/players for that team.
rec_air_yards_teamdoubleTeam-level total rec_air_yards for a game, summed across all plays/players for that team.
pass_completions_teamdoubleTeam-level total pass_completions for a game, summed across all plays/players for that team.
receptions_teamdoubleTeam-level total receptions for a game, summed across all plays/players for that team.
pass_completions_exp_teamdoubleTeam-level total expected pass_completions_exp for a game, summed across all plays & players for that team.
receptions_exp_teamdoubleTeam-level total expected receptions_exp for a game, summed across all plays & players for that team.
pass_yards_gained_teamdoubleTeam-level total pass_yards_gained for a game, summed across all plays/players for that team.
rec_yards_gained_teamdoubleTeam-level total rec_yards_gained for a game, summed across all plays/players for that team.
rush_yards_gained_teamdoubleTeam-level total rush_yards_gained for a game, summed across all plays/players for that team.
pass_yards_gained_exp_teamdoubleTeam-level total expected pass_yards_gained_exp for a game, summed across all plays & players for that team.
rec_yards_gained_exp_teamdoubleTeam-level total expected rec_yards_gained_exp for a game, summed across all plays & players for that team.
rush_yards_gained_exp_teamdoubleTeam-level total expected rush_yards_gained_exp for a game, summed across all plays & players for that team.
pass_touchdown_teamdoubleTeam-level total pass_touchdown for a game, summed across all plays/players for that team.
rec_touchdown_teamdoubleTeam-level total rec_touchdown for a game, summed across all plays/players for that team.
rush_touchdown_teamdoubleTeam-level total rush_touchdown for a game, summed across all plays/players for that team.
pass_touchdown_exp_teamdoubleTeam-level total expected pass_touchdown_exp for a game, summed across all plays & players for that team.
rec_touchdown_exp_teamdoubleTeam-level total expected rec_touchdown_exp for a game, summed across all plays & players for that team.
rush_touchdown_exp_teamdoubleTeam-level total expected rush_touchdown_exp for a game, summed across all plays & players for that team.
pass_two_point_conv_teamdoubleTeam-level total pass_two_point_conv for a game, summed across all plays/players for that team.
rec_two_point_conv_teamdoubleTeam-level total rec_two_point_conv for a game, summed across all plays/players for that team.
rush_two_point_conv_teamdoubleTeam-level total rush_two_point_conv for a game, summed across all plays/players for that team.
pass_two_point_conv_exp_teamdoubleTeam-level total expected pass_two_point_conv_exp for a game, summed across all plays & players for that team.
rec_two_point_conv_exp_teamdoubleTeam-level total expected rec_two_point_conv_exp for a game, summed across all plays & players for that team.
rush_two_point_conv_exp_teamdoubleTeam-level total expected rush_two_point_conv_exp for a game, summed across all plays & players for that team.
pass_first_down_teamdoubleTeam-level total pass_first_down for a game, summed across all plays/players for that team.
rec_first_down_teamdoubleTeam-level total rec_first_down for a game, summed across all plays/players for that team.
rush_first_down_teamdoubleTeam-level total rush_first_down for a game, summed across all plays/players for that team.
pass_first_down_exp_teamdoubleTeam-level total expected pass_first_down_exp for a game, summed across all plays & players for that team.
rec_first_down_exp_teamdoubleTeam-level total expected rec_first_down_exp for a game, summed across all plays & players for that team.
rush_first_down_exp_teamdoubleTeam-level total expected rush_first_down_exp for a game, summed across all plays & players for that team.
pass_interception_teamdoubleTeam-level total pass_interception for a game, summed across all plays/players for that team.
rec_interception_teamdoubleTeam-level total rec_interception for a game, summed across all plays/players for that team.
pass_interception_exp_teamdoubleTeam-level total expected pass_interception_exp for a game, summed across all plays & players for that team.
rec_interception_exp_teamdoubleTeam-level total expected rec_interception_exp for a game, summed across all plays & players for that team.
rec_fumble_lost_teamdoubleTeam-level total rec_fumble_lost for a game, summed across all plays/players for that team.
rush_fumble_lost_teamdoubleTeam-level total rush_fumble_lost for a game, summed across all plays/players for that team.
pass_fantasy_points_exp_teamdoubleTeam-level total expected pass_fantasy_points_exp for a game, summed across all plays & players for that team.
rec_fantasy_points_exp_teamdoubleTeam-level total expected rec_fantasy_points_exp for a game, summed across all plays & players for that team.
rush_fantasy_points_exp_teamdoubleTeam-level total expected rush_fantasy_points_exp for a game, summed across all plays & players for that team.
pass_fantasy_points_teamdoubleTeam-level total pass_fantasy_points for a game, summed across all plays/players for that team.
rec_fantasy_points_teamdoubleTeam-level total rec_fantasy_points for a game, summed across all plays/players for that team.
rush_fantasy_points_teamdoubleTeam-level total rush_fantasy_points for a game, summed across all plays/players for that team.
pass_completions_diff_teamdoubleTeam-level difference between actual and expected number of pass_completions_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
receptions_diff_teamdoubleTeam-level difference between actual and expected number of receptions_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of pass_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of rec_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of rush_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of pass_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of rec_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of rush_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_two_point_conv_diff_teamdoubleTeam-level difference between actual and expected number of pass_two_point_conv_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_two_point_conv_diff_teamdoubleTeam-level difference between actual and expected number of rec_two_point_conv_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_two_point_conv_diff_teamdoubleTeam-level difference between actual and expected number of rush_two_point_conv_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_first_down_diff_teamdoubleTeam-level difference between actual and expected number of pass_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_first_down_diff_teamdoubleTeam-level difference between actual and expected number of rec_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_first_down_diff_teamdoubleTeam-level difference between actual and expected number of rush_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_interception_diff_teamdoubleTeam-level difference between actual and expected number of pass_interception_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_interception_diff_teamdoubleTeam-level difference between actual and expected number of rec_interception_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of pass_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of rec_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of rush_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_yards_gained_teamdoubleTeam-level total total_yards_gained for a game, summed across all plays/players for that team.
total_yards_gained_exp_teamdoubleTeam-level total expected total_yards_gained_exp for a game, summed across all plays & players for that team.
total_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of total_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_touchdown_teamdoubleTeam-level total total_touchdown for a game, summed across all plays/players for that team.
total_touchdown_exp_teamdoubleTeam-level total expected total_touchdown_exp for a game, summed across all plays & players for that team.
total_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of total_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_first_down_teamdoubleTeam-level total total_first_down for a game, summed across all plays/players for that team.
total_first_down_exp_teamdoubleTeam-level total expected total_first_down_exp for a game, summed across all plays & players for that team.
total_first_down_diff_teamdoubleTeam-level difference between actual and expected number of total_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_fantasy_points_teamdoubleTeam-level total total_fantasy_points for a game, summed across all plays/players for that team.
total_fantasy_points_exp_teamdoubleTeam-level total expected total_fantasy_points_exp for a game, summed across all plays & players for that team.
total_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of total_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.

Example

from sportsdataverse.nfl import load_nfl_ff_opportunity
weekly = load_nfl_ff_opportunity(seasons=[2024])

# Pass play-by-play opportunity stats

pbp_pass = load_nfl_ff_opportunity(seasons=[2024], stat_type="pbp_pass")

# Rush play-by-play opportunity stats with pinned model version

pbp_rush = load_nfl_ff_opportunity(
seasons=[2024], stat_type="pbp_rush", model_version="v1.0.0"
)

load_ff_playerids(return_as_pandas=False) -> 'pl.DataFrame'

Load fantasy football player IDs from DynastyProcess.com

Parameters

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

Returns

Polars dataframe containing fantasy football player ID mappings across platforms.

col_nametypedescription
mfl_idintegerMyFantasyLeague.com ID - this is the primary key for this table and is unique and complete. Usually an integer of 5 digits.
sportradar_idcharacterSportRadar ID - often also called sportsdata_id by other services. A UUID.
fantasypros_idcharacterFantasyPros.com ID - usually an integer of 5 digits.
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
pff_idcharacterPro Football Focus ID - usually an integer with between 3 and 6 digits.
sleeper_idintegerSleeper ID - usually an integer with ~4 digits.
nfl_idcharacterNFL ID of player (this is used in Big Data Bowl Data)
espn_idintegerESPN ID - usual format is an integer with ~5 digits
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
fleaflicker_idcharacterFleaflicker ID - usual format is an integer with ~4 digits. Fleaflicker API also has sportradar and that's generally preferred.
cbs_idintegerCBS ID - usual format is an integer with ~ 7 digits.
pfr_idcharacterPro-Football-Reference ID for player
cfbref_idcharacterCollege Football Reference ID - usual format is firstname-lastname-integer
rotowire_idintegerRotowire ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
rotoworld_idcharacterRotoworld ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
ktc_idintegerKeepTradeCut ID - usual format is an integer with ~four digits.
stats_idintegerStats ID - usual format is five digit integer
stats_global_idintegerStats Global ID - usual format is a six digit integer
fantasy_data_idintegerFantasyData ID - usual format five digit integer
swish_idcharacterPlayer ID for Swish Analytics
namecharacterName, as reported by MFL but reordered into FirstName LastName instead of Last, First
merge_namecharacterName but formatted for name joins via ffscrapr::dp_cleannames() - coerced to lowercase, stripped of punctuation and suffixes, and common substitutions performed.
positioncharacterPrimary position as reported by NFL.com
teamcharacterNFL team. Uses official abbreviations as per NFL.com
birthdatecharacterBirthdate
agedoubleAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
draft_yearintegerYear that player was drafted
draft_roundintegerRound that player was drafted in
draft_pickintegerDraft pick within round, i.e. 32nd pick of second round.
draft_ovrintegerOverall draft pick selection. This can be a little bit patchy, since MFL does not report this number.
twitter_usernamecharacterOfficial twitter handle, if known
heightintegerOfficial height, in inches
weightintegerOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
db_seasonintegerYear of database build. Previous years may also be available via dynastyprocess.

Example

from sportsdataverse.nfl import load_nfl_ff_playerids
ids = load_nfl_ff_playerids()
ids.shape

# Filter to active QBs

import polars as pl
qbs = (
load_nfl_ff_playerids()
.filter((pl.col("position") == "QB") & (pl.col("status") == "ACT"))
)

load_ff_rankings(type: 'str' = 'draft', kind: 'str' = None, return_as_pandas=False) -> 'pl.DataFrame'

Load fantasy football rankings and projections

Parameters

ParameterTypeDefaultDescription
typestr'draft'Type of rankings to load. One of "draft" (current draft rankings), "week" (weekly rankings), or "all" (full historical rankings). Defaults to "draft". Kept for nflreadpy parity since its parameter is also called type; the forward-going preferred name is kind.
kindstrNonePreferred parameter name. Same semantics and allowed values as type. If both are supplied, kind wins. If neither is supplied, defaults to "draft" via type.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing fantasy football rankings data.

col_nametypedescription
fp_pagecharacterThe relative url that the data was scraped from (add the prefix https://www.fantasypros.com/ to visit the page)
page_typecharacterTwo word identifier separated by a dash identifying the type of fantasy ranking (best = bestball; dynasty; redraft) and what position it applies to
ecr_typecharacterA two letter identifier combining the ranking type (b = bestball; d = dynasty; r = redraft) and position type (o = overall; p = positional; sf = superflex; rk = rookie)
playercharacterPlayer name
idintegerID of the player in the 'name' column.
poscharacterPosition as tracked by FP
teamcharacterNFL team. Uses official abbreviations as per NFL.com
ecrdoubleAverage (mean) expert ranking for this player
sddoubleStandard deviation of expert rankings for this player
bestintegerThe highest ranking given for this player by any one expert
worstintegerThe lowest ranking given for this player by any one expert
sportsdata_idcharacterID - also known as sportradar_id (they are equivalent!)
player_filenamecharacterbase URL for this player on fantasypros.com
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
cbs_idcharacterCBS ID - usual format is an integer with ~ 7 digits.
player_owned_avgdoubleThe average percentage this player is rostered across ESPN and Yahoo
player_owned_espncharacterThe percentage that this player is rostered in ESPN leagues
player_owned_yahoocharacterThe percentage that this player is rostered in Yahoo leagues
player_image_urlcharacterAn image of the player
player_square_image_urlcharacterAn square image of the player
rank_deltaintegerChange in ranks over a recent period
byeintegerNFL bye week
mergenamecharacterPlayer name after being cleaned by dp_cleannames - generally strips punctuation and suffixes as well as performing common name substitutions.
scrape_datecharacterDate this dataframe was last updated
tmcharacterTeam ID as used on MyFantasyLeague.com

Example

from sportsdataverse.nfl import load_nfl_ff_rankings
draft = load_nfl_ff_rankings(kind="draft")

# Weekly rankings

weekly = load_nfl_ff_rankings(kind="week")

# Full historical rankings (parquet)

history = load_nfl_ff_rankings(kind="all")

# nflreadpy-parity ``type=`` parameter (still supported)

draft = load_nfl_ff_rankings(type="draft")

load_ftn_charting(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL FTN charting data going back to 2022

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2022 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing FTN charting data available for the requested seasons.

col_nametypedescription
ftn_game_idintegerFTN game ID
nflverse_game_idcharacternflverse identifier for games. Format is season, week, away_team, home_team
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
ftn_play_idintegerFTN play ID
nflverse_play_idintegerPlay ID used by nflverse, corresponds to GSIS play ID
starting_hashcharacterhash the ball was place(L = left, M = middle, R = right)
qb_locationcharacterpre-snap position of quarterback(U = under center, S = shotgun, P = pistol)
n_offense_backfieldintegernumber of players in the backfield at the snap
n_defense_boxinteger
is_no_huddlelogicalno huddle
is_motionlogicalmotion occurred on the play before or at the time of the snap
is_play_actionlogicalplay-action pass
is_screen_passlogicalscreen pass
is_rpologicalplay is considered run-pass option
is_trick_playlogicaltrick play
is_qb_out_of_pocketlogicalquarterback moved out of pocket
is_interception_worthylogicalinterception worthy pass
is_throw_awaylogicalquarterback thrown away
read_throwncharacterread the ball was thrown
is_catchable_balllogicalcatchable ball(defined by throws that are generally on target that are not defended away)
is_contested_balllogicalcontested ball(defined by whether or not the receiver is facing physical contact at the time of the catch)
is_created_receptionlogicalcreated reception(defined by a reception that only occurs due to an exceptional play by the receiver)
is_droplogicalreceiver drop
is_qb_sneaklogicalquarterback sneak
n_blitzersintegernumber of blitzers
n_pass_rushersintegernumber of pass rushers
is_qb_fault_sacklogicalsack that is the fault of the quarterback
date_pulledcharacterDate the data was retrieved from the FTN Data API by nflverse jobs

Example

from sportsdataverse.nfl import load_nfl_ftn_charting
charting = load_nfl_ftn_charting(seasons=[2024])

# Multi-season range

charting = load_nfl_ftn_charting(seasons=range(2022, 2025))

# Filter to plays with motion

import polars as pl
motion_plays = (
load_nfl_ftn_charting(seasons=[2024])
.filter(pl.col("is_motion") == 1)
)

load_injuries(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL injuries data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2009 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing injuries data available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
weekintegerSeason week.
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
positioncharacterPrimary position as reported by NFL.com
full_namecharacterFull name as per NFL.com
first_namecharacterFirst name of player
last_namecharacterLast name of player
report_primary_injurycharacterPrimary injury listed on official injury report
report_secondary_injurycharacterSecondary injury listed on official injury report
report_statuscharacterPlayer's status for game on official injury report
practice_primary_injurycharacterPrimary injury listed on practice injury report
practice_secondary_injurycharacterSecondary injury listed on practice injury report
practice_statuscharacterPlayer's participation in practice
date_modifiedcharacterDate and time that injury information was updated

Example

from sportsdataverse.nfl import load_nfl_injuries
injuries = load_nfl_injuries(seasons=[2024])

# Multi-season range with team filter

import polars as pl
sf_injuries = (
load_nfl_injuries(seasons=range(2020, 2025))
.filter(pl.col("team") == "SF")
)

load_nextgen_stats(seasons: 'List[int]', stat_type: 'str' = 'passing', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Load NFL NextGen Stats data going back to 2016.

Unified loader that consolidates the per-stat-type NextGen Stats accessors. Mirrors the API surface of nflreadpy's load_nextgen_stats so downstream code can swap engines without changing call sites.

Parameters

ParameterTypeDefaultDescription
seasonslist[int]Seasons to filter to. The upstream parquet covers a single combined file per stat type — seasons is applied as a post-filter on the season column.
stat_typestr'passing'One of "passing", "rushing", "receiving". Defaults to "passing".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing NextGen Stats data for the requested stat_type and seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.
player_display_namecharacterFull name of the player
player_positioncharacterPosition of the player accordinng to NGS
team_abbrcharacterOfficial team abbreveation
avg_time_to_throwdoubleAverage time elapsed from the time of snap to throw on every pass attempt for a passer (sacks excluded).
avg_completed_air_yardsdoubleAverage air yards on completed passes
avg_intended_air_yardsdoubleAverage air yards on all attempted passes
avg_air_yards_differentialdoubleAir Yards Differential is calculated by subtracting the passer's average Intended Air Yards from his average Completed Air Yards. This stat indicates if he is on average attempting deep passes than he on average completes.
aggressivenessdoubleAggressiveness tracks the amount of passing attempts a quarterback makes that are into tight coverage, where there is a defender within 1 yard or less of the receiver at the time of completion or incompletion. AGG is shown as a % of attempts into tight windows over all passing attempts.
max_completed_air_distancedoubleAir Distance is the amount of yards the ball has traveled on a pass, from the point of release to the point of reception (as the crow flies). Unlike Air Yards, Air Distance measures the actual distance the passer throws the ball.
avg_air_yards_to_sticksdoubleAir Yards to the Sticks shows the amount of Air Yards ahead or behind the first down marker on all attempts for a passer. The metric indicates if the passer is attempting his passes past the 1st down marker, or if he is relying on his skill position players to make yards after catch.
attemptsintegerThe number of pass attempts as defined by the NFL.
pass_yardsintegerNumber of yards gained on pass plays
pass_touchdownsintegerNumber of touchdowns scored on pass plays
interceptionsintegerThe number of interceptions thrown.
passer_ratingdoubleOverall NFL passer rating
completionsintegerThe number of completed passes.
completion_percentagedoublePercentage of completed passes
expected_completion_percentagedoubleUsing a passer's Completion Probability on every play, determine what a passer's completion percentage is expected to be.
completion_percentage_above_expectationdoubleA passer's actual completion percentage compared to their Expected Completion Percentage.
avg_air_distancedoubleA receiver's average depth of target
max_air_distancedoubleA receiver's maximum depth of target
player_gsis_idcharacterUnique identifier of the player
player_first_namecharacterPlayer's first name
player_last_namecharacterPlayer's last name
player_jersey_numberintegerPlayer's jersey number
player_short_namecharacterShort version of player's name

Example

from sportsdataverse.nfl import load_nfl_nextgen_stats
ngs_pass = load_nfl_nextgen_stats(seasons=[2024], stat_type="passing")

# Rushing NextGen stats

ngs_rush = load_nfl_nextgen_stats(seasons=[2024], stat_type="rushing")

# Receiving NextGen stats with a follow-up filter

import polars as pl
ngs_rec = (
load_nfl_nextgen_stats(seasons=[2024], stat_type="receiving")
.filter(pl.col("week") > 0)
)

# Pandas round-trip

ngs_pd = load_nfl_nextgen_stats(
seasons=[2024], stat_type="passing", return_as_pandas=True
)

load_nfl_combine(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Combine information

Parameters

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

Returns

Polars dataframe containing NFL combine data available.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
draft_yeardoubleYear that player was drafted
draft_teamcharacterTeam that drafted player
draft_rounddoubleRound that player was drafted in
draft_ovrdoubleOverall draft pick selection. This can be a little bit patchy, since MFL does not report this number.
pfr_idcharacterPro-Football-Reference ID for player
cfb_idcharacterSports Reference (CFB) ID for player
player_namecharacterFull name of player
poscharacterPosition as tracked by FP
schoolcharacterCollege of player
htcharacterHeight of player (feet and inches)
wtdoubleWeight of player (lbs)
fortydoublePlayer's 40 yard dash time at combine (seconds)
benchdoubleReps benched by player at combine
verticaldoublePlayer's vertical jump at combine (inches)
broad_jumpdoublePlayer's broad jump at combine (inches)
conedoublePlayer's 3 cone drill time at combine (seconds)
shuttledoublePlayer's shuttle run time at combine (seconds)

Example

from sportsdataverse.nfl import load_nfl_combine
combine = load_nfl_combine()
combine.shape

# Filter by draft year and position

import polars as pl
qbs_2024 = (
load_nfl_combine()
.filter((pl.col("season") == 2024) & (pl.col("pos") == "QB"))
)

load_nfl_contracts(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Historical contracts information

Parameters

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

Returns

Polars dataframe containing historical contracts available.

col_nametypedescription
playercharacterPlayer name
positioncharacterPrimary position as reported by NFL.com
teamcharacterNFL team. Uses official abbreviations as per NFL.com
is_activelogicalActive contract
year_signedintegerYear the contract was signed
yearsintegerContract length
valuedoubleTotal contract value
apydoubleAverage money per contract year
guaranteeddoubleTotal guaranteed money
apy_cap_pctdoubleAverage money per contract year as percentage of the team's salary cap at signing
inflated_valuedoubleTotal contract value inflated to account for the rise of the salary cap
inflated_apydoubleAverage money per contract year inflated to account for the rise of the salary cap
inflated_guaranteeddoubleTotal guaranteed money inflated to account for the rise of the salary cap
player_pagecharacterPlayer's OverTheCap url
otc_idintegerOver the Cap ID for player
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
date_of_birthcharacterDate of birth (YYYY-MM-DD).
heightcharacterOfficial height, in inches
weightcharacterOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
draft_yearintegerYear that player was drafted
draft_roundintegerRound that player was drafted in
draft_overallintegerOverall draft selection number.
draft_teamcharacterTeam that drafted player
colsdouble

Example

from sportsdataverse.nfl import load_nfl_contracts
contracts = load_nfl_contracts()
contracts.shape

# Pandas round-trip with sort by APY

contracts_pd = load_nfl_contracts(return_as_pandas=True)
contracts_pd.sort_values("apy", ascending=False).head()

load_nfl_depth_charts(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Depth Chart data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2001 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing depth chart data available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
club_codecharacter
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
depth_teamcharacter
last_namecharacterLast name of player
first_namecharacterFirst name of player
football_namecharacterCommon player name (i.e. in most cases common_first_name last_name)
formationcharacter
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
jersey_numbercharacterJersey number. Often useful for joins by name/team/jersey.
positioncharacterPrimary position as reported by NFL.com
elias_idcharacter
depth_positioncharacter
full_namecharacterFull name as per NFL.com

Example

from sportsdataverse.nfl import load_nfl_depth_charts
depth = load_nfl_depth_charts(seasons=[2024])

# Multi-season range

depth = load_nfl_depth_charts(seasons=range(2020, 2025))

load_nfl_draft_picks(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Draft picks information

Parameters

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

Returns

Polars dataframe containing NFL Draft picks data available.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
roundintegerDraft round
pickintegerDraft overall pick
teamcharacterNFL team. Uses official abbreviations as per NFL.com
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
pfr_player_idcharacterID from Pro Football Reference
cfb_player_idcharacterID from College Football Reference
pfr_player_namecharacterPlayer's name as recorded by PFR
hoflogicalWhether player has been selected to the Pro Football Hall of Fame
positioncharacterPrimary position as reported by NFL.com
categorycharacterBroader category of player positions
sidecharacterO for offense, D for defense, S for special teams
collegecharacterOfficial college (usually the last one attended)
ageintegerAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
tointegerFinal season played in NFL
allprointegerNumber of AP First Team All-Pro selections as recorded by PFR
probowlsintegerNumber of Pro Bowls
seasons_startedintegerNumber of seasons recorded as primary starter for position
w_avintegerWeighted Approximate Value
car_avlogicalCareer Approximate Value
dr_avintegerDraft Approximate Value
gamesintegerGames played in career
pass_completionsintegerNumber of successful completions for a given game
pass_attemptsintegerCareer pass attempts
pass_yardsintegerNumber of yards gained on pass plays
pass_tdsintegerCareer pass touchdowns thrown
pass_intsintegerCareer pass interceptions thrown
rush_attsintegerCareer rushing attempts
rush_yardsintegerThe number of rushing yards gained
rush_tdsintegerCareer rushing touchdowns
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
rec_yardsintegerCareer receiving yards
rec_tdsintegerCareer receiving touchdowns
def_solo_tacklesintegerCareer solo tackles
def_intsintegerCareer interceptions
def_sacksdoubleNumber of sacks form this player

Example

from sportsdataverse.nfl import load_nfl_draft_picks
picks = load_nfl_draft_picks()
picks.shape

# Filter to a single year and round

import polars as pl
r1_2024 = (
load_nfl_draft_picks()
.filter((pl.col("season") == 2024) & (pl.col("round") == 1))
)

load_nfl_ff_opportunity(seasons: 'List[int]', stat_type: 'str' = 'weekly', model_version: 'str' = 'latest', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL fantasy football opportunity data from ffverse/ffopportunity

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2006 is the earliest available season.
stat_typestr'weekly'One of "weekly", "pbp_pass", "pbp_rush". Defaults to "weekly".
model_versionstr'latest'One of "latest", "v1.0.0". Defaults to "latest".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing fantasy football opportunity data for the requested seasons.

col_nametypedescription
seasoncharacter4 digit number indicating to which season(s) the specified timeframe belongs to.
posteamcharacterString abbreviation for the team with possession.
weekdoubleSeason week.
game_idcharacterTen digit identifier for NFL game.
player_idcharacterPlayer ID (aka GSIS ID) as defined by nflreadr::load_rosters
full_namecharacterFull name as per NFL.com
positioncharacterPrimary position as reported by NFL.com
pass_attemptdoubleBinary indicator for if the play was a pass attempt (includes sacks).
rec_attemptdoubleTotal number of targets for a given game
rush_attemptdoubleBinary indicator for if the play was a run.
pass_air_yardsdoubleTotal air yards thrown for a given game
rec_air_yardsdoubleTotal air yards on receiving attempts for a given game
pass_completionsdoubleNumber of successful completions for a given game
receptionsdoubleThe number of pass receptions. Lateral receptions officially don't count as reception.
pass_completions_expdoubleExpected number of pass_completions in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
receptions_expdoubleExpected number of receptions in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_yards_gaineddoubleTotal passing yards gained for a given game
rec_yards_gaineddoubleTotal receiving yards gained for a given game
rush_yards_gaineddoubleTotal rushing yards gained for a given game
pass_yards_gained_expdoubleExpected number of pass_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_yards_gained_expdoubleExpected number of rec_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_yards_gained_expdoubleExpected number of rush_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_touchdowndoubleBinary indicator for if the play resulted in a passing TD.
rec_touchdowndoubleTotal receiving touchdowns
rush_touchdowndoubleBinary indicator for if the play resulted in a rushing TD.
pass_touchdown_expdoubleExpected number of pass_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_touchdown_expdoubleExpected number of rec_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_touchdown_expdoubleExpected number of rush_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_two_point_convdoubleNumber of successful passing two point conversions
rec_two_point_convdoubleNumber of successful receiving two point conversions
rush_two_point_convdoubleNumber of successful rushing two point conversions
pass_two_point_conv_expdoubleExpected number of pass_two_point_conv in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_two_point_conv_expdoubleExpected number of rec_two_point_conv in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_two_point_conv_expdoubleExpected number of rush_two_point_conv in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_first_downdoubleNumber of passing first downs
rec_first_downdoubleNumber of receiving first downs
rush_first_downdoubleNumber of rushing first downs
pass_first_down_expdoubleExpected number of pass_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_first_down_expdoubleExpected number of rec_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_first_down_expdoubleExpected number of rush_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_interceptiondoubleNumber of interceptions thrown
rec_interceptiondoubleNumber of interceptions on targets
pass_interception_expdoubleExpected number of pass_interception in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_interception_expdoubleExpected number of rec_interception in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_fumble_lostdoubleNumber of fumbles on receiving attempts
rush_fumble_lostdoubleNumber of fumbles on rushing attempts
pass_fantasy_points_expdoubleExpected number of pass_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rec_fantasy_points_expdoubleExpected number of rec_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
rush_fantasy_points_expdoubleExpected number of rush_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_fantasy_pointsdoubleTotal fantasy points from passing, assuming 0.04 points per pass yard, 4 points per pass TD, -2 points per interception
rec_fantasy_pointsdoubleTotal fantasy points from receiving, assuming PPR scoring
rush_fantasy_pointsdoubleTotal fantasy points from rushing, assuming PPR scoring
total_yards_gaineddoubleTotal scrimmage yards (sum of pass, rush, and receiving yards)
total_yards_gained_expdoubleExpected number of total_yards_gained in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
total_touchdowndoubleTotal touchdowns (sum of pass, rush, and receiving touchdowns)
total_touchdown_expdoubleExpected number of total_touchdown in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
total_first_downdoubleTotal first downs (sum of pass, rush, and receiving first downs)
total_first_down_expdoubleExpected number of total_first_down in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
total_fantasy_pointsdoubleTotal fantasy points (sum of pass, rush, and receiving fantasy points)
total_fantasy_points_expdoubleExpected number of total_fantasy_points in this game (weekly) or on this play (pbp_rush/pbp_pass) given situation
pass_completions_diffdoubleDifference between actual and expected number of pass_completions - often interpreted as efficiency for a given play/game
receptions_diffdoubleDifference between actual and expected number of receptions - often interpreted as efficiency for a given play/game
pass_yards_gained_diffdoubleDifference between actual and expected number of pass_yards_gained - often interpreted as efficiency for a given play/game
rec_yards_gained_diffdoubleDifference between actual and expected number of rec_yards_gained - often interpreted as efficiency for a given play/game
rush_yards_gained_diffdoubleDifference between actual and expected number of rush_yards_gained - often interpreted as efficiency for a given play/game
pass_touchdown_diffdoubleDifference between actual and expected number of pass_touchdown - often interpreted as efficiency for a given play/game
rec_touchdown_diffdoubleDifference between actual and expected number of rec_touchdown - often interpreted as efficiency for a given play/game
rush_touchdown_diffdoubleDifference between actual and expected number of rush_touchdown - often interpreted as efficiency for a given play/game
pass_two_point_conv_diffdoubleDifference between actual and expected number of pass_two_point_conv - often interpreted as efficiency for a given play/game
rec_two_point_conv_diffdoubleDifference between actual and expected number of rec_two_point_conv - often interpreted as efficiency for a given play/game
rush_two_point_conv_diffdoubleDifference between actual and expected number of rush_two_point_conv - often interpreted as efficiency for a given play/game
pass_first_down_diffdoubleDifference between actual and expected number of pass_first_down - often interpreted as efficiency for a given play/game
rec_first_down_diffdoubleDifference between actual and expected number of rec_first_down - often interpreted as efficiency for a given play/game
rush_first_down_diffdoubleDifference between actual and expected number of rush_first_down - often interpreted as efficiency for a given play/game
pass_interception_diffdoubleDifference between actual and expected number of pass_interception - often interpreted as efficiency for a given play/game
rec_interception_diffdoubleDifference between actual and expected number of rec_interception - often interpreted as efficiency for a given play/game
pass_fantasy_points_diffdoubleDifference between actual and expected number of pass_fantasy_points - often interpreted as efficiency for a given play/game
rec_fantasy_points_diffdoubleDifference between actual and expected number of rec_fantasy_points - often interpreted as efficiency for a given play/game
rush_fantasy_points_diffdoubleDifference between actual and expected number of rush_fantasy_points - often interpreted as efficiency for a given play/game
total_yards_gained_diffdoubleDifference between actual and expected number of total_yards_gained - often interpreted as efficiency for a given play/game
total_touchdown_diffdoubleDifference between actual and expected number of total_touchdown - often interpreted as efficiency for a given play/game
total_first_down_diffdoubleDifference between actual and expected number of total_first_down - often interpreted as efficiency for a given play/game
total_fantasy_points_diffdoubleDifference between actual and expected number of total_fantasy_points - often interpreted as efficiency for a given play/game
pass_attempt_teamdoubleTeam-level total pass_attempt for a game, summed across all plays/players for that team.
rec_attempt_teamdoubleTeam-level total rec_attempt for a game, summed across all plays/players for that team.
rush_attempt_teamdoubleTeam-level total rush_attempt for a game, summed across all plays/players for that team.
pass_air_yards_teamdoubleTeam-level total pass_air_yards for a game, summed across all plays/players for that team.
rec_air_yards_teamdoubleTeam-level total rec_air_yards for a game, summed across all plays/players for that team.
pass_completions_teamdoubleTeam-level total pass_completions for a game, summed across all plays/players for that team.
receptions_teamdoubleTeam-level total receptions for a game, summed across all plays/players for that team.
pass_completions_exp_teamdoubleTeam-level total expected pass_completions_exp for a game, summed across all plays & players for that team.
receptions_exp_teamdoubleTeam-level total expected receptions_exp for a game, summed across all plays & players for that team.
pass_yards_gained_teamdoubleTeam-level total pass_yards_gained for a game, summed across all plays/players for that team.
rec_yards_gained_teamdoubleTeam-level total rec_yards_gained for a game, summed across all plays/players for that team.
rush_yards_gained_teamdoubleTeam-level total rush_yards_gained for a game, summed across all plays/players for that team.
pass_yards_gained_exp_teamdoubleTeam-level total expected pass_yards_gained_exp for a game, summed across all plays & players for that team.
rec_yards_gained_exp_teamdoubleTeam-level total expected rec_yards_gained_exp for a game, summed across all plays & players for that team.
rush_yards_gained_exp_teamdoubleTeam-level total expected rush_yards_gained_exp for a game, summed across all plays & players for that team.
pass_touchdown_teamdoubleTeam-level total pass_touchdown for a game, summed across all plays/players for that team.
rec_touchdown_teamdoubleTeam-level total rec_touchdown for a game, summed across all plays/players for that team.
rush_touchdown_teamdoubleTeam-level total rush_touchdown for a game, summed across all plays/players for that team.
pass_touchdown_exp_teamdoubleTeam-level total expected pass_touchdown_exp for a game, summed across all plays & players for that team.
rec_touchdown_exp_teamdoubleTeam-level total expected rec_touchdown_exp for a game, summed across all plays & players for that team.
rush_touchdown_exp_teamdoubleTeam-level total expected rush_touchdown_exp for a game, summed across all plays & players for that team.
pass_two_point_conv_teamdoubleTeam-level total pass_two_point_conv for a game, summed across all plays/players for that team.
rec_two_point_conv_teamdoubleTeam-level total rec_two_point_conv for a game, summed across all plays/players for that team.
rush_two_point_conv_teamdoubleTeam-level total rush_two_point_conv for a game, summed across all plays/players for that team.
pass_two_point_conv_exp_teamdoubleTeam-level total expected pass_two_point_conv_exp for a game, summed across all plays & players for that team.
rec_two_point_conv_exp_teamdoubleTeam-level total expected rec_two_point_conv_exp for a game, summed across all plays & players for that team.
rush_two_point_conv_exp_teamdoubleTeam-level total expected rush_two_point_conv_exp for a game, summed across all plays & players for that team.
pass_first_down_teamdoubleTeam-level total pass_first_down for a game, summed across all plays/players for that team.
rec_first_down_teamdoubleTeam-level total rec_first_down for a game, summed across all plays/players for that team.
rush_first_down_teamdoubleTeam-level total rush_first_down for a game, summed across all plays/players for that team.
pass_first_down_exp_teamdoubleTeam-level total expected pass_first_down_exp for a game, summed across all plays & players for that team.
rec_first_down_exp_teamdoubleTeam-level total expected rec_first_down_exp for a game, summed across all plays & players for that team.
rush_first_down_exp_teamdoubleTeam-level total expected rush_first_down_exp for a game, summed across all plays & players for that team.
pass_interception_teamdoubleTeam-level total pass_interception for a game, summed across all plays/players for that team.
rec_interception_teamdoubleTeam-level total rec_interception for a game, summed across all plays/players for that team.
pass_interception_exp_teamdoubleTeam-level total expected pass_interception_exp for a game, summed across all plays & players for that team.
rec_interception_exp_teamdoubleTeam-level total expected rec_interception_exp for a game, summed across all plays & players for that team.
rec_fumble_lost_teamdoubleTeam-level total rec_fumble_lost for a game, summed across all plays/players for that team.
rush_fumble_lost_teamdoubleTeam-level total rush_fumble_lost for a game, summed across all plays/players for that team.
pass_fantasy_points_exp_teamdoubleTeam-level total expected pass_fantasy_points_exp for a game, summed across all plays & players for that team.
rec_fantasy_points_exp_teamdoubleTeam-level total expected rec_fantasy_points_exp for a game, summed across all plays & players for that team.
rush_fantasy_points_exp_teamdoubleTeam-level total expected rush_fantasy_points_exp for a game, summed across all plays & players for that team.
pass_fantasy_points_teamdoubleTeam-level total pass_fantasy_points for a game, summed across all plays/players for that team.
rec_fantasy_points_teamdoubleTeam-level total rec_fantasy_points for a game, summed across all plays/players for that team.
rush_fantasy_points_teamdoubleTeam-level total rush_fantasy_points for a game, summed across all plays/players for that team.
pass_completions_diff_teamdoubleTeam-level difference between actual and expected number of pass_completions_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
receptions_diff_teamdoubleTeam-level difference between actual and expected number of receptions_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of pass_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of rec_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of rush_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of pass_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of rec_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of rush_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_two_point_conv_diff_teamdoubleTeam-level difference between actual and expected number of pass_two_point_conv_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_two_point_conv_diff_teamdoubleTeam-level difference between actual and expected number of rec_two_point_conv_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_two_point_conv_diff_teamdoubleTeam-level difference between actual and expected number of rush_two_point_conv_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_first_down_diff_teamdoubleTeam-level difference between actual and expected number of pass_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_first_down_diff_teamdoubleTeam-level difference between actual and expected number of rec_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_first_down_diff_teamdoubleTeam-level difference between actual and expected number of rush_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_interception_diff_teamdoubleTeam-level difference between actual and expected number of pass_interception_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_interception_diff_teamdoubleTeam-level difference between actual and expected number of rec_interception_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
pass_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of pass_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rec_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of rec_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
rush_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of rush_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_yards_gained_teamdoubleTeam-level total total_yards_gained for a game, summed across all plays/players for that team.
total_yards_gained_exp_teamdoubleTeam-level total expected total_yards_gained_exp for a game, summed across all plays & players for that team.
total_yards_gained_diff_teamdoubleTeam-level difference between actual and expected number of total_yards_gained_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_touchdown_teamdoubleTeam-level total total_touchdown for a game, summed across all plays/players for that team.
total_touchdown_exp_teamdoubleTeam-level total expected total_touchdown_exp for a game, summed across all plays & players for that team.
total_touchdown_diff_teamdoubleTeam-level difference between actual and expected number of total_touchdown_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_first_down_teamdoubleTeam-level total total_first_down for a game, summed across all plays/players for that team.
total_first_down_exp_teamdoubleTeam-level total expected total_first_down_exp for a game, summed across all plays & players for that team.
total_first_down_diff_teamdoubleTeam-level difference between actual and expected number of total_first_down_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.
total_fantasy_points_teamdoubleTeam-level total total_fantasy_points for a game, summed across all plays/players for that team.
total_fantasy_points_exp_teamdoubleTeam-level total expected total_fantasy_points_exp for a game, summed across all plays & players for that team.
total_fantasy_points_diff_teamdoubleTeam-level difference between actual and expected number of total_fantasy_points_diff for a game, summed across all plays/players for that team. Often interpreted as team-level efficiency.

Example

from sportsdataverse.nfl import load_nfl_ff_opportunity
weekly = load_nfl_ff_opportunity(seasons=[2024])

# Pass play-by-play opportunity stats

pbp_pass = load_nfl_ff_opportunity(seasons=[2024], stat_type="pbp_pass")

# Rush play-by-play opportunity stats with pinned model version

pbp_rush = load_nfl_ff_opportunity(
seasons=[2024], stat_type="pbp_rush", model_version="v1.0.0"
)

load_nfl_ff_playerids(return_as_pandas=False) -> 'pl.DataFrame'

Load fantasy football player IDs from DynastyProcess.com

Parameters

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

Returns

Polars dataframe containing fantasy football player ID mappings across platforms.

col_nametypedescription
mfl_idintegerMyFantasyLeague.com ID - this is the primary key for this table and is unique and complete. Usually an integer of 5 digits.
sportradar_idcharacterSportRadar ID - often also called sportsdata_id by other services. A UUID.
fantasypros_idcharacterFantasyPros.com ID - usually an integer of 5 digits.
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
pff_idcharacterPro Football Focus ID - usually an integer with between 3 and 6 digits.
sleeper_idintegerSleeper ID - usually an integer with ~4 digits.
nfl_idcharacterNFL ID of player (this is used in Big Data Bowl Data)
espn_idintegerESPN ID - usual format is an integer with ~5 digits
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
fleaflicker_idcharacterFleaflicker ID - usual format is an integer with ~4 digits. Fleaflicker API also has sportradar and that's generally preferred.
cbs_idintegerCBS ID - usual format is an integer with ~ 7 digits.
pfr_idcharacterPro-Football-Reference ID for player
cfbref_idcharacterCollege Football Reference ID - usual format is firstname-lastname-integer
rotowire_idintegerRotowire ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
rotoworld_idcharacterRotoworld ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
ktc_idintegerKeepTradeCut ID - usual format is an integer with ~four digits.
stats_idintegerStats ID - usual format is five digit integer
stats_global_idintegerStats Global ID - usual format is a six digit integer
fantasy_data_idintegerFantasyData ID - usual format five digit integer
swish_idcharacterPlayer ID for Swish Analytics
namecharacterName, as reported by MFL but reordered into FirstName LastName instead of Last, First
merge_namecharacterName but formatted for name joins via ffscrapr::dp_cleannames() - coerced to lowercase, stripped of punctuation and suffixes, and common substitutions performed.
positioncharacterPrimary position as reported by NFL.com
teamcharacterNFL team. Uses official abbreviations as per NFL.com
birthdatecharacterBirthdate
agedoubleAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
draft_yearintegerYear that player was drafted
draft_roundintegerRound that player was drafted in
draft_pickintegerDraft pick within round, i.e. 32nd pick of second round.
draft_ovrintegerOverall draft pick selection. This can be a little bit patchy, since MFL does not report this number.
twitter_usernamecharacterOfficial twitter handle, if known
heightintegerOfficial height, in inches
weightintegerOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
db_seasonintegerYear of database build. Previous years may also be available via dynastyprocess.

Example

from sportsdataverse.nfl import load_nfl_ff_playerids
ids = load_nfl_ff_playerids()
ids.shape

# Filter to active QBs

import polars as pl
qbs = (
load_nfl_ff_playerids()
.filter((pl.col("position") == "QB") & (pl.col("status") == "ACT"))
)

load_nfl_ff_rankings(type: 'str' = 'draft', kind: 'str' = None, return_as_pandas=False) -> 'pl.DataFrame'

Load fantasy football rankings and projections

Parameters

ParameterTypeDefaultDescription
typestr'draft'Type of rankings to load. One of "draft" (current draft rankings), "week" (weekly rankings), or "all" (full historical rankings). Defaults to "draft". Kept for nflreadpy parity since its parameter is also called type; the forward-going preferred name is kind.
kindstrNonePreferred parameter name. Same semantics and allowed values as type. If both are supplied, kind wins. If neither is supplied, defaults to "draft" via type.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing fantasy football rankings data.

col_nametypedescription
fp_pagecharacterThe relative url that the data was scraped from (add the prefix https://www.fantasypros.com/ to visit the page)
page_typecharacterTwo word identifier separated by a dash identifying the type of fantasy ranking (best = bestball; dynasty; redraft) and what position it applies to
ecr_typecharacterA two letter identifier combining the ranking type (b = bestball; d = dynasty; r = redraft) and position type (o = overall; p = positional; sf = superflex; rk = rookie)
playercharacterPlayer name
idintegerID of the player in the 'name' column.
poscharacterPosition as tracked by FP
teamcharacterNFL team. Uses official abbreviations as per NFL.com
ecrdoubleAverage (mean) expert ranking for this player
sddoubleStandard deviation of expert rankings for this player
bestintegerThe highest ranking given for this player by any one expert
worstintegerThe lowest ranking given for this player by any one expert
sportsdata_idcharacterID - also known as sportradar_id (they are equivalent!)
player_filenamecharacterbase URL for this player on fantasypros.com
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
cbs_idcharacterCBS ID - usual format is an integer with ~ 7 digits.
player_owned_avgdoubleThe average percentage this player is rostered across ESPN and Yahoo
player_owned_espncharacterThe percentage that this player is rostered in ESPN leagues
player_owned_yahoocharacterThe percentage that this player is rostered in Yahoo leagues
player_image_urlcharacterAn image of the player
player_square_image_urlcharacterAn square image of the player
rank_deltaintegerChange in ranks over a recent period
byeintegerNFL bye week
mergenamecharacterPlayer name after being cleaned by dp_cleannames - generally strips punctuation and suffixes as well as performing common name substitutions.
scrape_datecharacterDate this dataframe was last updated
tmcharacterTeam ID as used on MyFantasyLeague.com

Example

from sportsdataverse.nfl import load_nfl_ff_rankings
draft = load_nfl_ff_rankings(kind="draft")

# Weekly rankings

weekly = load_nfl_ff_rankings(kind="week")

# Full historical rankings (parquet)

history = load_nfl_ff_rankings(kind="all")

# nflreadpy-parity ``type=`` parameter (still supported)

draft = load_nfl_ff_rankings(type="draft")

load_nfl_ftn_charting(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL FTN charting data going back to 2022

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2022 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing FTN charting data available for the requested seasons.

col_nametypedescription
ftn_game_idintegerFTN game ID
nflverse_game_idcharacternflverse identifier for games. Format is season, week, away_team, home_team
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
ftn_play_idintegerFTN play ID
nflverse_play_idintegerPlay ID used by nflverse, corresponds to GSIS play ID
starting_hashcharacterhash the ball was place(L = left, M = middle, R = right)
qb_locationcharacterpre-snap position of quarterback(U = under center, S = shotgun, P = pistol)
n_offense_backfieldintegernumber of players in the backfield at the snap
n_defense_boxinteger
is_no_huddlelogicalno huddle
is_motionlogicalmotion occurred on the play before or at the time of the snap
is_play_actionlogicalplay-action pass
is_screen_passlogicalscreen pass
is_rpologicalplay is considered run-pass option
is_trick_playlogicaltrick play
is_qb_out_of_pocketlogicalquarterback moved out of pocket
is_interception_worthylogicalinterception worthy pass
is_throw_awaylogicalquarterback thrown away
read_throwncharacterread the ball was thrown
is_catchable_balllogicalcatchable ball(defined by throws that are generally on target that are not defended away)
is_contested_balllogicalcontested ball(defined by whether or not the receiver is facing physical contact at the time of the catch)
is_created_receptionlogicalcreated reception(defined by a reception that only occurs due to an exceptional play by the receiver)
is_droplogicalreceiver drop
is_qb_sneaklogicalquarterback sneak
n_blitzersintegernumber of blitzers
n_pass_rushersintegernumber of pass rushers
is_qb_fault_sacklogicalsack that is the fault of the quarterback
date_pulledcharacterDate the data was retrieved from the FTN Data API by nflverse jobs

Example

from sportsdataverse.nfl import load_nfl_ftn_charting
charting = load_nfl_ftn_charting(seasons=[2024])

# Multi-season range

charting = load_nfl_ftn_charting(seasons=range(2022, 2025))

# Filter to plays with motion

import polars as pl
motion_plays = (
load_nfl_ftn_charting(seasons=[2024])
.filter(pl.col("is_motion") == 1)
)

load_nfl_injuries(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL injuries data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2009 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing injuries data available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
weekintegerSeason week.
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
positioncharacterPrimary position as reported by NFL.com
full_namecharacterFull name as per NFL.com
first_namecharacterFirst name of player
last_namecharacterLast name of player
report_primary_injurycharacterPrimary injury listed on official injury report
report_secondary_injurycharacterSecondary injury listed on official injury report
report_statuscharacterPlayer's status for game on official injury report
practice_primary_injurycharacterPrimary injury listed on practice injury report
practice_secondary_injurycharacterSecondary injury listed on practice injury report
practice_statuscharacterPlayer's participation in practice
date_modifiedcharacterDate and time that injury information was updated

Example

from sportsdataverse.nfl import load_nfl_injuries
injuries = load_nfl_injuries(seasons=[2024])

# Multi-season range with team filter

import polars as pl
sf_injuries = (
load_nfl_injuries(seasons=range(2020, 2025))
.filter(pl.col("team") == "SF")
)

load_nfl_nextgen_stats(seasons: 'List[int]', stat_type: 'str' = 'passing', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Load NFL NextGen Stats data going back to 2016.

Unified loader that consolidates the per-stat-type NextGen Stats accessors. Mirrors the API surface of nflreadpy's load_nextgen_stats so downstream code can swap engines without changing call sites.

Parameters

ParameterTypeDefaultDescription
seasonslist[int]Seasons to filter to. The upstream parquet covers a single combined file per stat type — seasons is applied as a post-filter on the season column.
stat_typestr'passing'One of "passing", "rushing", "receiving". Defaults to "passing".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing NextGen Stats data for the requested stat_type and seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.
player_display_namecharacterFull name of the player
player_positioncharacterPosition of the player accordinng to NGS
team_abbrcharacterOfficial team abbreveation
avg_time_to_throwdoubleAverage time elapsed from the time of snap to throw on every pass attempt for a passer (sacks excluded).
avg_completed_air_yardsdoubleAverage air yards on completed passes
avg_intended_air_yardsdoubleAverage air yards on all attempted passes
avg_air_yards_differentialdoubleAir Yards Differential is calculated by subtracting the passer's average Intended Air Yards from his average Completed Air Yards. This stat indicates if he is on average attempting deep passes than he on average completes.
aggressivenessdoubleAggressiveness tracks the amount of passing attempts a quarterback makes that are into tight coverage, where there is a defender within 1 yard or less of the receiver at the time of completion or incompletion. AGG is shown as a % of attempts into tight windows over all passing attempts.
max_completed_air_distancedoubleAir Distance is the amount of yards the ball has traveled on a pass, from the point of release to the point of reception (as the crow flies). Unlike Air Yards, Air Distance measures the actual distance the passer throws the ball.
avg_air_yards_to_sticksdoubleAir Yards to the Sticks shows the amount of Air Yards ahead or behind the first down marker on all attempts for a passer. The metric indicates if the passer is attempting his passes past the 1st down marker, or if he is relying on his skill position players to make yards after catch.
attemptsintegerThe number of pass attempts as defined by the NFL.
pass_yardsintegerNumber of yards gained on pass plays
pass_touchdownsintegerNumber of touchdowns scored on pass plays
interceptionsintegerThe number of interceptions thrown.
passer_ratingdoubleOverall NFL passer rating
completionsintegerThe number of completed passes.
completion_percentagedoublePercentage of completed passes
expected_completion_percentagedoubleUsing a passer's Completion Probability on every play, determine what a passer's completion percentage is expected to be.
completion_percentage_above_expectationdoubleA passer's actual completion percentage compared to their Expected Completion Percentage.
avg_air_distancedoubleA receiver's average depth of target
max_air_distancedoubleA receiver's maximum depth of target
player_gsis_idcharacterUnique identifier of the player
player_first_namecharacterPlayer's first name
player_last_namecharacterPlayer's last name
player_jersey_numberintegerPlayer's jersey number
player_short_namecharacterShort version of player's name

Example

from sportsdataverse.nfl import load_nfl_nextgen_stats
ngs_pass = load_nfl_nextgen_stats(seasons=[2024], stat_type="passing")

# Rushing NextGen stats

ngs_rush = load_nfl_nextgen_stats(seasons=[2024], stat_type="rushing")

# Receiving NextGen stats with a follow-up filter

import polars as pl
ngs_rec = (
load_nfl_nextgen_stats(seasons=[2024], stat_type="receiving")
.filter(pl.col("week") > 0)
)

# Pandas round-trip

ngs_pd = load_nfl_nextgen_stats(
seasons=[2024], stat_type="passing", return_as_pandas=True
)

load_nfl_ngs_passing(seasons: 'List[int]' = None, return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_nextgen_stats(stat_type='passing').

Will be removed in a future release. Migrate callers to the unified load_nfl_nextgen_stats function.

Parameters

ParameterTypeDefaultDescription
seasonsList[int]None
return_as_pandasboolFalse

Returns

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.
player_display_namecharacterFull name of the player
player_positioncharacterPosition of the player accordinng to NGS
team_abbrcharacterOfficial team abbreveation
avg_time_to_throwdoubleAverage time elapsed from the time of snap to throw on every pass attempt for a passer (sacks excluded).
avg_completed_air_yardsdoubleAverage air yards on completed passes
avg_intended_air_yardsdoubleAverage air yards on all attempted passes
avg_air_yards_differentialdoubleAir Yards Differential is calculated by subtracting the passer's average Intended Air Yards from his average Completed Air Yards. This stat indicates if he is on average attempting deep passes than he on average completes.
aggressivenessdoubleAggressiveness tracks the amount of passing attempts a quarterback makes that are into tight coverage, where there is a defender within 1 yard or less of the receiver at the time of completion or incompletion. AGG is shown as a % of attempts into tight windows over all passing attempts.
max_completed_air_distancedoubleAir Distance is the amount of yards the ball has traveled on a pass, from the point of release to the point of reception (as the crow flies). Unlike Air Yards, Air Distance measures the actual distance the passer throws the ball.
avg_air_yards_to_sticksdoubleAir Yards to the Sticks shows the amount of Air Yards ahead or behind the first down marker on all attempts for a passer. The metric indicates if the passer is attempting his passes past the 1st down marker, or if he is relying on his skill position players to make yards after catch.
attemptsintegerThe number of pass attempts as defined by the NFL.
pass_yardsintegerNumber of yards gained on pass plays
pass_touchdownsintegerNumber of touchdowns scored on pass plays
interceptionsintegerThe number of interceptions thrown.
passer_ratingdoubleOverall NFL passer rating
completionsintegerThe number of completed passes.
completion_percentagedoublePercentage of completed passes
expected_completion_percentagedoubleUsing a passer's Completion Probability on every play, determine what a passer's completion percentage is expected to be.
completion_percentage_above_expectationdoubleA passer's actual completion percentage compared to their Expected Completion Percentage.
avg_air_distancedoubleA receiver's average depth of target
max_air_distancedoubleA receiver's maximum depth of target
player_gsis_idcharacterUnique identifier of the player
player_first_namecharacterPlayer's first name
player_last_namecharacterPlayer's last name
player_jersey_numberintegerPlayer's jersey number
player_short_namecharacterShort version of player's name

Example

from sportsdataverse.nfl import load_nfl_nextgen_stats
ngs = load_nfl_nextgen_stats(seasons=[2024], stat_type="passing")

load_nfl_ngs_receiving(seasons: 'List[int]' = None, return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_nextgen_stats(stat_type='receiving').

Will be removed in a future release. Migrate callers to the unified load_nfl_nextgen_stats function.

Parameters

ParameterTypeDefaultDescription
seasonsList[int]None
return_as_pandasboolFalse

Returns

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.
player_display_namecharacterFull name of the player
player_positioncharacterPosition of the player accordinng to NGS
team_abbrcharacterOfficial team abbreveation
avg_cushiondoubleThe distance (in yards) measured between a WR/TE and the defender they're lined up against at the time of snap on all targets.
avg_separationdoubleThe distance (in yards) measured between a WR/TE and the nearest defender at the time of catch or incompletion.
avg_intended_air_yardsdoubleAverage air yards on all attempted passes
percent_share_of_intended_air_yardsdoubleThe sum of the receivers total intended air yards (all attempts) over the sum of his team's total intended air yards. Represented as a percentage, this statistic represents how much of a team's deep yards does the player account for.
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
targetsintegerThe number of pass plays where the player was the targeted receiver.
catch_percentagedoublePercentage of caught passes relative to targets
yardsintegerThe number of receiving yards
rec_touchdownsintegerThe number of touchdown receptions
avg_yacdoubleAverage yards gained after catch by a receiver.
avg_expected_yacdoubleAverage expected yards after catch, based on numerous factors using tracking data such as how open the receiver is, how fast they're traveling, how many defenders/blockers are in space, etc
avg_yac_above_expectationdoubleA receiver's YAC compared to their Expected YAC.
player_gsis_idcharacterUnique identifier of the player
player_first_namecharacterPlayer's first name
player_last_namecharacterPlayer's last name
player_jersey_numberintegerPlayer's jersey number
player_short_namecharacterShort version of player's name

Example

from sportsdataverse.nfl import load_nfl_nextgen_stats
ngs = load_nfl_nextgen_stats(seasons=[2024], stat_type="receiving")

load_nfl_ngs_rushing(seasons: 'List[int]' = None, return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_nextgen_stats(stat_type='rushing').

Will be removed in a future release. Migrate callers to the unified load_nfl_nextgen_stats function.

Parameters

ParameterTypeDefaultDescription
seasonsList[int]None
return_as_pandasboolFalse

Returns

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.
player_display_namecharacterFull name of the player
player_positioncharacterPosition of the player accordinng to NGS
team_abbrcharacterOfficial team abbreveation
efficiencydoubleRushing efficiency is calculated by taking the total distance a player traveled on rushing plays as a ball carrier according to Next Gen Stats (measured in yards) per rushing yards gained. The lower the number, the more of a North/South runner.
percent_attempts_gte_eight_defendersdoubleOn every play, Next Gen Stats calculates how many defenders are stacked in the box at snap. Using that logic, DIB% calculates how often does a rusher see 8 or more defenders in the box against them.
avg_time_to_losdoubleNext Gen Stats measures the amount of time a ball carrier spends (measured to the 10th of a second) before crossing the Line of Scrimmage. TLOS is the average time behind the LOS on all rushing plays where the player is the rusher.
rush_attemptsintegerThe number of rushing attempts
rush_yardsintegerThe number of rushing yards gained
avg_rush_yardsdoubleAVerage rush yards gained
rush_touchdownsintegerThe number of scored rushing touchdowns
player_gsis_idcharacterUnique identifier of the player
player_first_namecharacterPlayer's first name
player_last_namecharacterPlayer's last name
player_jersey_numberintegerPlayer's jersey number
player_short_namecharacterShort version of player's name
expected_rush_yardsdoubleExpected rushing yards based on Nextgenstats' Big Data Bowl model
rush_yards_over_expecteddoubleA rusher's rush yards gained compared to the expected rush yards
rush_yards_over_expected_per_attdoubleAverage rush yards above expectation
rush_pct_over_expecteddoubleRushing percentage above expectation

Example

from sportsdataverse.nfl import load_nfl_nextgen_stats
ngs = load_nfl_nextgen_stats(seasons=[2024], stat_type="rushing")

load_nfl_officials(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Officials information

Parameters

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

Returns

Polars dataframe containing officials available.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
game_keycharacter
official_namecharacterOfficial name.
positioncharacterPrimary position as reported by NFL.com
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
official_idcharacterUnique official / referee identifier.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.

Example

from sportsdataverse.nfl import load_nfl_officials
officials = load_nfl_officials()
officials.shape

# Pandas round-trip

officials_pd = load_nfl_officials(return_as_pandas=True)
officials_pd.head()

load_nfl_pbp(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL play by play data going back to 1999

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing the play-by-plays available for the requested seasons.

col_nametypedescription
play_iddoubleNumeric play id that when used with game_id and drive provides the unique identifier for a single play.
game_idcharacterTen digit identifier for NFL game.
old_game_idcharacterLegacy NFL game ID.
home_teamcharacterThe home team. Note that this contains the designated home team for games which no team is playing at home such as Super Bowls or NFL International games.
away_teamcharacterString abbreviation for the away team.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.
posteamcharacterString abbreviation for the team with possession.
posteam_typecharacterString indicating whether the posteam team is home or away.
defteamcharacterString abbreviation for the team on defense.
side_of_fieldcharacterString abbreviation for which team's side of the field the team with possession is currently on.
yardline_100doubleNumeric distance in the number of yards from the opponent's endzone for the posteam.
game_datecharacterDate of the game.
quarter_seconds_remainingdoubleNumeric seconds remaining in the quarter.
half_seconds_remainingdoubleNumeric seconds remaining in the half.
game_seconds_remainingdoubleNumeric seconds remaining in the game.
game_halfcharacterString indicating which half the play is in, either Half1, Half2, or Overtime.
quarter_enddoubleBinary indicator for whether or not the row of the data is marking the end of a quarter.
drivedoubleNumeric drive number in the game.
spdoubleBinary indicator for whether or not a score occurred on the play.
qtrdoubleQuarter of the game (5 is overtime).
downdoubleThe down for the given play.
goal_to_gointegerBinary indicator for whether or not the posteam is in a goal down situation.
timecharacterTime at start of play provided in string format as minutes:seconds remaining in the quarter.
yrdlncharacterString indicating the current field position for a given play.
ydstogodoubleNumeric yards in distance from either the first down marker or the endzone in goal down situations.
ydsnetdoubleNumeric value for total yards gained on the given drive.
desccharacterDetailed string description for the given play.
play_typecharacterString indicating the type of play: pass (includes sacks), run (includes scrambles), punt, field_goal, kickoff, extra_point, qb_kneel, qb_spike, no_play (timeouts and penalties), and missing for rows indicating end of play.
yards_gaineddoubleNumeric yards gained (or lost) by the possessing team, excluding yards gained via fumble recoveries and laterals.
shotgundoubleBinary indicator for whether or not the play was in shotgun formation.
no_huddledoubleBinary indicator for whether or not the play was in no_huddle formation.
qb_dropbackdoubleBinary indicator for whether or not the QB dropped back on the play (pass attempt, sack, or scrambled).
qb_kneeldoubleBinary indicator for whether or not the QB took a knee.
qb_spikedoubleBinary indicator for whether or not the QB spiked the ball.
qb_scrambledoubleBinary indicator for whether or not the QB scrambled.
pass_lengthcharacterString indicator for pass length: short or deep.
pass_locationcharacterString indicator for pass location: left, middle, or right.
air_yardsdoubleNumeric value for distance in yards perpendicular to the line of scrimmage at where the targeted receiver either caught or didn't catch the ball.
yards_after_catchdoubleNumeric value for distance in yards perpendicular to the yard line where the receiver made the reception to where the play ended.
run_locationcharacterString indicator for location of run: left, middle, or right.
run_gapcharacterString indicator for line gap of run: end, guard, or tackle
field_goal_resultcharacterString indicator for result of field goal attempt: made, missed, or blocked.
kick_distancedoubleNumeric distance in yards for kickoffs, field goals, and punts.
extra_point_resultcharacterString indicator for the result of the extra point attempt: good, failed, blocked, safety (touchback in defensive endzone is 1 point apparently), or aborted.
two_point_conv_resultcharacterString indicator for result of two point conversion attempt: success, failure, safety (touchback in defensive endzone is 1 point apparently), or return.
home_timeouts_remainingdoubleNumeric timeouts remaining in the half for the home team.
away_timeouts_remainingdoubleNumeric timeouts remaining in the half for the away team.
timeoutdoubleBinary indicator for whether or not a timeout was called by either team.
timeout_teamcharacterString abbreviation for which team called the timeout.
td_teamcharacterString abbreviation for which team scored the touchdown.
td_player_namecharacterString name of the player who scored a touchdown.
td_player_idcharacterUnique identifier of the player who scored a touchdown.
posteam_timeouts_remainingdoubleNumber of timeouts remaining for the possession team.
defteam_timeouts_remainingdoubleNumber of timeouts remaining for the team on defense.
total_home_scoredoubleScore for the home team at the start of the play.
total_away_scoredoubleScore for the away team at the start of the play.
posteam_scoredoubleScore the posteam at the start of the play.
defteam_scoredoubleScore the defteam at the start of the play.
score_differentialdoubleScore differential between the posteam and defteam at the start of the play.
posteam_score_postdoubleScore for the posteam at the end of the play.
defteam_score_postdoubleScore for the defteam at the end of the play.
score_differential_postdoubleScore differential between the posteam and defteam at the end of the play.
no_score_probdoublePredicted probability of no score occurring for the rest of the half based on the expected points model.
opp_fg_probdoublePredicted probability of the defteam scoring a FG next. 'Next' in this context means the next score in the same game half.
opp_safety_probdoublePredicted probability of the defteam scoring a safety next. 'Next' in this context means the next score in the same game half.
opp_td_probdoublePredicted probability of the defteam scoring a TD next. 'Next' in this context means the next score in the same game half.
fg_probdoublePredicted probability of the posteam scoring a FG next. 'Next' in this context means the next score in the same game half.
safety_probdoublePredicted probability of the posteam scoring a safety next. 'Next' in this context means the next score in the same game half.
td_probdoublePredicted probability of the posteam scoring a TD next. 'Next' in this context means the next score in the same game half.
extra_point_probdoublePredicted probability of the posteam scoring an extra point.
two_point_conversion_probdoublePredicted probability of the posteam scoring the two point conversion.
epdoubleUsing the scoring event probabilities, the estimated expected points with respect to the possession team for the given play.
epadoubleExpected points added (EPA) by the posteam for the given play.
total_home_epadoubleCumulative total EPA for the home team in the game so far.
total_away_epadoubleCumulative total EPA for the away team in the game so far.
total_home_rush_epadoubleCumulative total rushing EPA for the home team in the game so far.
total_away_rush_epadoubleCumulative total rushing EPA for the away team in the game so far.
total_home_pass_epadoubleCumulative total passing EPA for the home team in the game so far.
total_away_pass_epadoubleCumulative total passing EPA for the away team in the game so far.
air_epadoubleEPA from the air yards alone. For completions this represents the actual value provided through the air. For incompletions this represents the hypothetical value that could've been added through the air if the pass was completed.
yac_epadoubleEPA from the yards after catch alone. For completions this represents the actual value provided after the catch. For incompletions this represents the difference between the hypothetical air_epa and the play's raw observed EPA (how much the incomplete pass cost the posteam).
comp_air_epadoubleEPA from the air yards alone only for completions.
comp_yac_epadoubleEPA from the yards after catch alone only for completions.
total_home_comp_air_epadoubleCumulative total completions air EPA for the home team in the game so far.
total_away_comp_air_epadoubleCumulative total completions air EPA for the away team in the game so far.
total_home_comp_yac_epadoubleCumulative total completions yac EPA for the home team in the game so far.
total_away_comp_yac_epadoubleCumulative total completions yac EPA for the away team in the game so far.
total_home_raw_air_epadoubleCumulative total raw air EPA for the home team in the game so far.
total_away_raw_air_epadoubleCumulative total raw air EPA for the away team in the game so far.
total_home_raw_yac_epadoubleCumulative total raw yac EPA for the home team in the game so far.
total_away_raw_yac_epadoubleCumulative total raw yac EPA for the away team in the game so far.
wpdoubleEstimated win probabiity for the posteam given the current situation at the start of the given play.
def_wpdoubleEstimated win probability for the defteam.
home_wpdoubleEstimated win probability for the home team.
away_wpdoubleEstimated win probability for the away team.
wpadoubleWin probability added (WPA) for the posteam.
vegas_wpadoubleWin probability added (WPA) for the posteam: spread_adjusted model.
vegas_home_wpadoubleWin probability added (WPA) for the home team: spread_adjusted model.
home_wp_postdoubleEstimated win probability for the home team at the end of the play.
away_wp_postdoubleEstimated win probability for the away team at the end of the play.
vegas_wpdoubleEstimated win probabiity for the posteam given the current situation at the start of the given play, incorporating pre-game Vegas line.
vegas_home_wpdoubleEstimated win probability for the home team incorporating pre-game Vegas line.
total_home_rush_wpadoubleCumulative total rushing WPA for the home team in the game so far.
total_away_rush_wpadoubleCumulative total rushing WPA for the away team in the game so far.
total_home_pass_wpadoubleCumulative total passing WPA for the home team in the game so far.
total_away_pass_wpadoubleCumulative total passing WPA for the away team in the game so far.
air_wpadoubleWPA through the air (same logic as air_epa).
yac_wpadoubleWPA from yards after the catch (same logic as yac_epa).
comp_air_wpadoubleThe air_wpa for completions only.
comp_yac_wpadoubleThe yac_wpa for completions only.
total_home_comp_air_wpadoubleCumulative total completions air WPA for the home team in the game so far.
total_away_comp_air_wpadoubleCumulative total completions air WPA for the away team in the game so far.
total_home_comp_yac_wpadoubleCumulative total completions yac WPA for the home team in the game so far.
total_away_comp_yac_wpadoubleCumulative total completions yac WPA for the away team in the game so far.
total_home_raw_air_wpadoubleCumulative total raw air WPA for the home team in the game so far.
total_away_raw_air_wpadoubleCumulative total raw air WPA for the away team in the game so far.
total_home_raw_yac_wpadoubleCumulative total raw yac WPA for the home team in the game so far.
total_away_raw_yac_wpadoubleCumulative total raw yac WPA for the away team in the game so far.
punt_blockeddoubleBinary indicator for if the punt was blocked.
first_down_rushdoubleBinary indicator for if a running play converted the first down.
first_down_passdoubleBinary indicator for if a passing play converted the first down.
first_down_penaltydoubleBinary indicator for if a penalty converted the first down.
third_down_converteddoubleBinary indicator for if the first down was converted on third down.
third_down_faileddoubleBinary indicator for if the posteam failed to convert first down on third down.
fourth_down_converteddoubleBinary indicator for if the first down was converted on fourth down.
fourth_down_faileddoubleBinary indicator for if the posteam failed to convert first down on fourth down.
incomplete_passdoubleBinary indicator for if the pass was incomplete.
touchbackdoubleBinary indicator for if a touchback occurred on the play.
interceptiondoubleBinary indicator for if the pass was intercepted.
punt_inside_twentydoubleBinary indicator for if the punt ended inside the twenty yard line.
punt_in_endzonedoubleBinary indicator for if the punt was in the endzone.
punt_out_of_boundsdoubleBinary indicator for if the punt went out of bounds.
punt_downeddoubleBinary indicator for if the punt was downed.
punt_fair_catchdoubleBinary indicator for if the punt was caught with a fair catch.
kickoff_inside_twentydoubleBinary indicator for if the kickoff ended inside the twenty yard line.
kickoff_in_endzonedoubleBinary indicator for if the kickoff was in the endzone.
kickoff_out_of_boundsdoubleBinary indicator for if the kickoff went out of bounds.
kickoff_downeddoubleBinary indicator for if the kickoff was downed.
kickoff_fair_catchdoubleBinary indicator for if the kickoff was caught with a fair catch.
fumble_forceddoubleBinary indicator for if the fumble was forced.
fumble_not_forceddoubleBinary indicator for if the fumble was not forced.
fumble_out_of_boundsdoubleBinary indicator for if the fumble went out of bounds.
solo_tackledoubleBinary indicator if the play had a solo tackle (could be multiple due to fumbles).
safetydoubleBinary indicator for whether or not a safety occurred.
penaltydoubleBinary indicator for whether or not a penalty occurred.
tackled_for_lossdoubleBinary indicator for whether or not a tackle for loss on a run play occurred.
fumble_lostdoubleBinary indicator for if the fumble was lost.
own_kickoff_recoverydoubleBinary indicator for if the kicking team recovered the kickoff.
own_kickoff_recovery_tddoubleBinary indicator for if the kicking team recovered the kickoff and scored a TD.
qb_hitdoubleBinary indicator if the QB was hit on the play.
rush_attemptdoubleBinary indicator for if the play was a run.
pass_attemptdoubleBinary indicator for if the play was a pass attempt (includes sacks).
sackdoubleBinary indicator for if the play ended in a sack.
touchdowndoubleBinary indicator for if the play resulted in a TD.
pass_touchdowndoubleBinary indicator for if the play resulted in a passing TD.
rush_touchdowndoubleBinary indicator for if the play resulted in a rushing TD.
return_touchdowndoubleBinary indicator for if the play resulted in a return TD. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
extra_point_attemptdoubleBinary indicator for extra point attempt.
two_point_attemptdoubleBinary indicator for two point conversion attempt.
field_goal_attemptdoubleBinary indicator for field goal attempt.
kickoff_attemptdoubleBinary indicator for kickoff.
punt_attemptdoubleBinary indicator for punts.
fumbledoubleBinary indicator for if a fumble occurred.
complete_passdoubleBinary indicator for if the pass was completed.
assist_tackledoubleBinary indicator for if an assist tackle occurred.
lateral_receptiondoubleBinary indicator for if a lateral occurred on the reception.
lateral_rushdoubleBinary indicator for if a lateral occurred on a run.
lateral_returndoubleBinary indicator for if a lateral occurred on a return. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
lateral_recoverydoubleBinary indicator for if a lateral occurred on a fumble recovery.
passer_player_idcharacterUnique identifier for the player that attempted the pass.
passer_player_namecharacterString name for the player that attempted the pass.
passing_yardsdoubleNumeric yards by the passer_player_name, including yards gained in pass plays with laterals. This should equal official passing statistics.
receiver_player_idcharacterUnique identifier for the receiver that was targeted on the pass.
receiver_player_namecharacterString name for the targeted receiver.
receiving_yardsdoubleNumeric yards by the receiver_player_name, excluding yards gained in pass plays with laterals. This should equal official receiving statistics but could miss yards gained in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
rusher_player_idcharacterUnique identifier for the player that attempted the run.
rusher_player_namecharacterString name for the player that attempted the run.
rushing_yardsdoubleNumeric yards by the rusher_player_name, excluding yards gained in rush plays with laterals. This should equal official rushing statistics but could miss yards gained in rush plays with laterals. Please see the description of lateral_rusher_player_name for further information.
lateral_receiver_player_idcharacterUnique identifier for the player that received the last(!) lateral on a pass play.
lateral_receiver_player_namecharacterString name for the player that received the last(!) lateral on a pass play. If there were multiple laterals in the same play, this will only be the last player who received a lateral. Please see https://github.com/mrcaseb/nfl-data/tree/master/data/lateral_yards for a list of plays where multiple players recorded lateral receiving yards.
lateral_receiving_yardsdoubleNumeric yards by the lateral_receiver_player_name in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
lateral_rusher_player_idcharacterUnique identifier for the player that received the last(!) lateral on a run play.
lateral_rusher_player_namecharacterString name for the player that received the last(!) lateral on a run play. If there were multiple laterals in the same play, this will only be the last player who received a lateral. Please see https://github.com/mrcaseb/nfl-data/tree/master/data/lateral_yards for a list of plays where multiple players recorded lateral rushing yards.
lateral_rushing_yardsdoubleNumeric yards by the lateral_rusher_player_name in run plays with laterals. Please see the description of lateral_rusher_player_name for further information.
lateral_sack_player_idcharacterUnique identifier for the player that received the lateral on a sack.
lateral_sack_player_namecharacterString name for the player that received the lateral on a sack.
interception_player_idcharacterUnique identifier for the player that intercepted the pass.
interception_player_namecharacterString name for the player that intercepted the pass.
lateral_interception_player_idcharacterUnique indentifier for the player that received the lateral on an interception.
lateral_interception_player_namecharacterString name for the player that received the lateral on an interception.
punt_returner_player_idcharacterUnique identifier for the punt returner.
punt_returner_player_namecharacterString name for the punt returner.
lateral_punt_returner_player_idcharacterUnique identifier for the player that received the lateral on a punt return.
lateral_punt_returner_player_namecharacterString name for the player that received the lateral on a punt return.
kickoff_returner_player_namecharacterString name for the kickoff returner.
kickoff_returner_player_idcharacterUnique identifier for the kickoff returner.
lateral_kickoff_returner_player_idcharacterUnique identifier for the player that received the lateral on a kickoff return.
lateral_kickoff_returner_player_namecharacterString name for the player that received the lateral on a kickoff return.
punter_player_idcharacterUnique identifier for the punter.
punter_player_namecharacterString name for the punter.
kicker_player_namecharacterString name for the kicker on FG or kickoff.
kicker_player_idcharacterUnique identifier for the kicker on FG or kickoff.
own_kickoff_recovery_player_idcharacterUnique identifier for the player that recovered their own kickoff.
own_kickoff_recovery_player_namecharacterString name for the player that recovered their own kickoff.
blocked_player_idcharacterUnique identifier for the player that blocked the punt or FG.
blocked_player_namecharacterString name for the player that blocked the punt or FG.
tackle_for_loss_1_player_idcharacterUnique identifier for one of the potential players with the tackle for loss.
tackle_for_loss_1_player_namecharacterString name for one of the potential players with the tackle for loss.
tackle_for_loss_2_player_idcharacterUnique identifier for one of the potential players with the tackle for loss.
tackle_for_loss_2_player_namecharacterString name for one of the potential players with the tackle for loss.
qb_hit_1_player_idcharacterUnique identifier for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
qb_hit_1_player_namecharacterString name for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
qb_hit_2_player_idcharacterUnique identifier for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
qb_hit_2_player_namecharacterString name for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
forced_fumble_player_1_teamcharacterTeam of one of the players with a forced fumble.
forced_fumble_player_1_player_idcharacterUnique identifier of one of the players with a forced fumble.
forced_fumble_player_1_player_namecharacterString name of one of the players with a forced fumble.
forced_fumble_player_2_teamcharacterTeam of one of the players with a forced fumble.
forced_fumble_player_2_player_idcharacterUnique identifier of one of the players with a forced fumble.
forced_fumble_player_2_player_namecharacterString name of one of the players with a forced fumble.
solo_tackle_1_teamcharacterTeam of one of the players with a solo tackle.
solo_tackle_2_teamcharacterTeam of one of the players with a solo tackle.
solo_tackle_1_player_idcharacterUnique identifier of one of the players with a solo tackle.
solo_tackle_2_player_idcharacterUnique identifier of one of the players with a solo tackle.
solo_tackle_1_player_namecharacterString name of one of the players with a solo tackle.
solo_tackle_2_player_namecharacterString name of one of the players with a solo tackle.
assist_tackle_1_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_1_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_1_teamcharacterTeam of one of the players with a tackle assist.
assist_tackle_2_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_2_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_2_teamcharacterTeam of one of the players with a tackle assist.
assist_tackle_3_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_3_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_3_teamcharacterTeam of one of the players with a tackle assist.
assist_tackle_4_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_4_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_4_teamcharacterTeam of one of the players with a tackle assist.
tackle_with_assistdoubleBinary indicator for if there has been a tackle with assist.
tackle_with_assist_1_player_idcharacterUnique identifier of one of the players with a tackle with assist.
tackle_with_assist_1_player_namecharacterString name of one of the players with a tackle with assist.
tackle_with_assist_1_teamcharacterTeam of one of the players with a tackle with assist.
tackle_with_assist_2_player_idcharacterUnique identifier of one of the players with a tackle with assist.
tackle_with_assist_2_player_namecharacterString name of one of the players with a tackle with assist.
tackle_with_assist_2_teamcharacterTeam of one of the players with a tackle with assist.
pass_defense_1_player_idcharacterUnique identifier of one of the players with a pass defense.
pass_defense_1_player_namecharacterString name of one of the players with a pass defense.
pass_defense_2_player_idcharacterUnique identifier of one of the players with a pass defense.
pass_defense_2_player_namecharacterString name of one of the players with a pass defense.
fumbled_1_teamcharacterTeam of one of the first player with a fumble.
fumbled_1_player_idcharacterUnique identifier of the first player who fumbled on the play.
fumbled_1_player_namecharacterString name of one of the first player who fumbled on the play.
fumbled_2_player_idcharacterUnique identifier of the second player who fumbled on the play.
fumbled_2_player_namecharacterString name of one of the second player who fumbled on the play.
fumbled_2_teamcharacterTeam of one of the second player with a fumble.
fumble_recovery_1_teamcharacterTeam of one of the players with a fumble recovery.
fumble_recovery_1_yardsdoubleYards gained by one of the players with a fumble recovery.
fumble_recovery_1_player_idcharacterUnique identifier of one of the players with a fumble recovery.
fumble_recovery_1_player_namecharacterString name of one of the players with a fumble recovery.
fumble_recovery_2_teamcharacterTeam of one of the players with a fumble recovery.
fumble_recovery_2_yardsdoubleYards gained by one of the players with a fumble recovery.
fumble_recovery_2_player_idcharacterUnique identifier of one of the players with a fumble recovery.
fumble_recovery_2_player_namecharacterString name of one of the players with a fumble recovery.
sack_player_idcharacterUnique identifier of the player who recorded a solo sack.
sack_player_namecharacterString name of the player who recorded a solo sack.
half_sack_1_player_idcharacterUnique identifier of the first player who recorded half a sack.
half_sack_1_player_namecharacterString name of the first player who recorded half a sack.
half_sack_2_player_idcharacterUnique identifier of the second player who recorded half a sack.
half_sack_2_player_namecharacterString name of the second player who recorded half a sack.
return_teamcharacterString abbreviation of the return team. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
return_yardsdoubleYards gained by the return team. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
penalty_teamcharacterString abbreviation of the team with the penalty.
penalty_player_idcharacterUnique identifier for the player with the penalty.
penalty_player_namecharacterString name for the player with the penalty.
penalty_yardsdoubleYards gained (or lost) by the posteam from the penalty.
replay_or_challengedoubleBinary indicator for whether or not a replay or challenge.
replay_or_challenge_resultcharacterString indicating the result of the replay or challenge.
penalty_typecharacterString indicating the penalty type of the first penalty in the given play. Will be NA if desc is missing the type.
defensive_two_point_attemptdoubleBinary indicator whether or not the defense was able to have an attempt on a two point conversion, this results following a turnover.
defensive_two_point_convdoubleBinary indicator whether or not the defense successfully scored on the two point conversion.
defensive_extra_point_attemptdoubleBinary indicator whether or not the defense was able to have an attempt on an extra point attempt, this results following a blocked attempt that the defense recovers the ball.
defensive_extra_point_convdoubleBinary indicator whether or not the defense successfully scored on an extra point attempt.
safety_player_namecharacterString name for the player who scored a safety.
safety_player_idcharacterUnique identifier for the player who scored a safety.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
cpdoubleNumeric value indicating the probability for a complete pass based on comparable game situations.
cpoedoubleFor a single pass play this is 1 - cp when the pass was completed or 0 - cp when the pass was incomplete. Analyzed for a whole game or season an indicator for the passer how much over or under expectation his completion percentage was.
seriesdoubleStarts at 1, each new first down increments, numbers shared across both teams NA: kickoffs, extra point/two point conversion attempts, non-plays, no posteam
series_successdouble1: scored touchdown, gained enough yards for first down.
series_resultcharacterPossible values: First down, Touchdown, Opp touchdown, Field goal, Missed field goal, Safety, Turnover, Punt, Turnover on downs, QB kneel, End of half
order_sequencedoubleColumn provided by NFL to fix out-of-order plays. Available 2011 and beyond with source "nfl".
start_timecharacterKickoff time in eastern time zone.
time_of_daycharacterTime of day of play in UTC "HH:MM:SS" format. Available 2011 and beyond with source "nfl".
stadiumcharacterName of the stadium
weathercharacterString describing the weather including temperature, humidity and wind (direction and speed). Doesn't change during the game!
nfl_api_idcharacterUUID of the game in the new NFL API.
play_clockcharacterTime on the playclock when the ball was snapped.
play_deleteddoubleBinary indicator for deleted plays.
play_type_nflcharacterPlay type as listed in the NFL source. Slightly different to the regular play_type variable.
special_teams_playdoubleBinary indicator for whether play is special teams play from NFL source. Available 2011 and beyond with source "nfl".
st_play_typecharacterType of special teams play from NFL source. Available 2011 and beyond with source "nfl".
end_clock_timecharacterGame time at the end of a given play.
end_yard_linecharacterString indicating the yardline at the end of the given play consisting of team half and yard line number.
fixed_drivedoubleManually created drive number in a game.
fixed_drive_resultcharacterManually created drive result.
drive_real_start_timecharacterLocal day time when the drive started (currently not used by the NFL and therefore mostly 'NA').
drive_play_countdoubleNumeric value of how many regular plays happened in a given drive.
drive_time_of_possessioncharacterTime of possession in a given drive.
drive_first_downsdoubleNumber of first downs in a given drive.
drive_inside20doubleBinary indicator if the offense was able to get inside the opponents 20 yard line.
drive_ended_with_scoredoubleBinary indicator the drive ended with a score.
drive_quarter_startdoubleNumeric value indicating in which quarter the given drive has started.
drive_quarter_enddoubleNumeric value indicating in which quarter the given drive has ended.
drive_yards_penalizeddoubleNumeric value of how many yards the offense gained or lost through penalties in the given drive.
drive_start_transitioncharacterString indicating how the offense got the ball.
drive_end_transitioncharacterString indicating how the offense lost the ball.
drive_game_clock_startcharacterGame time at the beginning of a given drive.
drive_game_clock_endcharacterGame time at the end of a given drive.
drive_start_yard_linecharacterString indicating where a given drive started consisting of team half and yard line number.
drive_end_yard_linecharacterString indicating where a given drive ended consisting of team half and yard line number.
drive_play_id_starteddoublePlay_id of the first play in the given drive.
drive_play_id_endeddoublePlay_id of the last play in the given drive.
away_scoreintegerThe number of points the away team scored. Is NA for games which haven't yet been played.
home_scoreintegerThe number of points the home team scored. Is NA for games which haven't yet been played.
locationcharacterEither Home if the home team is playing in their home stadium, or Neutral if the game is being played at a neutral location. This still shows as Home for games between the Giants and Jets even though they share the same home stadium.
resultintegerThe number of points the home team scored minus the number of points the visiting team scored. Equals h_score - v_score. Is NA for games which haven't yet been played. Convenient for evaluating against the spread bets.
totalintegerThe 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.
spread_linedoubleThe closing spread line for the game. A positive number means the home team was favored by that many points, a negative number means the away team was favored by that many points. (Source: Pro-Football-Reference)
total_linedoubleThe closing total line for the game. (Source: Pro-Football-Reference)
div_gameintegerBinary indicator of whether or not game was played by 2 teams in the same division.
roofcharacterOne of 'dome', 'outdoors', 'closed', 'open' indicating indicating the roof status of the stadium the game was played in. (Source: Pro-Football-Reference)
surfacecharacterWhat type of ground the game was played on. (Source: Pro-Football-Reference)
tempintegerThe temperature at the stadium only for 'roof' = 'outdoors' or 'open'.(Source: Pro-Football-Reference)
windintegerThe speed of the wind in miles/hour only for 'roof' = 'outdoors' or 'open'. (Source: Pro-Football-Reference)
home_coachcharacterFirst and last name of the home team coach. (Source: Pro-Football-Reference)
away_coachcharacterFirst and last name of the away team coach. (Source: Pro-Football-Reference)
stadium_idcharacterID of the stadium the game was played in. (Source: Pro-Football-Reference)
game_stadiumcharacterName of the stadium the game was played in. (Source: Pro-Football-Reference)
aborted_playdoubleBinary indicator if the play description indicates "Aborted".
successdoubleBinary indicator wheter epa > 0 in the given play.
passercharacterName of the dropback player (scrambles included) including plays with penalties.
passer_jersey_numberintegerJersey number of the passer.
rushercharacterName of the rusher (no scrambles) including plays with penalties.
rusher_jersey_numberintegerJersey number of the rusher.
receivercharacterName of the receiver including plays with penalties.
receiver_jersey_numberintegerJersey number of the receiver.
passdoubleBinary indicator if the play was a pass play (sacks and scrambles included).
rushdoubleBinary indicator if the play was a rushing play.
first_downdoubleBinary indicator if the play ended in a first down.
specialdoubleBinary indicator if "play_type" is one of "extra_point", "field_goal", "kickoff", or "punt".
playdoubleBinary indicator: 1 if the play was a 'normal' play (including penalties), 0 otherwise.
passer_idcharacterID of the player in the 'passer' column.
rusher_idcharacterID of the player in the 'rusher' column.
receiver_idcharacterID of the player in the 'receiver' column.
namecharacterName, as reported by MFL but reordered into FirstName LastName instead of Last, First
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
idcharacterID of the player in the 'name' column.
fantasy_player_namecharacterName of the rusher on rush plays or receiver on pass plays (from official stats).
fantasy_player_idcharacterID of the rusher on rush plays or receiver on pass plays (from official stats).
fantasycharacterName of the rusher on rush plays or receiver on pass plays.
fantasy_idcharacterID of the rusher on rush plays or receiver on pass plays.
out_of_boundsdouble1 if play description contains ran ob, pushed ob, or sacked ob; 0 otherwise.
home_opening_kickoffdouble1 if the home team received the opening kickoff, 0 otherwise.
qb_epadoubleGives QB credit for EPA for up to the point where a receiver lost a fumble after a completed catch and makes EPA work more like passing yards on plays with fumbles.
xyac_epadoubleExpected value of EPA gained after the catch, starting from where the catch was made. Zero yards after the catch would be listed as zero EPA.
xyac_mean_yardagedoubleAverage expected yards after the catch based on where the ball was caught.
xyac_median_yardageintegerMedian expected yards after the catch based on where the ball was caught.
xyac_successdoubleProbability play earns positive EPA (relative to where play started) based on where ball was caught.
xyac_fddoubleProbability play earns a first down based on where the ball was caught.
xpassdoubleProbability of dropback scaled from 0 to 1.
pass_oedoubleDropback percent over expected on a given play scaled from 0 to 100.

Example

from sportsdataverse.nfl import load_nfl_pbp
pbp = load_nfl_pbp(seasons=[2024])
print(pbp.shape)

# Multi-season range

pbp = load_nfl_pbp(seasons=range(2020, 2025))

# With cache off (development workflow)

from sportsdataverse.nfl import load_nfl_pbp, update_config
update_config(cache_mode="off")
pbp = load_nfl_pbp(seasons=[2024])

# Pandas round-trip

pbp_pd = load_nfl_pbp(seasons=[2024], return_as_pandas=True)
pbp_pd.head()

load_nfl_pbp_participation(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL play-by-play participation data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2016 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing play-by-play participation data available for the requested seasons.

col_nametypedescription
nflverse_game_idcharacternflverse identifier for games. Format is season, week, away_team, home_team
old_game_idcharacterLegacy NFL game ID.
play_iddoubleNumeric play id that when used with game_id and drive provides the unique identifier for a single play.
possession_teamcharacterString abbreviation for the team with possession.
offense_formationcharacterFormation the offense lines up in to snap the ball.
offense_personnelcharacterThe positions of the offensive personnel lined up on the field for a play.
defenders_in_boxintegerNumber of defensive players lined up in the box at the snap.
defense_personnelcharacterThe positions of the defensive personnel lined up on the field for a play.
number_of_pass_rushersintegerNumber of defensive player who rushed the passer.
players_on_playcharacterA list of every player on the field for the play, by gsis_id
offense_playerscharacterA list of every offensive player on the field for the play, by gsis_id
defense_playerscharacterA list of every defensive player on the field for the play, by gsis_id
n_offenseintegerNumber of offensive players on the field for the play
n_defenseintegerNumber of defensive players on the field for the play
ngs_air_yardsdoubleLegacy column. For 2023 and prior years, reflects the distance (in yards) that the ball traveled in the air on a given passing play as tracked by NGS. Is NA for 2024 on--we advise instead using the air_yards column from nflreadr::load_pbp() moving forward.
time_to_throwdoubleDuration (in seconds) between the time of the ball being snapped and the time of release of a pass attempt
was_pressurelogicalA boolean indicating whether or not the QB was pressured on a play
routecharacterA string indicating the route the primary receiver on a play took. Has the following possible values: "CORNER", "DEEP OUT", "GO", "HITCH/CURL", "IN/DIG", "POST", "QUICK OUT", "SCREEN", "SHALLOW CROSS/DRAG", "SLANT", "SWING", "TEXAS/ANGLE", "WHEEL".
defense_man_zone_typecharacterA string indicating whether the defense was in man or zone coverage on a play
defense_coverage_typecharacterA string indicating what type of cover the defense was in on a play. Has one of the following values: "COVER_0", "COVER_1", "COVER_2", "2_MAN", "COVER_3", "COVER_4", "COVER_6", "COVER_9", "COMBO", "BLOWN".
offense_namescharacterA string listing all of the names of offensive players in the order of their gsis_ids in offense_players.
defense_namescharacterA string listing all of the names of defensive players in the order of their gsis_ids in defense_players.
offense_positionscharacterA string listing all of the positions of offensive players in the order of their gsis_ids in offense_players.
defense_positionscharacterA string listing all of the positions of defensive players in the order of their gsis_ids in defense_players.
offense_numberscharacterA string listing all of the numbers of offensive players in the order of their gsis_ids in offense_players.
defense_numberscharacterA string listing all of the numbers of defensive players in the order of their gsis_ids in defense_players.

Example

from sportsdataverse.nfl import load_nfl_pbp_participation
participation = load_nfl_pbp_participation(seasons=[2022])

# Multi-season range

participation = load_nfl_pbp_participation(seasons=range(2018, 2023))

load_nfl_pfr_advstats(seasons: 'List[int]', stat_type: 'str' = 'pass', summary_level: 'str' = 'week', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Load Pro-Football Reference advanced statistics going back to 2018.

Unified loader that consolidates the per-stat-type / per-summary-level PFR advstats accessors. Mirrors the API surface of nflreadpy's load_pfr_advstats so downstream code can swap engines without changing call sites.

Parameters

ParameterTypeDefaultDescription
seasonslist[int]Seasons to load. For summary_level='week' this drives the per-season parquet fan-out; for summary_level='season' it post-filters the combined parquet by the season column.
stat_typestr'pass'One of "pass", "rush", "rec", "def". Defaults to "pass".
summary_levelstr'week'One of "week" or "season". Defaults to "week".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing PFR advanced stats data for the requested stat_type, summary_level, and seasons.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
pfr_player_namecharacterPlayer's name as recorded by PFR
pfr_player_idcharacterID from Pro Football Reference
passing_dropsdouble
passing_drop_pctdouble
receiving_dropdouble
receiving_drop_pctdouble
passing_bad_throwsdouble
passing_bad_throw_pctdouble
times_sackeddouble
times_blitzeddoubleNumber of times blitzed
times_hurrieddoubleNumber of times hurried
times_hitdoubleNumber of times hit
times_pressureddoubleNumber of times pressured
times_pressured_pctdouble
def_times_blitzeddouble
def_times_hurrieddouble
def_times_hitqbdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
pass_week = load_nfl_pfr_advstats(
seasons=[2024], stat_type="pass", summary_level="week"
)

# Season-level rushing summaries (one row per player per season)

rush_season = load_nfl_pfr_advstats(
seasons=[2024], stat_type="rush", summary_level="season"
)

# Defensive stats with a follow-up filter

import polars as pl
def_week = (
load_nfl_pfr_advstats(seasons=[2024], stat_type="def", summary_level="week")
.filter(pl.col("week") <= 8)
)

# Pandas round-trip

rec_pd = load_nfl_pfr_advstats(
seasons=[2024],
stat_type="rec",
summary_level="season",
return_as_pandas=True,
)

load_nfl_pfr_def(return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='def', summary_level='season').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalse

Returns

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
playercharacterPlayer name
pfr_idcharacterPro-Football-Reference ID for player
tmcharacterTeam ID as used on MyFantasyLeague.com
agedoubleAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
poscharacterPosition as tracked by FP
gdoubleGoals (skaters).
gsdouble
intdoubleBinary flag for an interception.
tgtdouble
cmpdouble
cmp_percentdouble
ydsdouble
yds_cmpdouble
yds_tgtdouble
tddouble
ratdouble
dadotdouble
airdouble
yacdouble
bltzdouble
hrrydouble
qbkddouble
skdouble
prssdouble
combdouble
m_tkldouble
m_tkl_percentdouble
loadedcharacter
batsdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="def", summary_level="season"
)

load_nfl_pfr_pass(return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='pass', summary_level='season').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalse

Returns

col_nametypedescription
playercharacterPlayer name
teamcharacterNFL team. Uses official abbreviations as per NFL.com
pass_attemptsdoubleCareer pass attempts
throwawaysdoubleThrowaways
spikesdoubleSpikes
dropsdoubleThrows dropped
drop_pctdoublePercent of throws dropped
bad_throwsdoubleBad throws
bad_throw_pctdoublePercent of throws that were bad
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
pfr_idcharacterPro-Football-Reference ID for player
pocket_timedoubleAverage time in pocket
times_blitzeddoubleNumber of times blitzed
times_hurrieddoubleNumber of times hurried
times_hitdoubleNumber of times hit
times_pressureddoubleNumber of times pressured
pressure_pctdoublePercent of the time pressured
batted_ballsdoubleBatted balls
on_tgt_throwsdoubleOn target throws
on_tgt_pctdoublePercent of throws on target
rpo_playsdoubleNumber of RPO plays
rpo_yardsdoubleYards on RPOs
rpo_pass_attdoubleNumber of pass attempts on RPOs
rpo_pass_yardsdoublePassing yards on RPOs
rpo_rush_attdoubleRush attempts on RPOs
rpo_rush_yardsdoubleRushing yards on RPOs
pa_pass_attdoublePlay action pass attempts
pa_pass_yardsdoublePlay action passing yards
intended_air_yardsdouble
intended_air_yards_per_pass_attemptdouble
completed_air_yardsdouble
completed_air_yards_per_completiondouble
completed_air_yards_per_pass_attemptdouble
pass_yards_after_catchdouble
pass_yards_after_catch_per_completiondouble
scramblesdouble
scramble_yards_per_attemptdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="pass", summary_level="season"
)

load_nfl_pfr_rec(return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='rec', summary_level='season').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalse

Returns

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
playercharacterPlayer name
pfr_idcharacterPro-Football-Reference ID for player
tmcharacterTeam ID as used on MyFantasyLeague.com
agedoubleAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
poscharacterPosition as tracked by FP
gdoubleGoals (skaters).
gsdouble
tgtdouble
recdouble
ydsdouble
tddouble
x1ddouble
ybcdouble
ybc_rdouble
yacdouble
yac_rdouble
adotdouble
brk_tkldouble
rec_brdouble
dropdouble
drop_percentdouble
intdoubleBinary flag for an interception.
ratdouble
loadedcharacter

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="rec", summary_level="season"
)

load_nfl_pfr_rush(return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='rush', summary_level='season').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalse

Returns

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
playercharacterPlayer name
pfr_idcharacterPro-Football-Reference ID for player
tmcharacterTeam ID as used on MyFantasyLeague.com
agedoubleAge as of last pipeline build, rounded to one decimal. Pipeline is built on a weekly basis.
poscharacterPosition as tracked by FP
gdoubleGoals (skaters).
gsdouble
attdouble
ydsdouble
tddouble
x1ddouble
ybcdouble
ybc_attdouble
yacdouble
yac_attdouble
brk_tkldouble
att_brdouble
loadedcharacter

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="rush", summary_level="season"
)

load_nfl_pfr_weekly_def(seasons: 'List[int]', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='def', summary_level='week').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
seasonsList[int]
return_as_pandasboolFalse

Returns

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
pfr_player_namecharacterPlayer's name as recorded by PFR
pfr_player_idcharacterID from Pro Football Reference
def_intsdoubleCareer interceptions
def_targetsdouble
def_completions_alloweddouble
def_completion_pctdouble
def_yards_alloweddouble
def_yards_allowed_per_cmpdouble
def_yards_allowed_per_tgtdouble
def_receiving_td_alloweddouble
def_passer_rating_alloweddouble
def_adotdouble
def_air_yards_completeddouble
def_yards_after_catchdouble
def_times_blitzeddouble
def_times_hurrieddouble
def_times_hitqbdouble
def_sacksdoubleNumber of sacks form this player
def_pressuresdouble
def_tackles_combineddouble
def_missed_tacklesdouble
def_missed_tackle_pctdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="def", summary_level="week"
)

load_nfl_pfr_weekly_pass(seasons: 'List[int]', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='pass', summary_level='week').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
seasonsList[int]
return_as_pandasboolFalse

Returns

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
pfr_player_namecharacterPlayer's name as recorded by PFR
pfr_player_idcharacterID from Pro Football Reference
passing_dropsdouble
passing_drop_pctdouble
receiving_dropdouble
receiving_drop_pctdouble
passing_bad_throwsdouble
passing_bad_throw_pctdouble
times_sackeddouble
times_blitzeddoubleNumber of times blitzed
times_hurrieddoubleNumber of times hurried
times_hitdoubleNumber of times hit
times_pressureddoubleNumber of times pressured
times_pressured_pctdouble
def_times_blitzeddouble
def_times_hurrieddouble
def_times_hitqbdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="pass", summary_level="week"
)

load_nfl_pfr_weekly_rec(seasons: 'List[int]', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='rec', summary_level='week').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
seasonsList[int]
return_as_pandasboolFalse

Returns

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
pfr_player_namecharacterPlayer's name as recorded by PFR
pfr_player_idcharacterID from Pro Football Reference
rushing_broken_tacklesdouble
receiving_broken_tacklesdouble
passing_dropsdouble
passing_drop_pctdouble
receiving_dropdouble
receiving_drop_pctdouble
receiving_intdouble
receiving_ratdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="rec", summary_level="week"
)

load_nfl_pfr_weekly_rush(seasons: 'List[int]', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Deprecated alias for load_nfl_pfr_advstats(stat_type='rush', summary_level='week').

Will be removed in a future release. Migrate callers to the unified load_nfl_pfr_advstats function.

Parameters

ParameterTypeDefaultDescription
seasonsList[int]
return_as_pandasboolFalse

Returns

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
pfr_player_namecharacterPlayer's name as recorded by PFR
pfr_player_idcharacterID from Pro Football Reference
carriesdoubleThe number of official rush attempts (incl. scrambles and kneel downs). Rushes after a lateral reception don't count as carry.
rushing_yards_before_contactdouble
rushing_yards_before_contact_avgdouble
rushing_yards_after_contactdouble
rushing_yards_after_contact_avgdouble
rushing_broken_tacklesdouble
receiving_broken_tacklesdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
df = load_nfl_pfr_advstats(
seasons=[2024], stat_type="rush", summary_level="week"
)

load_nfl_player_stats(kicking=False, return_as_pandas=False) -> 'pl.DataFrame'

Load NFL player stats data

Parameters

ParameterTypeDefaultDescription
kickingboolFalseIf True, load kicking stats. If False, load all other stats.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing player stats.

col_nametypedescription
player_idcharacterPlayer ID (aka GSIS ID) as defined by nflreadr::load_rosters
player_namecharacterFull name of player
player_display_namecharacterFull name of the player
positioncharacterPrimary position as reported by NFL.com
position_groupcharacterPostion group of player as listed by NFL
headshot_urlcharacterA URL string that points to player photos used by NFL.com (or sometimes ESPN)
recent_teamcharacterMost recent team player appears in pbp with.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
opponent_teamcharacter
completionsintegerThe number of completed passes.
attemptsintegerThe number of pass attempts as defined by the NFL.
passing_yardsdoubleNumeric yards by the passer_player_name, including yards gained in pass plays with laterals. This should equal official passing statistics.
passing_tdsintegerThe number of passing touchdowns.
interceptionsdoubleThe number of interceptions thrown.
sacksdoubleThe Number of times sacked.
sack_yardsdoubleYards lost on sack plays.
sack_fumblesintegerThe number of sacks with a fumble.
sack_fumbles_lostintegerThe number of sacks with a lost fumble.
passing_air_yardsdoublePassing air yards (includes incomplete passes).
passing_yards_after_catchdoubleYards after the catch gained on plays in which player was the passer (this is an unofficial stat and may differ slightly between different sources).
passing_first_downsdoubleFirst downs on pass attempts.
passing_epadoubleTotal expected points added on pass attempts and sacks. NOTE: this uses the variable qb_epa, which gives QB credit for EPA for up to the point where a receiver lost a fumble after a completed catch and makes EPA work more like passing yards on plays with fumbles.
passing_2pt_conversionsintegerTwo-point conversion passes.
pacrdoublePassing (yards) Air (yards) Conversion Ratio - the number of passing yards per air yards thrown per game
dakotadoubleAdjusted EPA + CPOE composite based on coefficients which best predict adjusted EPA/play in the following year.
carriesintegerThe number of official rush attempts (incl. scrambles and kneel downs). Rushes after a lateral reception don't count as carry.
rushing_yardsdoubleNumeric yards by the rusher_player_name, excluding yards gained in rush plays with laterals. This should equal official rushing statistics but could miss yards gained in rush plays with laterals. Please see the description of lateral_rusher_player_name for further information.
rushing_tdsintegerThe number of rushing touchdowns (incl. scrambles). Also includes touchdowns after obtaining a lateral on a play that started with a rushing attempt.
rushing_fumblesdoubleThe number of rushes with a fumble.
rushing_fumbles_lostdoubleThe number of rushes with a lost fumble.
rushing_first_downsdoubleFirst downs on rush attempts (incl. scrambles).
rushing_epadoubleExpected points added on rush attempts (incl. scrambles and kneel downs).
rushing_2pt_conversionsintegerTwo-point conversion rushes
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
targetsintegerThe number of pass plays where the player was the targeted receiver.
receiving_yardsdoubleNumeric yards by the receiver_player_name, excluding yards gained in pass plays with laterals. This should equal official receiving statistics but could miss yards gained in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
receiving_tdsintegerThe number of touchdowns following a pass reception. Also includes touchdowns after receiving a lateral on a play that started as a pass play.
receiving_fumblesdoubleThe number of fumbles after a pass reception.
receiving_fumbles_lostdoubleThe number of fumbles lost after a pass reception.
receiving_air_yardsdoubleReceiving air yards (incl. incomplete passes).
receiving_yards_after_catchdoubleYards after the catch gained on plays in which player was receiver (this is an unofficial stat and may differ slightly between different sources).
receiving_first_downsdoubleTotal number of first downs gained on receptions
receiving_epadoubleTotal EPA on plays where this receiver was targeted
receiving_2pt_conversionsintegerTwo-point conversion receptions
racrdoubleReceiving (yards) Air (yards) Conversion Ratio - the number of receiving yards per air yards targeted per game
target_sharedouble"Player's share of team receiving targets in this game"
air_yards_sharedoublePlayer's share of the team's air yards in this game
woprdoubleWeighted OPportunity Rating - 1.5 x target_share + 0.7 x air_yards_share - a weighted average that contextualizes total fantasy usage.
special_teams_tdsdoubleTotal number of kick/punt return touchdowns
fantasy_pointsdoubleStandard fantasy points.
fantasy_points_pprdoublePPR fantasy points.

Example

from sportsdataverse.nfl import load_nfl_player_stats
stats = load_nfl_player_stats()
stats.shape

# Kicking-only stats

kicking = load_nfl_player_stats(kicking=True)

# Filter to a single season after load

import polars as pl
stats_2024 = load_nfl_player_stats().filter(pl.col("season") == 2024)

load_nfl_players(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Player ID information

Parameters

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

Returns

Polars dataframe containing players available.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
game_keycharacter
official_namecharacterOfficial name.
positioncharacterPrimary position as reported by NFL.com
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
official_idcharacterUnique official / referee identifier.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.

Example

from sportsdataverse.nfl import load_nfl_players
players = load_nfl_players()
players.shape

# Pandas round-trip

players_pd = load_nfl_players(return_as_pandas=True)
players_pd.head()

load_nfl_rosters(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL roster data for all seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1920 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing rosters available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
positioncharacterPrimary position as reported by NFL.com
depth_chart_positioncharacterPosition assigned on depth chart. Not always accurate!
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
statuscharacterStatus label.
full_namecharacterFull name as per NFL.com
first_namecharacterFirst name of player
last_namecharacterLast name of player
birth_datecharacterPlayer birth date (sourced from NFL. Other sources may differ)
heightdoubleOfficial height, in inches
weightintegerOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
espn_idcharacterESPN ID - usual format is an integer with ~5 digits
sportradar_idcharacterSportRadar ID - often also called sportsdata_id by other services. A UUID.
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
rotowire_idcharacterRotowire ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
pff_idcharacterPro Football Focus ID - usually an integer with between 3 and 6 digits.
pfr_idcharacterPro-Football-Reference ID for player
fantasy_data_idcharacterFantasyData ID - usual format five digit integer
sleeper_idcharacterSleeper ID - usually an integer with ~4 digits.
years_expintegerYears played in league
headshot_urlcharacterA URL string that points to player photos used by NFL.com (or sometimes ESPN)
ngs_positioncharacterPrimary position as reported by the NextGen stats API.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
status_description_abbrcharacterA code corresponding to a particular NFL status.
football_namecharacterCommon player name (i.e. in most cases common_first_name last_name)
esb_idcharacterPlayer ID for Elias Sports Bureau
gsis_it_idcharacterPlayer ID for the GSIS IT API
smart_idcharacterSMART ID for player (that's in raw pbp. It includes a hashed ESB_ID)
entry_yearintegerThe year a player first became eligible to play in the NFL.
rookie_yearintegerThe year a player lost their rookie eligibility.
draft_clubcharacterThe team that originally drafted a player. NA if a player went undrafted in their draft-eligible year.
draft_numberintegerThe number pick that was used to select a given player.

Example

from sportsdataverse.nfl import load_nfl_rosters
rosters = load_nfl_rosters(seasons=[2024])

# Multi-season range

rosters = load_nfl_rosters(seasons=range(2020, 2025))

# Filter to a single team

import polars as pl
kc = load_nfl_rosters(seasons=[2024]).filter(pl.col("team") == "KC")

load_nfl_schedule(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL schedule data

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing the schedule for the requested seasons.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
weekintegerSeason week.
gamedaycharacterThe date on which the game occurred.
weekdaycharacterThe day of the week on which the game occcured.
gametimecharacterThe kickoff time of the game. This is represented in 24-hour time and the Eastern time zone, regardless of what time zone the game was being played in.
away_teamcharacterString abbreviation for the away team.
away_scoreintegerThe number of points the away team scored. Is NA for games which haven't yet been played.
home_teamcharacterThe home team. Note that this contains the designated home team for games which no team is playing at home such as Super Bowls or NFL International games.
home_scoreintegerThe number of points the home team scored. Is NA for games which haven't yet been played.
locationcharacterEither Home if the home team is playing in their home stadium, or Neutral if the game is being played at a neutral location. This still shows as Home for games between the Giants and Jets even though they share the same home stadium.
resultintegerThe number of points the home team scored minus the number of points the visiting team scored. Equals h_score - v_score. Is NA for games which haven't yet been played. Convenient for evaluating against the spread bets.
totalintegerThe 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.
overtimeintegerBinary indicator of whether or not game went to overtime.
old_game_idcharacterLegacy NFL game ID.
gsisintegerThe id of the game issued by the NFL Game Statistics & Information System.
nfl_detail_idcharacterThe id of the game issued by NFL Detail.
pfrcharacterThe id of the game issued by Pro-Football-Reference
pffintegerThe id of the game issued by Pro Football Focus
espncharacterThe id of the game issued by ESPN
ftninteger
away_restintegerDays of rest that the away team is coming off of.
home_restintegerDays of rest that the home team is coming off of.
away_moneylineintegerOdds for away team to win the game.
home_moneylineintegerOdds for home team to win the game.
spread_linedoubleThe closing spread line for the game. A positive number means the home team was favored by that many points, a negative number means the away team was favored by that many points. (Source: Pro-Football-Reference)
away_spread_oddsintegerOdds for away team to cover the spread.
home_spread_oddsintegerOdds for home team to cover the spread.
total_linedoubleThe closing total line for the game. (Source: Pro-Football-Reference)
under_oddsintegerOdds that total score of game would be under the total_line.
over_oddsintegerOdds that total score of game would be over the total_ine.
div_gameintegerBinary indicator of whether or not game was played by 2 teams in the same division.
roofcharacterOne of 'dome', 'outdoors', 'closed', 'open' indicating indicating the roof status of the stadium the game was played in. (Source: Pro-Football-Reference)
surfacecharacterWhat type of ground the game was played on. (Source: Pro-Football-Reference)
tempintegerThe temperature at the stadium only for 'roof' = 'outdoors' or 'open'.(Source: Pro-Football-Reference)
windintegerThe speed of the wind in miles/hour only for 'roof' = 'outdoors' or 'open'. (Source: Pro-Football-Reference)
away_qb_idcharacterGSIS Player ID for away team starting quarterback.
home_qb_idcharacterGSIS Player ID for home team starting quarterback.
away_qb_namecharacterName of away team starting QB.
home_qb_namecharacterName of home team starting QB.
away_coachcharacterFirst and last name of the away team coach. (Source: Pro-Football-Reference)
home_coachcharacterFirst and last name of the home team coach. (Source: Pro-Football-Reference)
refereecharacterName of the game's referee (head official)
stadium_idcharacterID of the stadium the game was played in. (Source: Pro-Football-Reference)
stadiumcharacterName of the stadium

Example

from sportsdataverse.nfl import load_nfl_schedule
schedule = load_nfl_schedule(seasons=[2024])
schedule.shape

# Multi-season range

schedule = load_nfl_schedule(seasons=range(2020, 2025))

# Filter to a single week

import polars as pl
week_one = load_nfl_schedule(seasons=[2024]).filter(pl.col("week") == 1)

# Pandas round-trip

schedule_pd = load_nfl_schedule(seasons=[2024], return_as_pandas=True)
schedule_pd[["game_id", "home_team", "away_team", "week"]].head()

load_nfl_snap_counts(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL snap counts data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2012 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing snap counts available for the requested seasons.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
weekintegerSeason week.
playercharacterPlayer name
pfr_player_idcharacterID from Pro Football Reference
positioncharacterPrimary position as reported by NFL.com
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
offense_snapsdoubleNumber of snaps on offense
offense_pctdoublePercent of offensive snaps taken
defense_snapsdoubleNumber of snaps on defense
defense_pctdoublePercent of defensive snaps taken
st_snapsdoubleNumber of snaps on special teams
st_pctdoublePercent of special teams snaps taken

Example

from sportsdataverse.nfl import load_nfl_snap_counts
snaps = load_nfl_snap_counts(seasons=[2024])

# Multi-season range with offense-only filter

import polars as pl
offense = (
load_nfl_snap_counts(seasons=range(2022, 2025))
.filter(pl.col("offense_snaps") > 0)
)

load_nfl_team_stats(seasons: 'List[int]', summary_level: 'str' = 'week', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL team stats data going back to 1999

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season.
summary_levelstr'week'Aggregation level. One of "week", "reg", "post", "reg+post". Defaults to "week".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing team stats available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
opponent_teamcharacter
completionsintegerThe number of completed passes.
attemptsintegerThe number of pass attempts as defined by the NFL.
passing_yardsintegerNumeric yards by the passer_player_name, including yards gained in pass plays with laterals. This should equal official passing statistics.
passing_tdsintegerThe number of passing touchdowns.
passing_interceptionsinteger
sacks_sufferedinteger
sack_yards_lostinteger
sack_fumblesintegerThe number of sacks with a fumble.
sack_fumbles_lostintegerThe number of sacks with a lost fumble.
passing_air_yardsintegerPassing air yards (includes incomplete passes).
passing_yards_after_catchintegerYards after the catch gained on plays in which player was the passer (this is an unofficial stat and may differ slightly between different sources).
passing_first_downsintegerFirst downs on pass attempts.
passing_epadoubleTotal expected points added on pass attempts and sacks. NOTE: this uses the variable qb_epa, which gives QB credit for EPA for up to the point where a receiver lost a fumble after a completed catch and makes EPA work more like passing yards on plays with fumbles.
passing_cpoedouble
passing_2pt_conversionsintegerTwo-point conversion passes.
carriesintegerThe number of official rush attempts (incl. scrambles and kneel downs). Rushes after a lateral reception don't count as carry.
rushing_yardsintegerNumeric yards by the rusher_player_name, excluding yards gained in rush plays with laterals. This should equal official rushing statistics but could miss yards gained in rush plays with laterals. Please see the description of lateral_rusher_player_name for further information.
rushing_tdsintegerThe number of rushing touchdowns (incl. scrambles). Also includes touchdowns after obtaining a lateral on a play that started with a rushing attempt.
rushing_fumblesintegerThe number of rushes with a fumble.
rushing_fumbles_lostintegerThe number of rushes with a lost fumble.
rushing_first_downsintegerFirst downs on rush attempts (incl. scrambles).
rushing_epadoubleExpected points added on rush attempts (incl. scrambles and kneel downs).
rushing_2pt_conversionsintegerTwo-point conversion rushes
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
targetsintegerThe number of pass plays where the player was the targeted receiver.
receiving_yardsintegerNumeric yards by the receiver_player_name, excluding yards gained in pass plays with laterals. This should equal official receiving statistics but could miss yards gained in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
receiving_tdsintegerThe number of touchdowns following a pass reception. Also includes touchdowns after receiving a lateral on a play that started as a pass play.
receiving_fumblesintegerThe number of fumbles after a pass reception.
receiving_fumbles_lostintegerThe number of fumbles lost after a pass reception.
receiving_air_yardsintegerReceiving air yards (incl. incomplete passes).
receiving_yards_after_catchintegerYards after the catch gained on plays in which player was receiver (this is an unofficial stat and may differ slightly between different sources).
receiving_first_downsintegerTotal number of first downs gained on receptions
receiving_epadoubleTotal EPA on plays where this receiver was targeted
receiving_2pt_conversionsintegerTwo-point conversion receptions
special_teams_tdsintegerTotal number of kick/punt return touchdowns
def_tackles_solointegerTotal number of solo tackles for this player
def_tackles_with_assistintegerNumber of tackles this player had with an assisted tackle
def_tackle_assistsintegerNumber of assisted tackles for this player
def_tackles_for_lossintegerNumber of tackles for loss (TFL) for this player
def_tackles_for_loss_yardsintegerYards lost from TFLs involving this player
def_fumbles_forcedintegerNumber of times a fumble was forced from this player
def_sacksdoubleNumber of sacks form this player
def_sack_yardsdoubleYards lost from sacks forced by this player
def_qb_hitsintegerNumber of QB hits from this player (should not include plays where the QB was sacked)
def_interceptionsintegerNumber of interceptions forced by this player
def_interception_yardsintegeryards gained/lost by interception returns from this player
def_pass_defendedintegerNumber of passes defended/broken up by this player
def_tdsintegerNumber of defensive touchdowns scored by this player
def_fumblesintegerNumber of fumbles by this player
def_safetiesinteger
misc_yardsinteger
fumble_recovery_owninteger
fumble_recovery_yards_owninteger
fumble_recovery_oppinteger
fumble_recovery_yards_oppinteger
fumble_recovery_tdsinteger
penaltiesintegerTotal number of penalties.
penalty_yardsintegerYards gained (or lost) by the posteam from the penalty.
timeoutsinteger
punt_returnsintegerNumber of punt returns.
punt_return_yardsintegerTeam punt return yards.
kickoff_returnsinteger
kickoff_return_yardsinteger
fg_madeintegerTRUE when the field goal attempt was successful.
fg_attinteger
fg_missedinteger
fg_blockedinteger
fg_longinteger
fg_pctdoubleField goal percentage (0-1).
fg_made_0_19integer
fg_made_20_29integer
fg_made_30_39integer
fg_made_40_49integer
fg_made_50_59integer
fg_made_60_integer
fg_missed_0_19integer
fg_missed_20_29integer
fg_missed_30_39integer
fg_missed_40_49integer
fg_missed_50_59integer
fg_missed_60_integer
fg_made_listcharacter
fg_missed_listcharacter
fg_blocked_listcharacter
fg_made_distanceinteger
fg_missed_distanceinteger
fg_blocked_distanceinteger
pat_madeinteger
pat_attinteger
pat_missedinteger
pat_blockedinteger
pat_pctdouble
gwfg_madeinteger
gwfg_attinteger
gwfg_missedinteger
gwfg_blockedinteger
gwfg_distanceinteger

Example

from sportsdataverse.nfl import load_nfl_team_stats
weekly = load_nfl_team_stats(seasons=[2024])

# Regular-season-only team stats

reg = load_nfl_team_stats(seasons=[2024], summary_level="reg")

# Combined regular + post-season at season grain

combined = load_nfl_team_stats(seasons=[2023, 2024], summary_level="reg+post")

load_nfl_teams(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL team ID information and logos

Parameters

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

Returns

Polars dataframe containing teams available.

col_nametypedescription
team_abbrcharacterOfficial team abbreveation
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_idintegerUnique team identifier.
team_nickcharacter
team_confcharacter
team_divisioncharacter
team_colorcharacterTeam primary color (hex without leading '#').
team_color2character
team_color3character
team_color4character
team_logo_wikipediacharacter
team_logo_espncharacter
team_wordmarkcharacter
team_conference_logocharacter
team_league_logocharacter
team_logo_squaredcharacter

Example

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

# Pandas round-trip

teams_pd = load_nfl_teams(return_as_pandas=True)
teams_pd[["team_abbr", "team_name", "team_conf", "team_division"]].head()

load_nfl_trades(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL trades data

Parameters

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

Returns

Polars dataframe containing NFL trade information.

col_nametypedescription
trade_idintegerID of Trade
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
trade_datecharacterExact date that trade occurred
gavecharacterTeam that gave pick/player in row
receivedcharacterTeam that received pick/player in row
pick_seasonintegerDraft in which traded pick was in
pick_roundintegerRound in which traded pick was in
pick_numberintegerPick number of traded pick
conditionalintegerBinary indicator of whether or not traded pick was conditional
pfr_idcharacterPro-Football-Reference ID for player
pfr_namecharacterFull name of traded player

Example

from sportsdataverse.nfl import load_nfl_trades
trades = load_nfl_trades()
trades.shape

# Filter to a single season

import polars as pl
trades_2024 = load_nfl_trades().filter(pl.col("season") == 2024)

load_nfl_weekly_rosters(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL weekly roster data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2002 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing weekly rosters available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
positioncharacterPrimary position as reported by NFL.com
depth_chart_positioncharacterPosition assigned on depth chart. Not always accurate!
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
statuscharacterStatus label.
full_namecharacterFull name as per NFL.com
first_namecharacterFirst name of player
last_namecharacterLast name of player
birth_datecharacterPlayer birth date (sourced from NFL. Other sources may differ)
heightdoubleOfficial height, in inches
weightintegerOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
espn_idcharacterESPN ID - usual format is an integer with ~5 digits
sportradar_idcharacterSportRadar ID - often also called sportsdata_id by other services. A UUID.
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
rotowire_idcharacterRotowire ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
pff_idcharacterPro Football Focus ID - usually an integer with between 3 and 6 digits.
pfr_idcharacterPro-Football-Reference ID for player
fantasy_data_idcharacterFantasyData ID - usual format five digit integer
sleeper_idcharacterSleeper ID - usually an integer with ~4 digits.
years_expintegerYears played in league
headshot_urlcharacterA URL string that points to player photos used by NFL.com (or sometimes ESPN)
ngs_positioncharacterPrimary position as reported by the NextGen stats API.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
status_description_abbrcharacterA code corresponding to a particular NFL status.
football_namecharacterCommon player name (i.e. in most cases common_first_name last_name)
esb_idcharacterPlayer ID for Elias Sports Bureau
gsis_it_idcharacterPlayer ID for the GSIS IT API
smart_idcharacterSMART ID for player (that's in raw pbp. It includes a hashed ESB_ID)
entry_yearintegerThe year a player first became eligible to play in the NFL.
rookie_yearintegerThe year a player lost their rookie eligibility.
draft_clubcharacterThe team that originally drafted a player. NA if a player went undrafted in their draft-eligible year.
draft_numberintegerThe number pick that was used to select a given player.

Example

from sportsdataverse.nfl import load_nfl_weekly_rosters
weekly = load_nfl_weekly_rosters(seasons=[2024])

# Multi-season range with a follow-up week filter

import polars as pl
wk1 = (
load_nfl_weekly_rosters(seasons=range(2022, 2025))
.filter(pl.col("week") == 1)
)

load_officials(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Officials information

Parameters

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

Returns

Polars dataframe containing officials available.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
game_keycharacter
official_namecharacterOfficial name.
positioncharacterPrimary position as reported by NFL.com
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
official_idcharacterUnique official / referee identifier.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.

Example

from sportsdataverse.nfl import load_nfl_officials
officials = load_nfl_officials()
officials.shape

# Pandas round-trip

officials_pd = load_nfl_officials(return_as_pandas=True)
officials_pd.head()

load_participation(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL play-by-play participation data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2016 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing play-by-play participation data available for the requested seasons.

col_nametypedescription
nflverse_game_idcharacternflverse identifier for games. Format is season, week, away_team, home_team
old_game_idcharacterLegacy NFL game ID.
play_iddoubleNumeric play id that when used with game_id and drive provides the unique identifier for a single play.
possession_teamcharacterString abbreviation for the team with possession.
offense_formationcharacterFormation the offense lines up in to snap the ball.
offense_personnelcharacterThe positions of the offensive personnel lined up on the field for a play.
defenders_in_boxintegerNumber of defensive players lined up in the box at the snap.
defense_personnelcharacterThe positions of the defensive personnel lined up on the field for a play.
number_of_pass_rushersintegerNumber of defensive player who rushed the passer.
players_on_playcharacterA list of every player on the field for the play, by gsis_id
offense_playerscharacterA list of every offensive player on the field for the play, by gsis_id
defense_playerscharacterA list of every defensive player on the field for the play, by gsis_id
n_offenseintegerNumber of offensive players on the field for the play
n_defenseintegerNumber of defensive players on the field for the play
ngs_air_yardsdoubleLegacy column. For 2023 and prior years, reflects the distance (in yards) that the ball traveled in the air on a given passing play as tracked by NGS. Is NA for 2024 on--we advise instead using the air_yards column from nflreadr::load_pbp() moving forward.
time_to_throwdoubleDuration (in seconds) between the time of the ball being snapped and the time of release of a pass attempt
was_pressurelogicalA boolean indicating whether or not the QB was pressured on a play
routecharacterA string indicating the route the primary receiver on a play took. Has the following possible values: "CORNER", "DEEP OUT", "GO", "HITCH/CURL", "IN/DIG", "POST", "QUICK OUT", "SCREEN", "SHALLOW CROSS/DRAG", "SLANT", "SWING", "TEXAS/ANGLE", "WHEEL".
defense_man_zone_typecharacterA string indicating whether the defense was in man or zone coverage on a play
defense_coverage_typecharacterA string indicating what type of cover the defense was in on a play. Has one of the following values: "COVER_0", "COVER_1", "COVER_2", "2_MAN", "COVER_3", "COVER_4", "COVER_6", "COVER_9", "COMBO", "BLOWN".
offense_namescharacterA string listing all of the names of offensive players in the order of their gsis_ids in offense_players.
defense_namescharacterA string listing all of the names of defensive players in the order of their gsis_ids in defense_players.
offense_positionscharacterA string listing all of the positions of offensive players in the order of their gsis_ids in offense_players.
defense_positionscharacterA string listing all of the positions of defensive players in the order of their gsis_ids in defense_players.
offense_numberscharacterA string listing all of the numbers of offensive players in the order of their gsis_ids in offense_players.
defense_numberscharacterA string listing all of the numbers of defensive players in the order of their gsis_ids in defense_players.

Example

from sportsdataverse.nfl import load_nfl_pbp_participation
participation = load_nfl_pbp_participation(seasons=[2022])

# Multi-season range

participation = load_nfl_pbp_participation(seasons=range(2018, 2023))

load_pbp(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL play by play data going back to 1999

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing the play-by-plays available for the requested seasons.

col_nametypedescription
play_iddoubleNumeric play id that when used with game_id and drive provides the unique identifier for a single play.
game_idcharacterTen digit identifier for NFL game.
old_game_idcharacterLegacy NFL game ID.
home_teamcharacterThe home team. Note that this contains the designated home team for games which no team is playing at home such as Super Bowls or NFL International games.
away_teamcharacterString abbreviation for the away team.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.
posteamcharacterString abbreviation for the team with possession.
posteam_typecharacterString indicating whether the posteam team is home or away.
defteamcharacterString abbreviation for the team on defense.
side_of_fieldcharacterString abbreviation for which team's side of the field the team with possession is currently on.
yardline_100doubleNumeric distance in the number of yards from the opponent's endzone for the posteam.
game_datecharacterDate of the game.
quarter_seconds_remainingdoubleNumeric seconds remaining in the quarter.
half_seconds_remainingdoubleNumeric seconds remaining in the half.
game_seconds_remainingdoubleNumeric seconds remaining in the game.
game_halfcharacterString indicating which half the play is in, either Half1, Half2, or Overtime.
quarter_enddoubleBinary indicator for whether or not the row of the data is marking the end of a quarter.
drivedoubleNumeric drive number in the game.
spdoubleBinary indicator for whether or not a score occurred on the play.
qtrdoubleQuarter of the game (5 is overtime).
downdoubleThe down for the given play.
goal_to_gointegerBinary indicator for whether or not the posteam is in a goal down situation.
timecharacterTime at start of play provided in string format as minutes:seconds remaining in the quarter.
yrdlncharacterString indicating the current field position for a given play.
ydstogodoubleNumeric yards in distance from either the first down marker or the endzone in goal down situations.
ydsnetdoubleNumeric value for total yards gained on the given drive.
desccharacterDetailed string description for the given play.
play_typecharacterString indicating the type of play: pass (includes sacks), run (includes scrambles), punt, field_goal, kickoff, extra_point, qb_kneel, qb_spike, no_play (timeouts and penalties), and missing for rows indicating end of play.
yards_gaineddoubleNumeric yards gained (or lost) by the possessing team, excluding yards gained via fumble recoveries and laterals.
shotgundoubleBinary indicator for whether or not the play was in shotgun formation.
no_huddledoubleBinary indicator for whether or not the play was in no_huddle formation.
qb_dropbackdoubleBinary indicator for whether or not the QB dropped back on the play (pass attempt, sack, or scrambled).
qb_kneeldoubleBinary indicator for whether or not the QB took a knee.
qb_spikedoubleBinary indicator for whether or not the QB spiked the ball.
qb_scrambledoubleBinary indicator for whether or not the QB scrambled.
pass_lengthcharacterString indicator for pass length: short or deep.
pass_locationcharacterString indicator for pass location: left, middle, or right.
air_yardsdoubleNumeric value for distance in yards perpendicular to the line of scrimmage at where the targeted receiver either caught or didn't catch the ball.
yards_after_catchdoubleNumeric value for distance in yards perpendicular to the yard line where the receiver made the reception to where the play ended.
run_locationcharacterString indicator for location of run: left, middle, or right.
run_gapcharacterString indicator for line gap of run: end, guard, or tackle
field_goal_resultcharacterString indicator for result of field goal attempt: made, missed, or blocked.
kick_distancedoubleNumeric distance in yards for kickoffs, field goals, and punts.
extra_point_resultcharacterString indicator for the result of the extra point attempt: good, failed, blocked, safety (touchback in defensive endzone is 1 point apparently), or aborted.
two_point_conv_resultcharacterString indicator for result of two point conversion attempt: success, failure, safety (touchback in defensive endzone is 1 point apparently), or return.
home_timeouts_remainingdoubleNumeric timeouts remaining in the half for the home team.
away_timeouts_remainingdoubleNumeric timeouts remaining in the half for the away team.
timeoutdoubleBinary indicator for whether or not a timeout was called by either team.
timeout_teamcharacterString abbreviation for which team called the timeout.
td_teamcharacterString abbreviation for which team scored the touchdown.
td_player_namecharacterString name of the player who scored a touchdown.
td_player_idcharacterUnique identifier of the player who scored a touchdown.
posteam_timeouts_remainingdoubleNumber of timeouts remaining for the possession team.
defteam_timeouts_remainingdoubleNumber of timeouts remaining for the team on defense.
total_home_scoredoubleScore for the home team at the start of the play.
total_away_scoredoubleScore for the away team at the start of the play.
posteam_scoredoubleScore the posteam at the start of the play.
defteam_scoredoubleScore the defteam at the start of the play.
score_differentialdoubleScore differential between the posteam and defteam at the start of the play.
posteam_score_postdoubleScore for the posteam at the end of the play.
defteam_score_postdoubleScore for the defteam at the end of the play.
score_differential_postdoubleScore differential between the posteam and defteam at the end of the play.
no_score_probdoublePredicted probability of no score occurring for the rest of the half based on the expected points model.
opp_fg_probdoublePredicted probability of the defteam scoring a FG next. 'Next' in this context means the next score in the same game half.
opp_safety_probdoublePredicted probability of the defteam scoring a safety next. 'Next' in this context means the next score in the same game half.
opp_td_probdoublePredicted probability of the defteam scoring a TD next. 'Next' in this context means the next score in the same game half.
fg_probdoublePredicted probability of the posteam scoring a FG next. 'Next' in this context means the next score in the same game half.
safety_probdoublePredicted probability of the posteam scoring a safety next. 'Next' in this context means the next score in the same game half.
td_probdoublePredicted probability of the posteam scoring a TD next. 'Next' in this context means the next score in the same game half.
extra_point_probdoublePredicted probability of the posteam scoring an extra point.
two_point_conversion_probdoublePredicted probability of the posteam scoring the two point conversion.
epdoubleUsing the scoring event probabilities, the estimated expected points with respect to the possession team for the given play.
epadoubleExpected points added (EPA) by the posteam for the given play.
total_home_epadoubleCumulative total EPA for the home team in the game so far.
total_away_epadoubleCumulative total EPA for the away team in the game so far.
total_home_rush_epadoubleCumulative total rushing EPA for the home team in the game so far.
total_away_rush_epadoubleCumulative total rushing EPA for the away team in the game so far.
total_home_pass_epadoubleCumulative total passing EPA for the home team in the game so far.
total_away_pass_epadoubleCumulative total passing EPA for the away team in the game so far.
air_epadoubleEPA from the air yards alone. For completions this represents the actual value provided through the air. For incompletions this represents the hypothetical value that could've been added through the air if the pass was completed.
yac_epadoubleEPA from the yards after catch alone. For completions this represents the actual value provided after the catch. For incompletions this represents the difference between the hypothetical air_epa and the play's raw observed EPA (how much the incomplete pass cost the posteam).
comp_air_epadoubleEPA from the air yards alone only for completions.
comp_yac_epadoubleEPA from the yards after catch alone only for completions.
total_home_comp_air_epadoubleCumulative total completions air EPA for the home team in the game so far.
total_away_comp_air_epadoubleCumulative total completions air EPA for the away team in the game so far.
total_home_comp_yac_epadoubleCumulative total completions yac EPA for the home team in the game so far.
total_away_comp_yac_epadoubleCumulative total completions yac EPA for the away team in the game so far.
total_home_raw_air_epadoubleCumulative total raw air EPA for the home team in the game so far.
total_away_raw_air_epadoubleCumulative total raw air EPA for the away team in the game so far.
total_home_raw_yac_epadoubleCumulative total raw yac EPA for the home team in the game so far.
total_away_raw_yac_epadoubleCumulative total raw yac EPA for the away team in the game so far.
wpdoubleEstimated win probabiity for the posteam given the current situation at the start of the given play.
def_wpdoubleEstimated win probability for the defteam.
home_wpdoubleEstimated win probability for the home team.
away_wpdoubleEstimated win probability for the away team.
wpadoubleWin probability added (WPA) for the posteam.
vegas_wpadoubleWin probability added (WPA) for the posteam: spread_adjusted model.
vegas_home_wpadoubleWin probability added (WPA) for the home team: spread_adjusted model.
home_wp_postdoubleEstimated win probability for the home team at the end of the play.
away_wp_postdoubleEstimated win probability for the away team at the end of the play.
vegas_wpdoubleEstimated win probabiity for the posteam given the current situation at the start of the given play, incorporating pre-game Vegas line.
vegas_home_wpdoubleEstimated win probability for the home team incorporating pre-game Vegas line.
total_home_rush_wpadoubleCumulative total rushing WPA for the home team in the game so far.
total_away_rush_wpadoubleCumulative total rushing WPA for the away team in the game so far.
total_home_pass_wpadoubleCumulative total passing WPA for the home team in the game so far.
total_away_pass_wpadoubleCumulative total passing WPA for the away team in the game so far.
air_wpadoubleWPA through the air (same logic as air_epa).
yac_wpadoubleWPA from yards after the catch (same logic as yac_epa).
comp_air_wpadoubleThe air_wpa for completions only.
comp_yac_wpadoubleThe yac_wpa for completions only.
total_home_comp_air_wpadoubleCumulative total completions air WPA for the home team in the game so far.
total_away_comp_air_wpadoubleCumulative total completions air WPA for the away team in the game so far.
total_home_comp_yac_wpadoubleCumulative total completions yac WPA for the home team in the game so far.
total_away_comp_yac_wpadoubleCumulative total completions yac WPA for the away team in the game so far.
total_home_raw_air_wpadoubleCumulative total raw air WPA for the home team in the game so far.
total_away_raw_air_wpadoubleCumulative total raw air WPA for the away team in the game so far.
total_home_raw_yac_wpadoubleCumulative total raw yac WPA for the home team in the game so far.
total_away_raw_yac_wpadoubleCumulative total raw yac WPA for the away team in the game so far.
punt_blockeddoubleBinary indicator for if the punt was blocked.
first_down_rushdoubleBinary indicator for if a running play converted the first down.
first_down_passdoubleBinary indicator for if a passing play converted the first down.
first_down_penaltydoubleBinary indicator for if a penalty converted the first down.
third_down_converteddoubleBinary indicator for if the first down was converted on third down.
third_down_faileddoubleBinary indicator for if the posteam failed to convert first down on third down.
fourth_down_converteddoubleBinary indicator for if the first down was converted on fourth down.
fourth_down_faileddoubleBinary indicator for if the posteam failed to convert first down on fourth down.
incomplete_passdoubleBinary indicator for if the pass was incomplete.
touchbackdoubleBinary indicator for if a touchback occurred on the play.
interceptiondoubleBinary indicator for if the pass was intercepted.
punt_inside_twentydoubleBinary indicator for if the punt ended inside the twenty yard line.
punt_in_endzonedoubleBinary indicator for if the punt was in the endzone.
punt_out_of_boundsdoubleBinary indicator for if the punt went out of bounds.
punt_downeddoubleBinary indicator for if the punt was downed.
punt_fair_catchdoubleBinary indicator for if the punt was caught with a fair catch.
kickoff_inside_twentydoubleBinary indicator for if the kickoff ended inside the twenty yard line.
kickoff_in_endzonedoubleBinary indicator for if the kickoff was in the endzone.
kickoff_out_of_boundsdoubleBinary indicator for if the kickoff went out of bounds.
kickoff_downeddoubleBinary indicator for if the kickoff was downed.
kickoff_fair_catchdoubleBinary indicator for if the kickoff was caught with a fair catch.
fumble_forceddoubleBinary indicator for if the fumble was forced.
fumble_not_forceddoubleBinary indicator for if the fumble was not forced.
fumble_out_of_boundsdoubleBinary indicator for if the fumble went out of bounds.
solo_tackledoubleBinary indicator if the play had a solo tackle (could be multiple due to fumbles).
safetydoubleBinary indicator for whether or not a safety occurred.
penaltydoubleBinary indicator for whether or not a penalty occurred.
tackled_for_lossdoubleBinary indicator for whether or not a tackle for loss on a run play occurred.
fumble_lostdoubleBinary indicator for if the fumble was lost.
own_kickoff_recoverydoubleBinary indicator for if the kicking team recovered the kickoff.
own_kickoff_recovery_tddoubleBinary indicator for if the kicking team recovered the kickoff and scored a TD.
qb_hitdoubleBinary indicator if the QB was hit on the play.
rush_attemptdoubleBinary indicator for if the play was a run.
pass_attemptdoubleBinary indicator for if the play was a pass attempt (includes sacks).
sackdoubleBinary indicator for if the play ended in a sack.
touchdowndoubleBinary indicator for if the play resulted in a TD.
pass_touchdowndoubleBinary indicator for if the play resulted in a passing TD.
rush_touchdowndoubleBinary indicator for if the play resulted in a rushing TD.
return_touchdowndoubleBinary indicator for if the play resulted in a return TD. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
extra_point_attemptdoubleBinary indicator for extra point attempt.
two_point_attemptdoubleBinary indicator for two point conversion attempt.
field_goal_attemptdoubleBinary indicator for field goal attempt.
kickoff_attemptdoubleBinary indicator for kickoff.
punt_attemptdoubleBinary indicator for punts.
fumbledoubleBinary indicator for if a fumble occurred.
complete_passdoubleBinary indicator for if the pass was completed.
assist_tackledoubleBinary indicator for if an assist tackle occurred.
lateral_receptiondoubleBinary indicator for if a lateral occurred on the reception.
lateral_rushdoubleBinary indicator for if a lateral occurred on a run.
lateral_returndoubleBinary indicator for if a lateral occurred on a return. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
lateral_recoverydoubleBinary indicator for if a lateral occurred on a fumble recovery.
passer_player_idcharacterUnique identifier for the player that attempted the pass.
passer_player_namecharacterString name for the player that attempted the pass.
passing_yardsdoubleNumeric yards by the passer_player_name, including yards gained in pass plays with laterals. This should equal official passing statistics.
receiver_player_idcharacterUnique identifier for the receiver that was targeted on the pass.
receiver_player_namecharacterString name for the targeted receiver.
receiving_yardsdoubleNumeric yards by the receiver_player_name, excluding yards gained in pass plays with laterals. This should equal official receiving statistics but could miss yards gained in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
rusher_player_idcharacterUnique identifier for the player that attempted the run.
rusher_player_namecharacterString name for the player that attempted the run.
rushing_yardsdoubleNumeric yards by the rusher_player_name, excluding yards gained in rush plays with laterals. This should equal official rushing statistics but could miss yards gained in rush plays with laterals. Please see the description of lateral_rusher_player_name for further information.
lateral_receiver_player_idcharacterUnique identifier for the player that received the last(!) lateral on a pass play.
lateral_receiver_player_namecharacterString name for the player that received the last(!) lateral on a pass play. If there were multiple laterals in the same play, this will only be the last player who received a lateral. Please see https://github.com/mrcaseb/nfl-data/tree/master/data/lateral_yards for a list of plays where multiple players recorded lateral receiving yards.
lateral_receiving_yardsdoubleNumeric yards by the lateral_receiver_player_name in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
lateral_rusher_player_idcharacterUnique identifier for the player that received the last(!) lateral on a run play.
lateral_rusher_player_namecharacterString name for the player that received the last(!) lateral on a run play. If there were multiple laterals in the same play, this will only be the last player who received a lateral. Please see https://github.com/mrcaseb/nfl-data/tree/master/data/lateral_yards for a list of plays where multiple players recorded lateral rushing yards.
lateral_rushing_yardsdoubleNumeric yards by the lateral_rusher_player_name in run plays with laterals. Please see the description of lateral_rusher_player_name for further information.
lateral_sack_player_idcharacterUnique identifier for the player that received the lateral on a sack.
lateral_sack_player_namecharacterString name for the player that received the lateral on a sack.
interception_player_idcharacterUnique identifier for the player that intercepted the pass.
interception_player_namecharacterString name for the player that intercepted the pass.
lateral_interception_player_idcharacterUnique indentifier for the player that received the lateral on an interception.
lateral_interception_player_namecharacterString name for the player that received the lateral on an interception.
punt_returner_player_idcharacterUnique identifier for the punt returner.
punt_returner_player_namecharacterString name for the punt returner.
lateral_punt_returner_player_idcharacterUnique identifier for the player that received the lateral on a punt return.
lateral_punt_returner_player_namecharacterString name for the player that received the lateral on a punt return.
kickoff_returner_player_namecharacterString name for the kickoff returner.
kickoff_returner_player_idcharacterUnique identifier for the kickoff returner.
lateral_kickoff_returner_player_idcharacterUnique identifier for the player that received the lateral on a kickoff return.
lateral_kickoff_returner_player_namecharacterString name for the player that received the lateral on a kickoff return.
punter_player_idcharacterUnique identifier for the punter.
punter_player_namecharacterString name for the punter.
kicker_player_namecharacterString name for the kicker on FG or kickoff.
kicker_player_idcharacterUnique identifier for the kicker on FG or kickoff.
own_kickoff_recovery_player_idcharacterUnique identifier for the player that recovered their own kickoff.
own_kickoff_recovery_player_namecharacterString name for the player that recovered their own kickoff.
blocked_player_idcharacterUnique identifier for the player that blocked the punt or FG.
blocked_player_namecharacterString name for the player that blocked the punt or FG.
tackle_for_loss_1_player_idcharacterUnique identifier for one of the potential players with the tackle for loss.
tackle_for_loss_1_player_namecharacterString name for one of the potential players with the tackle for loss.
tackle_for_loss_2_player_idcharacterUnique identifier for one of the potential players with the tackle for loss.
tackle_for_loss_2_player_namecharacterString name for one of the potential players with the tackle for loss.
qb_hit_1_player_idcharacterUnique identifier for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
qb_hit_1_player_namecharacterString name for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
qb_hit_2_player_idcharacterUnique identifier for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
qb_hit_2_player_namecharacterString name for one of the potential players that hit the QB. No sack as the QB was not the ball carrier. For sacks please see sack_player or half_sack_*_player.
forced_fumble_player_1_teamcharacterTeam of one of the players with a forced fumble.
forced_fumble_player_1_player_idcharacterUnique identifier of one of the players with a forced fumble.
forced_fumble_player_1_player_namecharacterString name of one of the players with a forced fumble.
forced_fumble_player_2_teamcharacterTeam of one of the players with a forced fumble.
forced_fumble_player_2_player_idcharacterUnique identifier of one of the players with a forced fumble.
forced_fumble_player_2_player_namecharacterString name of one of the players with a forced fumble.
solo_tackle_1_teamcharacterTeam of one of the players with a solo tackle.
solo_tackle_2_teamcharacterTeam of one of the players with a solo tackle.
solo_tackle_1_player_idcharacterUnique identifier of one of the players with a solo tackle.
solo_tackle_2_player_idcharacterUnique identifier of one of the players with a solo tackle.
solo_tackle_1_player_namecharacterString name of one of the players with a solo tackle.
solo_tackle_2_player_namecharacterString name of one of the players with a solo tackle.
assist_tackle_1_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_1_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_1_teamcharacterTeam of one of the players with a tackle assist.
assist_tackle_2_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_2_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_2_teamcharacterTeam of one of the players with a tackle assist.
assist_tackle_3_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_3_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_3_teamcharacterTeam of one of the players with a tackle assist.
assist_tackle_4_player_idcharacterUnique identifier of one of the players with a tackle assist.
assist_tackle_4_player_namecharacterString name of one of the players with a tackle assist.
assist_tackle_4_teamcharacterTeam of one of the players with a tackle assist.
tackle_with_assistdoubleBinary indicator for if there has been a tackle with assist.
tackle_with_assist_1_player_idcharacterUnique identifier of one of the players with a tackle with assist.
tackle_with_assist_1_player_namecharacterString name of one of the players with a tackle with assist.
tackle_with_assist_1_teamcharacterTeam of one of the players with a tackle with assist.
tackle_with_assist_2_player_idcharacterUnique identifier of one of the players with a tackle with assist.
tackle_with_assist_2_player_namecharacterString name of one of the players with a tackle with assist.
tackle_with_assist_2_teamcharacterTeam of one of the players with a tackle with assist.
pass_defense_1_player_idcharacterUnique identifier of one of the players with a pass defense.
pass_defense_1_player_namecharacterString name of one of the players with a pass defense.
pass_defense_2_player_idcharacterUnique identifier of one of the players with a pass defense.
pass_defense_2_player_namecharacterString name of one of the players with a pass defense.
fumbled_1_teamcharacterTeam of one of the first player with a fumble.
fumbled_1_player_idcharacterUnique identifier of the first player who fumbled on the play.
fumbled_1_player_namecharacterString name of one of the first player who fumbled on the play.
fumbled_2_player_idcharacterUnique identifier of the second player who fumbled on the play.
fumbled_2_player_namecharacterString name of one of the second player who fumbled on the play.
fumbled_2_teamcharacterTeam of one of the second player with a fumble.
fumble_recovery_1_teamcharacterTeam of one of the players with a fumble recovery.
fumble_recovery_1_yardsdoubleYards gained by one of the players with a fumble recovery.
fumble_recovery_1_player_idcharacterUnique identifier of one of the players with a fumble recovery.
fumble_recovery_1_player_namecharacterString name of one of the players with a fumble recovery.
fumble_recovery_2_teamcharacterTeam of one of the players with a fumble recovery.
fumble_recovery_2_yardsdoubleYards gained by one of the players with a fumble recovery.
fumble_recovery_2_player_idcharacterUnique identifier of one of the players with a fumble recovery.
fumble_recovery_2_player_namecharacterString name of one of the players with a fumble recovery.
sack_player_idcharacterUnique identifier of the player who recorded a solo sack.
sack_player_namecharacterString name of the player who recorded a solo sack.
half_sack_1_player_idcharacterUnique identifier of the first player who recorded half a sack.
half_sack_1_player_namecharacterString name of the first player who recorded half a sack.
half_sack_2_player_idcharacterUnique identifier of the second player who recorded half a sack.
half_sack_2_player_namecharacterString name of the second player who recorded half a sack.
return_teamcharacterString abbreviation of the return team. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
return_yardsdoubleYards gained by the return team. Returns may occur on any of: interception, fumble, kickoff, punt, or blocked kicks.
penalty_teamcharacterString abbreviation of the team with the penalty.
penalty_player_idcharacterUnique identifier for the player with the penalty.
penalty_player_namecharacterString name for the player with the penalty.
penalty_yardsdoubleYards gained (or lost) by the posteam from the penalty.
replay_or_challengedoubleBinary indicator for whether or not a replay or challenge.
replay_or_challenge_resultcharacterString indicating the result of the replay or challenge.
penalty_typecharacterString indicating the penalty type of the first penalty in the given play. Will be NA if desc is missing the type.
defensive_two_point_attemptdoubleBinary indicator whether or not the defense was able to have an attempt on a two point conversion, this results following a turnover.
defensive_two_point_convdoubleBinary indicator whether or not the defense successfully scored on the two point conversion.
defensive_extra_point_attemptdoubleBinary indicator whether or not the defense was able to have an attempt on an extra point attempt, this results following a blocked attempt that the defense recovers the ball.
defensive_extra_point_convdoubleBinary indicator whether or not the defense successfully scored on an extra point attempt.
safety_player_namecharacterString name for the player who scored a safety.
safety_player_idcharacterUnique identifier for the player who scored a safety.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
cpdoubleNumeric value indicating the probability for a complete pass based on comparable game situations.
cpoedoubleFor a single pass play this is 1 - cp when the pass was completed or 0 - cp when the pass was incomplete. Analyzed for a whole game or season an indicator for the passer how much over or under expectation his completion percentage was.
seriesdoubleStarts at 1, each new first down increments, numbers shared across both teams NA: kickoffs, extra point/two point conversion attempts, non-plays, no posteam
series_successdouble1: scored touchdown, gained enough yards for first down.
series_resultcharacterPossible values: First down, Touchdown, Opp touchdown, Field goal, Missed field goal, Safety, Turnover, Punt, Turnover on downs, QB kneel, End of half
order_sequencedoubleColumn provided by NFL to fix out-of-order plays. Available 2011 and beyond with source "nfl".
start_timecharacterKickoff time in eastern time zone.
time_of_daycharacterTime of day of play in UTC "HH:MM:SS" format. Available 2011 and beyond with source "nfl".
stadiumcharacterName of the stadium
weathercharacterString describing the weather including temperature, humidity and wind (direction and speed). Doesn't change during the game!
nfl_api_idcharacterUUID of the game in the new NFL API.
play_clockcharacterTime on the playclock when the ball was snapped.
play_deleteddoubleBinary indicator for deleted plays.
play_type_nflcharacterPlay type as listed in the NFL source. Slightly different to the regular play_type variable.
special_teams_playdoubleBinary indicator for whether play is special teams play from NFL source. Available 2011 and beyond with source "nfl".
st_play_typecharacterType of special teams play from NFL source. Available 2011 and beyond with source "nfl".
end_clock_timecharacterGame time at the end of a given play.
end_yard_linecharacterString indicating the yardline at the end of the given play consisting of team half and yard line number.
fixed_drivedoubleManually created drive number in a game.
fixed_drive_resultcharacterManually created drive result.
drive_real_start_timecharacterLocal day time when the drive started (currently not used by the NFL and therefore mostly 'NA').
drive_play_countdoubleNumeric value of how many regular plays happened in a given drive.
drive_time_of_possessioncharacterTime of possession in a given drive.
drive_first_downsdoubleNumber of first downs in a given drive.
drive_inside20doubleBinary indicator if the offense was able to get inside the opponents 20 yard line.
drive_ended_with_scoredoubleBinary indicator the drive ended with a score.
drive_quarter_startdoubleNumeric value indicating in which quarter the given drive has started.
drive_quarter_enddoubleNumeric value indicating in which quarter the given drive has ended.
drive_yards_penalizeddoubleNumeric value of how many yards the offense gained or lost through penalties in the given drive.
drive_start_transitioncharacterString indicating how the offense got the ball.
drive_end_transitioncharacterString indicating how the offense lost the ball.
drive_game_clock_startcharacterGame time at the beginning of a given drive.
drive_game_clock_endcharacterGame time at the end of a given drive.
drive_start_yard_linecharacterString indicating where a given drive started consisting of team half and yard line number.
drive_end_yard_linecharacterString indicating where a given drive ended consisting of team half and yard line number.
drive_play_id_starteddoublePlay_id of the first play in the given drive.
drive_play_id_endeddoublePlay_id of the last play in the given drive.
away_scoreintegerThe number of points the away team scored. Is NA for games which haven't yet been played.
home_scoreintegerThe number of points the home team scored. Is NA for games which haven't yet been played.
locationcharacterEither Home if the home team is playing in their home stadium, or Neutral if the game is being played at a neutral location. This still shows as Home for games between the Giants and Jets even though they share the same home stadium.
resultintegerThe number of points the home team scored minus the number of points the visiting team scored. Equals h_score - v_score. Is NA for games which haven't yet been played. Convenient for evaluating against the spread bets.
totalintegerThe 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.
spread_linedoubleThe closing spread line for the game. A positive number means the home team was favored by that many points, a negative number means the away team was favored by that many points. (Source: Pro-Football-Reference)
total_linedoubleThe closing total line for the game. (Source: Pro-Football-Reference)
div_gameintegerBinary indicator of whether or not game was played by 2 teams in the same division.
roofcharacterOne of 'dome', 'outdoors', 'closed', 'open' indicating indicating the roof status of the stadium the game was played in. (Source: Pro-Football-Reference)
surfacecharacterWhat type of ground the game was played on. (Source: Pro-Football-Reference)
tempintegerThe temperature at the stadium only for 'roof' = 'outdoors' or 'open'.(Source: Pro-Football-Reference)
windintegerThe speed of the wind in miles/hour only for 'roof' = 'outdoors' or 'open'. (Source: Pro-Football-Reference)
home_coachcharacterFirst and last name of the home team coach. (Source: Pro-Football-Reference)
away_coachcharacterFirst and last name of the away team coach. (Source: Pro-Football-Reference)
stadium_idcharacterID of the stadium the game was played in. (Source: Pro-Football-Reference)
game_stadiumcharacterName of the stadium the game was played in. (Source: Pro-Football-Reference)
aborted_playdoubleBinary indicator if the play description indicates "Aborted".
successdoubleBinary indicator wheter epa > 0 in the given play.
passercharacterName of the dropback player (scrambles included) including plays with penalties.
passer_jersey_numberintegerJersey number of the passer.
rushercharacterName of the rusher (no scrambles) including plays with penalties.
rusher_jersey_numberintegerJersey number of the rusher.
receivercharacterName of the receiver including plays with penalties.
receiver_jersey_numberintegerJersey number of the receiver.
passdoubleBinary indicator if the play was a pass play (sacks and scrambles included).
rushdoubleBinary indicator if the play was a rushing play.
first_downdoubleBinary indicator if the play ended in a first down.
specialdoubleBinary indicator if "play_type" is one of "extra_point", "field_goal", "kickoff", or "punt".
playdoubleBinary indicator: 1 if the play was a 'normal' play (including penalties), 0 otherwise.
passer_idcharacterID of the player in the 'passer' column.
rusher_idcharacterID of the player in the 'rusher' column.
receiver_idcharacterID of the player in the 'receiver' column.
namecharacterName, as reported by MFL but reordered into FirstName LastName instead of Last, First
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
idcharacterID of the player in the 'name' column.
fantasy_player_namecharacterName of the rusher on rush plays or receiver on pass plays (from official stats).
fantasy_player_idcharacterID of the rusher on rush plays or receiver on pass plays (from official stats).
fantasycharacterName of the rusher on rush plays or receiver on pass plays.
fantasy_idcharacterID of the rusher on rush plays or receiver on pass plays.
out_of_boundsdouble1 if play description contains ran ob, pushed ob, or sacked ob; 0 otherwise.
home_opening_kickoffdouble1 if the home team received the opening kickoff, 0 otherwise.
qb_epadoubleGives QB credit for EPA for up to the point where a receiver lost a fumble after a completed catch and makes EPA work more like passing yards on plays with fumbles.
xyac_epadoubleExpected value of EPA gained after the catch, starting from where the catch was made. Zero yards after the catch would be listed as zero EPA.
xyac_mean_yardagedoubleAverage expected yards after the catch based on where the ball was caught.
xyac_median_yardageintegerMedian expected yards after the catch based on where the ball was caught.
xyac_successdoubleProbability play earns positive EPA (relative to where play started) based on where ball was caught.
xyac_fddoubleProbability play earns a first down based on where the ball was caught.
xpassdoubleProbability of dropback scaled from 0 to 1.
pass_oedoubleDropback percent over expected on a given play scaled from 0 to 100.

Example

from sportsdataverse.nfl import load_nfl_pbp
pbp = load_nfl_pbp(seasons=[2024])
print(pbp.shape)

# Multi-season range

pbp = load_nfl_pbp(seasons=range(2020, 2025))

# With cache off (development workflow)

from sportsdataverse.nfl import load_nfl_pbp, update_config
update_config(cache_mode="off")
pbp = load_nfl_pbp(seasons=[2024])

# Pandas round-trip

pbp_pd = load_nfl_pbp(seasons=[2024], return_as_pandas=True)
pbp_pd.head()

load_pfr_advstats(seasons: 'List[int]', stat_type: 'str' = 'pass', summary_level: 'str' = 'week', return_as_pandas: 'bool' = False) -> 'pl.DataFrame'

Load Pro-Football Reference advanced statistics going back to 2018.

Unified loader that consolidates the per-stat-type / per-summary-level PFR advstats accessors. Mirrors the API surface of nflreadpy's load_pfr_advstats so downstream code can swap engines without changing call sites.

Parameters

ParameterTypeDefaultDescription
seasonslist[int]Seasons to load. For summary_level='week' this drives the per-season parquet fan-out; for summary_level='season' it post-filters the combined parquet by the season column.
stat_typestr'pass'One of "pass", "rush", "rec", "def". Defaults to "pass".
summary_levelstr'week'One of "week" or "season". Defaults to "week".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing PFR advanced stats data for the requested stat_type, summary_level, and seasons.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
pfr_player_namecharacterPlayer's name as recorded by PFR
pfr_player_idcharacterID from Pro Football Reference
passing_dropsdouble
passing_drop_pctdouble
receiving_dropdouble
receiving_drop_pctdouble
passing_bad_throwsdouble
passing_bad_throw_pctdouble
times_sackeddouble
times_blitzeddoubleNumber of times blitzed
times_hurrieddoubleNumber of times hurried
times_hitdoubleNumber of times hit
times_pressureddoubleNumber of times pressured
times_pressured_pctdouble
def_times_blitzeddouble
def_times_hurrieddouble
def_times_hitqbdouble

Example

from sportsdataverse.nfl import load_nfl_pfr_advstats
pass_week = load_nfl_pfr_advstats(
seasons=[2024], stat_type="pass", summary_level="week"
)

# Season-level rushing summaries (one row per player per season)

rush_season = load_nfl_pfr_advstats(
seasons=[2024], stat_type="rush", summary_level="season"
)

# Defensive stats with a follow-up filter

import polars as pl
def_week = (
load_nfl_pfr_advstats(seasons=[2024], stat_type="def", summary_level="week")
.filter(pl.col("week") <= 8)
)

# Pandas round-trip

rec_pd = load_nfl_pfr_advstats(
seasons=[2024],
stat_type="rec",
summary_level="season",
return_as_pandas=True,
)

load_player_stats(kicking=False, return_as_pandas=False) -> 'pl.DataFrame'

Load NFL player stats data

Parameters

ParameterTypeDefaultDescription
kickingboolFalseIf True, load kicking stats. If False, load all other stats.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing player stats.

col_nametypedescription
player_idcharacterPlayer ID (aka GSIS ID) as defined by nflreadr::load_rosters
player_namecharacterFull name of player
player_display_namecharacterFull name of the player
positioncharacterPrimary position as reported by NFL.com
position_groupcharacterPostion group of player as listed by NFL
headshot_urlcharacterA URL string that points to player photos used by NFL.com (or sometimes ESPN)
recent_teamcharacterMost recent team player appears in pbp with.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
opponent_teamcharacter
completionsintegerThe number of completed passes.
attemptsintegerThe number of pass attempts as defined by the NFL.
passing_yardsdoubleNumeric yards by the passer_player_name, including yards gained in pass plays with laterals. This should equal official passing statistics.
passing_tdsintegerThe number of passing touchdowns.
interceptionsdoubleThe number of interceptions thrown.
sacksdoubleThe Number of times sacked.
sack_yardsdoubleYards lost on sack plays.
sack_fumblesintegerThe number of sacks with a fumble.
sack_fumbles_lostintegerThe number of sacks with a lost fumble.
passing_air_yardsdoublePassing air yards (includes incomplete passes).
passing_yards_after_catchdoubleYards after the catch gained on plays in which player was the passer (this is an unofficial stat and may differ slightly between different sources).
passing_first_downsdoubleFirst downs on pass attempts.
passing_epadoubleTotal expected points added on pass attempts and sacks. NOTE: this uses the variable qb_epa, which gives QB credit for EPA for up to the point where a receiver lost a fumble after a completed catch and makes EPA work more like passing yards on plays with fumbles.
passing_2pt_conversionsintegerTwo-point conversion passes.
pacrdoublePassing (yards) Air (yards) Conversion Ratio - the number of passing yards per air yards thrown per game
dakotadoubleAdjusted EPA + CPOE composite based on coefficients which best predict adjusted EPA/play in the following year.
carriesintegerThe number of official rush attempts (incl. scrambles and kneel downs). Rushes after a lateral reception don't count as carry.
rushing_yardsdoubleNumeric yards by the rusher_player_name, excluding yards gained in rush plays with laterals. This should equal official rushing statistics but could miss yards gained in rush plays with laterals. Please see the description of lateral_rusher_player_name for further information.
rushing_tdsintegerThe number of rushing touchdowns (incl. scrambles). Also includes touchdowns after obtaining a lateral on a play that started with a rushing attempt.
rushing_fumblesdoubleThe number of rushes with a fumble.
rushing_fumbles_lostdoubleThe number of rushes with a lost fumble.
rushing_first_downsdoubleFirst downs on rush attempts (incl. scrambles).
rushing_epadoubleExpected points added on rush attempts (incl. scrambles and kneel downs).
rushing_2pt_conversionsintegerTwo-point conversion rushes
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
targetsintegerThe number of pass plays where the player was the targeted receiver.
receiving_yardsdoubleNumeric yards by the receiver_player_name, excluding yards gained in pass plays with laterals. This should equal official receiving statistics but could miss yards gained in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
receiving_tdsintegerThe number of touchdowns following a pass reception. Also includes touchdowns after receiving a lateral on a play that started as a pass play.
receiving_fumblesdoubleThe number of fumbles after a pass reception.
receiving_fumbles_lostdoubleThe number of fumbles lost after a pass reception.
receiving_air_yardsdoubleReceiving air yards (incl. incomplete passes).
receiving_yards_after_catchdoubleYards after the catch gained on plays in which player was receiver (this is an unofficial stat and may differ slightly between different sources).
receiving_first_downsdoubleTotal number of first downs gained on receptions
receiving_epadoubleTotal EPA on plays where this receiver was targeted
receiving_2pt_conversionsintegerTwo-point conversion receptions
racrdoubleReceiving (yards) Air (yards) Conversion Ratio - the number of receiving yards per air yards targeted per game
target_sharedouble"Player's share of team receiving targets in this game"
air_yards_sharedoublePlayer's share of the team's air yards in this game
woprdoubleWeighted OPportunity Rating - 1.5 x target_share + 0.7 x air_yards_share - a weighted average that contextualizes total fantasy usage.
special_teams_tdsdoubleTotal number of kick/punt return touchdowns
fantasy_pointsdoubleStandard fantasy points.
fantasy_points_pprdoublePPR fantasy points.

Example

from sportsdataverse.nfl import load_nfl_player_stats
stats = load_nfl_player_stats()
stats.shape

# Kicking-only stats

kicking = load_nfl_player_stats(kicking=True)

# Filter to a single season after load

import polars as pl
stats_2024 = load_nfl_player_stats().filter(pl.col("season") == 2024)

load_players(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL Player ID information

Parameters

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

Returns

Polars dataframe containing players available.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
game_keycharacter
official_namecharacterOfficial name.
positioncharacterPrimary position as reported by NFL.com
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
official_idcharacterUnique official / referee identifier.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
weekintegerSeason week.

Example

from sportsdataverse.nfl import load_nfl_players
players = load_nfl_players()
players.shape

# Pandas round-trip

players_pd = load_nfl_players(return_as_pandas=True)
players_pd.head()

load_rosters(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL roster data for all seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1920 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing rosters available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
positioncharacterPrimary position as reported by NFL.com
depth_chart_positioncharacterPosition assigned on depth chart. Not always accurate!
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
statuscharacterStatus label.
full_namecharacterFull name as per NFL.com
first_namecharacterFirst name of player
last_namecharacterLast name of player
birth_datecharacterPlayer birth date (sourced from NFL. Other sources may differ)
heightdoubleOfficial height, in inches
weightintegerOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
espn_idcharacterESPN ID - usual format is an integer with ~5 digits
sportradar_idcharacterSportRadar ID - often also called sportsdata_id by other services. A UUID.
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
rotowire_idcharacterRotowire ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
pff_idcharacterPro Football Focus ID - usually an integer with between 3 and 6 digits.
pfr_idcharacterPro-Football-Reference ID for player
fantasy_data_idcharacterFantasyData ID - usual format five digit integer
sleeper_idcharacterSleeper ID - usually an integer with ~4 digits.
years_expintegerYears played in league
headshot_urlcharacterA URL string that points to player photos used by NFL.com (or sometimes ESPN)
ngs_positioncharacterPrimary position as reported by the NextGen stats API.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
status_description_abbrcharacterA code corresponding to a particular NFL status.
football_namecharacterCommon player name (i.e. in most cases common_first_name last_name)
esb_idcharacterPlayer ID for Elias Sports Bureau
gsis_it_idcharacterPlayer ID for the GSIS IT API
smart_idcharacterSMART ID for player (that's in raw pbp. It includes a hashed ESB_ID)
entry_yearintegerThe year a player first became eligible to play in the NFL.
rookie_yearintegerThe year a player lost their rookie eligibility.
draft_clubcharacterThe team that originally drafted a player. NA if a player went undrafted in their draft-eligible year.
draft_numberintegerThe number pick that was used to select a given player.

Example

from sportsdataverse.nfl import load_nfl_rosters
rosters = load_nfl_rosters(seasons=[2024])

# Multi-season range

rosters = load_nfl_rosters(seasons=range(2020, 2025))

# Filter to a single team

import polars as pl
kc = load_nfl_rosters(seasons=[2024]).filter(pl.col("team") == "KC")

load_rosters_weekly(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL weekly roster data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2002 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing weekly rosters available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
positioncharacterPrimary position as reported by NFL.com
depth_chart_positioncharacterPosition assigned on depth chart. Not always accurate!
jersey_numberintegerJersey number. Often useful for joins by name/team/jersey.
statuscharacterStatus label.
full_namecharacterFull name as per NFL.com
first_namecharacterFirst name of player
last_namecharacterLast name of player
birth_datecharacterPlayer birth date (sourced from NFL. Other sources may differ)
heightdoubleOfficial height, in inches
weightintegerOfficial weight, in pounds
collegecharacterOfficial college (usually the last one attended)
gsis_idcharacterGame Stats and Info Service ID: the primary ID for play-by-play data.
espn_idcharacterESPN ID - usual format is an integer with ~5 digits
sportradar_idcharacterSportRadar ID - often also called sportsdata_id by other services. A UUID.
yahoo_idcharacterYahoo ID - usual format is an integer with ~5 digits
rotowire_idcharacterRotowire ID - usual format is an integer with ~four digits. Not to be confused with rotowire_id.
pff_idcharacterPro Football Focus ID - usually an integer with between 3 and 6 digits.
pfr_idcharacterPro-Football-Reference ID for player
fantasy_data_idcharacterFantasyData ID - usual format five digit integer
sleeper_idcharacterSleeper ID - usually an integer with ~4 digits.
years_expintegerYears played in league
headshot_urlcharacterA URL string that points to player photos used by NFL.com (or sometimes ESPN)
ngs_positioncharacterPrimary position as reported by the NextGen stats API.
weekintegerSeason week.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
status_description_abbrcharacterA code corresponding to a particular NFL status.
football_namecharacterCommon player name (i.e. in most cases common_first_name last_name)
esb_idcharacterPlayer ID for Elias Sports Bureau
gsis_it_idcharacterPlayer ID for the GSIS IT API
smart_idcharacterSMART ID for player (that's in raw pbp. It includes a hashed ESB_ID)
entry_yearintegerThe year a player first became eligible to play in the NFL.
rookie_yearintegerThe year a player lost their rookie eligibility.
draft_clubcharacterThe team that originally drafted a player. NA if a player went undrafted in their draft-eligible year.
draft_numberintegerThe number pick that was used to select a given player.

Example

from sportsdataverse.nfl import load_nfl_weekly_rosters
weekly = load_nfl_weekly_rosters(seasons=[2024])

# Multi-season range with a follow-up week filter

import polars as pl
wk1 = (
load_nfl_weekly_rosters(seasons=range(2022, 2025))
.filter(pl.col("week") == 1)
)

load_schedules(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL schedule data

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing the schedule for the requested seasons.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
weekintegerSeason week.
gamedaycharacterThe date on which the game occurred.
weekdaycharacterThe day of the week on which the game occcured.
gametimecharacterThe kickoff time of the game. This is represented in 24-hour time and the Eastern time zone, regardless of what time zone the game was being played in.
away_teamcharacterString abbreviation for the away team.
away_scoreintegerThe number of points the away team scored. Is NA for games which haven't yet been played.
home_teamcharacterThe home team. Note that this contains the designated home team for games which no team is playing at home such as Super Bowls or NFL International games.
home_scoreintegerThe number of points the home team scored. Is NA for games which haven't yet been played.
locationcharacterEither Home if the home team is playing in their home stadium, or Neutral if the game is being played at a neutral location. This still shows as Home for games between the Giants and Jets even though they share the same home stadium.
resultintegerThe number of points the home team scored minus the number of points the visiting team scored. Equals h_score - v_score. Is NA for games which haven't yet been played. Convenient for evaluating against the spread bets.
totalintegerThe 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.
overtimeintegerBinary indicator of whether or not game went to overtime.
old_game_idcharacterLegacy NFL game ID.
gsisintegerThe id of the game issued by the NFL Game Statistics & Information System.
nfl_detail_idcharacterThe id of the game issued by NFL Detail.
pfrcharacterThe id of the game issued by Pro-Football-Reference
pffintegerThe id of the game issued by Pro Football Focus
espncharacterThe id of the game issued by ESPN
ftninteger
away_restintegerDays of rest that the away team is coming off of.
home_restintegerDays of rest that the home team is coming off of.
away_moneylineintegerOdds for away team to win the game.
home_moneylineintegerOdds for home team to win the game.
spread_linedoubleThe closing spread line for the game. A positive number means the home team was favored by that many points, a negative number means the away team was favored by that many points. (Source: Pro-Football-Reference)
away_spread_oddsintegerOdds for away team to cover the spread.
home_spread_oddsintegerOdds for home team to cover the spread.
total_linedoubleThe closing total line for the game. (Source: Pro-Football-Reference)
under_oddsintegerOdds that total score of game would be under the total_line.
over_oddsintegerOdds that total score of game would be over the total_ine.
div_gameintegerBinary indicator of whether or not game was played by 2 teams in the same division.
roofcharacterOne of 'dome', 'outdoors', 'closed', 'open' indicating indicating the roof status of the stadium the game was played in. (Source: Pro-Football-Reference)
surfacecharacterWhat type of ground the game was played on. (Source: Pro-Football-Reference)
tempintegerThe temperature at the stadium only for 'roof' = 'outdoors' or 'open'.(Source: Pro-Football-Reference)
windintegerThe speed of the wind in miles/hour only for 'roof' = 'outdoors' or 'open'. (Source: Pro-Football-Reference)
away_qb_idcharacterGSIS Player ID for away team starting quarterback.
home_qb_idcharacterGSIS Player ID for home team starting quarterback.
away_qb_namecharacterName of away team starting QB.
home_qb_namecharacterName of home team starting QB.
away_coachcharacterFirst and last name of the away team coach. (Source: Pro-Football-Reference)
home_coachcharacterFirst and last name of the home team coach. (Source: Pro-Football-Reference)
refereecharacterName of the game's referee (head official)
stadium_idcharacterID of the stadium the game was played in. (Source: Pro-Football-Reference)
stadiumcharacterName of the stadium

Example

from sportsdataverse.nfl import load_nfl_schedule
schedule = load_nfl_schedule(seasons=[2024])
schedule.shape

# Multi-season range

schedule = load_nfl_schedule(seasons=range(2020, 2025))

# Filter to a single week

import polars as pl
week_one = load_nfl_schedule(seasons=[2024]).filter(pl.col("week") == 1)

# Pandas round-trip

schedule_pd = load_nfl_schedule(seasons=[2024], return_as_pandas=True)
schedule_pd[["game_id", "home_team", "away_team", "week"]].head()

load_snap_counts(seasons: 'List[int]', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL snap counts data for selected seasons

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 2012 is the earliest available season.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing snap counts available for the requested seasons.

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
pfr_game_idcharacterPFR game ID
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
game_typecharacterThe most recent game type of that season that a player appeared on the roster.
weekintegerSeason week.
playercharacterPlayer name
pfr_player_idcharacterID from Pro Football Reference
positioncharacterPrimary position as reported by NFL.com
teamcharacterNFL team. Uses official abbreviations as per NFL.com
opponentcharacterOpposing team of player
offense_snapsdoubleNumber of snaps on offense
offense_pctdoublePercent of offensive snaps taken
defense_snapsdoubleNumber of snaps on defense
defense_pctdoublePercent of defensive snaps taken
st_snapsdoubleNumber of snaps on special teams
st_pctdoublePercent of special teams snaps taken

Example

from sportsdataverse.nfl import load_nfl_snap_counts
snaps = load_nfl_snap_counts(seasons=[2024])

# Multi-season range with offense-only filter

import polars as pl
offense = (
load_nfl_snap_counts(seasons=range(2022, 2025))
.filter(pl.col("offense_snaps") > 0)
)

load_team_stats(seasons: 'List[int]', summary_level: 'str' = 'week', return_as_pandas=False) -> 'pl.DataFrame'

Load NFL team stats data going back to 1999

Parameters

ParameterTypeDefaultDescription
seasonslistUsed to define different seasons. 1999 is the earliest available season.
summary_levelstr'week'Aggregation level. One of "week", "reg", "post", "reg+post". Defaults to "week".
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing team stats available for the requested seasons.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
weekintegerSeason week.
teamcharacterNFL team. Uses official abbreviations as per NFL.com
season_typecharacterREG or POST indicating if the timeframe belongs to regular or post season.
opponent_teamcharacter
completionsintegerThe number of completed passes.
attemptsintegerThe number of pass attempts as defined by the NFL.
passing_yardsintegerNumeric yards by the passer_player_name, including yards gained in pass plays with laterals. This should equal official passing statistics.
passing_tdsintegerThe number of passing touchdowns.
passing_interceptionsinteger
sacks_sufferedinteger
sack_yards_lostinteger
sack_fumblesintegerThe number of sacks with a fumble.
sack_fumbles_lostintegerThe number of sacks with a lost fumble.
passing_air_yardsintegerPassing air yards (includes incomplete passes).
passing_yards_after_catchintegerYards after the catch gained on plays in which player was the passer (this is an unofficial stat and may differ slightly between different sources).
passing_first_downsintegerFirst downs on pass attempts.
passing_epadoubleTotal expected points added on pass attempts and sacks. NOTE: this uses the variable qb_epa, which gives QB credit for EPA for up to the point where a receiver lost a fumble after a completed catch and makes EPA work more like passing yards on plays with fumbles.
passing_cpoedouble
passing_2pt_conversionsintegerTwo-point conversion passes.
carriesintegerThe number of official rush attempts (incl. scrambles and kneel downs). Rushes after a lateral reception don't count as carry.
rushing_yardsintegerNumeric yards by the rusher_player_name, excluding yards gained in rush plays with laterals. This should equal official rushing statistics but could miss yards gained in rush plays with laterals. Please see the description of lateral_rusher_player_name for further information.
rushing_tdsintegerThe number of rushing touchdowns (incl. scrambles). Also includes touchdowns after obtaining a lateral on a play that started with a rushing attempt.
rushing_fumblesintegerThe number of rushes with a fumble.
rushing_fumbles_lostintegerThe number of rushes with a lost fumble.
rushing_first_downsintegerFirst downs on rush attempts (incl. scrambles).
rushing_epadoubleExpected points added on rush attempts (incl. scrambles and kneel downs).
rushing_2pt_conversionsintegerTwo-point conversion rushes
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
targetsintegerThe number of pass plays where the player was the targeted receiver.
receiving_yardsintegerNumeric yards by the receiver_player_name, excluding yards gained in pass plays with laterals. This should equal official receiving statistics but could miss yards gained in pass plays with laterals. Please see the description of lateral_receiver_player_name for further information.
receiving_tdsintegerThe number of touchdowns following a pass reception. Also includes touchdowns after receiving a lateral on a play that started as a pass play.
receiving_fumblesintegerThe number of fumbles after a pass reception.
receiving_fumbles_lostintegerThe number of fumbles lost after a pass reception.
receiving_air_yardsintegerReceiving air yards (incl. incomplete passes).
receiving_yards_after_catchintegerYards after the catch gained on plays in which player was receiver (this is an unofficial stat and may differ slightly between different sources).
receiving_first_downsintegerTotal number of first downs gained on receptions
receiving_epadoubleTotal EPA on plays where this receiver was targeted
receiving_2pt_conversionsintegerTwo-point conversion receptions
special_teams_tdsintegerTotal number of kick/punt return touchdowns
def_tackles_solointegerTotal number of solo tackles for this player
def_tackles_with_assistintegerNumber of tackles this player had with an assisted tackle
def_tackle_assistsintegerNumber of assisted tackles for this player
def_tackles_for_lossintegerNumber of tackles for loss (TFL) for this player
def_tackles_for_loss_yardsintegerYards lost from TFLs involving this player
def_fumbles_forcedintegerNumber of times a fumble was forced from this player
def_sacksdoubleNumber of sacks form this player
def_sack_yardsdoubleYards lost from sacks forced by this player
def_qb_hitsintegerNumber of QB hits from this player (should not include plays where the QB was sacked)
def_interceptionsintegerNumber of interceptions forced by this player
def_interception_yardsintegeryards gained/lost by interception returns from this player
def_pass_defendedintegerNumber of passes defended/broken up by this player
def_tdsintegerNumber of defensive touchdowns scored by this player
def_fumblesintegerNumber of fumbles by this player
def_safetiesinteger
misc_yardsinteger
fumble_recovery_owninteger
fumble_recovery_yards_owninteger
fumble_recovery_oppinteger
fumble_recovery_yards_oppinteger
fumble_recovery_tdsinteger
penaltiesintegerTotal number of penalties.
penalty_yardsintegerYards gained (or lost) by the posteam from the penalty.
timeoutsinteger
punt_returnsintegerNumber of punt returns.
punt_return_yardsintegerTeam punt return yards.
kickoff_returnsinteger
kickoff_return_yardsinteger
fg_madeintegerTRUE when the field goal attempt was successful.
fg_attinteger
fg_missedinteger
fg_blockedinteger
fg_longinteger
fg_pctdoubleField goal percentage (0-1).
fg_made_0_19integer
fg_made_20_29integer
fg_made_30_39integer
fg_made_40_49integer
fg_made_50_59integer
fg_made_60_integer
fg_missed_0_19integer
fg_missed_20_29integer
fg_missed_30_39integer
fg_missed_40_49integer
fg_missed_50_59integer
fg_missed_60_integer
fg_made_listcharacter
fg_missed_listcharacter
fg_blocked_listcharacter
fg_made_distanceinteger
fg_missed_distanceinteger
fg_blocked_distanceinteger
pat_madeinteger
pat_attinteger
pat_missedinteger
pat_blockedinteger
pat_pctdouble
gwfg_madeinteger
gwfg_attinteger
gwfg_missedinteger
gwfg_blockedinteger
gwfg_distanceinteger

Example

from sportsdataverse.nfl import load_nfl_team_stats
weekly = load_nfl_team_stats(seasons=[2024])

# Regular-season-only team stats

reg = load_nfl_team_stats(seasons=[2024], summary_level="reg")

# Combined regular + post-season at season grain

combined = load_nfl_team_stats(seasons=[2023, 2024], summary_level="reg+post")

load_teams(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL team ID information and logos

Parameters

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

Returns

Polars dataframe containing teams available.

col_nametypedescription
team_abbrcharacterOfficial team abbreveation
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_idintegerUnique team identifier.
team_nickcharacter
team_confcharacter
team_divisioncharacter
team_colorcharacterTeam primary color (hex without leading '#').
team_color2character
team_color3character
team_color4character
team_logo_wikipediacharacter
team_logo_espncharacter
team_wordmarkcharacter
team_conference_logocharacter
team_league_logocharacter
team_logo_squaredcharacter

Example

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

# Pandas round-trip

teams_pd = load_nfl_teams(return_as_pandas=True)
teams_pd[["team_abbr", "team_name", "team_conf", "team_division"]].head()

load_trades(return_as_pandas=False) -> 'pl.DataFrame'

Load NFL trades data

Parameters

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

Returns

Polars dataframe containing NFL trade information.

col_nametypedescription
trade_idintegerID of Trade
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
trade_datecharacterExact date that trade occurred
gavecharacterTeam that gave pick/player in row
receivedcharacterTeam that received pick/player in row
pick_seasonintegerDraft in which traded pick was in
pick_roundintegerRound in which traded pick was in
pick_numberintegerPick number of traded pick
conditionalintegerBinary indicator of whether or not traded pick was conditional
pfr_idcharacterPro-Football-Reference ID for player
pfr_namecharacterFull name of traded player

Example

from sportsdataverse.nfl import load_nfl_trades
trades = load_nfl_trades()
trades.shape

# Filter to a single season

import polars as pl
trades_2024 = load_nfl_trades().filter(pl.col("season") == 2024)

Utilities & helpers

NFLPlayProcess(gameId=0, raw=False, path_to_json='/', return_keys=None, **kwargs)

Process ESPN NFL play-by-play feeds into a tidy game-level dictionary.

Wraps the ESPN summary endpoint (or a local JSON dump) and pipes the result through a chain of feature-engineering steps -- down/distance, play-type flags, EPA, WPA, QBR, drive aggregation, and an advanced box score. Use run_processing_pipeline() for the full feature set or run_cleaning_pipeline() for a lighter clean.

Parameters

ParameterTypeDefaultDescription
gameIdint0ESPN event id (e.g. 401671801).
rawboolFalseIf True, espn_nfl_pbp() returns the ESPN payload untouched. If False (default), it normalizes keys.
path_to_jsonstr'/'Directory containing {gameId}.json for the nfl_pbp_disk() flow (offline replay).
return_keyslist[str] | NoneNoneIf supplied, run_processing_pipeline returns only the listed keys from the result dict.

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401671801)
proc.espn_nfl_pbp()
result = proc.run_processing_pipeline()
len(result["plays"])

# Offline replay from a JSON dump

proc = NFLPlayProcess(gameId=401671801, path_to_json="./pbp_dump")
proc.nfl_pbp_disk()
cleaned = proc.run_cleaning_pipeline()

# Subset the return payload

proc = NFLPlayProcess(gameId=401671801, return_keys=["plays", "boxscore"])
proc.espn_nfl_pbp()
slim = proc.run_processing_pipeline()
sorted(slim.keys()) # ['boxscore', 'plays']

Methods

NFLPlayProcess.corrupt_pbp_check()

Detect ESPN payloads that look corrupt or partial.

Returns True when one of three guard conditions trips:

  • No plays at all.
  • Fewer than 50 plays for a game ESPN reports as completed.
  • More than 500 plays for a game ESPN reports as completed.

run_processing_pipeline() and run_cleaning_pipeline() use this to skip feature engineering on obviously broken payloads.

Returns

True if the payload looks corrupt; False otherwise.

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401671801)
proc.espn_nfl_pbp()
if not proc.corrupt_pbp_check():
result = proc.run_processing_pipeline()

NFLPlayProcess.create_box_score(play_df)

Build the advanced box score (passer / rusher / receiver / team / situational / defensive / turnover / drives)

from a feature-engineered plays DataFrame.

This is normally called by run_processing_pipeline() -- it auto-runs the pipeline first if it hasn't been triggered yet, so callers can also invoke it directly on a freshly-instantiated processor.

Parameters

ParameterTypeDefaultDescription
play_dfpl.DataFrameThe plays frame produced after the full feature-engineering chain (downs, play-type flags, EPA, WPA, drive aggregation).

Returns

Box score keyed by "pass", "rush", "receiver", "team", "situational", "defensive", "turnover", "drives" -- each value a list of dicts ready to be serialized.

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401671801)
proc.espn_nfl_pbp()
result = proc.run_processing_pipeline()
box = result["advBoxScore"]
sorted(box.keys())

NFLPlayProcess.espn_nfl_pbp(**kwargs)

espn_nfl_pbp() - Pull the game by id. Data from API endpoints: nfl/playbyplay, nfl/summary

Returns

Dictionary of game data with keys - "gameId", "plays", "boxscore", "header", "broadcasts", "videos", "playByPlaySource", "standings", "leaders", "timeouts", "homeTeamSpread", "overUnder", "pickcenter", "againstTheSpread", "odds", "predictor", "winprobability", "espnWP", "gameInfo", "season"

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401220403)
payload = proc.espn_nfl_pbp()
sorted(payload.keys())[:5]

# Raw ESPN passthrough (no key normalization)

proc_raw = NFLPlayProcess(gameId=401220403, raw=True)
espn_dump = proc_raw.espn_nfl_pbp()

# Chain into the full processing pipeline

proc = NFLPlayProcess(gameId=401220403)
proc.espn_nfl_pbp()
result = proc.run_processing_pipeline()

NFLPlayProcess.nfl_pbp_disk()

Load a previously-saved ESPN payload from {path_to_json}/{gameId}.json.

Use this to replay an old game offline without hitting the ESPN endpoint -- handy for snapshot-driven tests and reproducible feature engineering.

Returns

The parsed JSON content; also stored on self.json.

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401220403, path_to_json="./pbp_dump")
proc.nfl_pbp_disk()
result = proc.run_processing_pipeline()

NFLPlayProcess.nfl_pbp_json(**kwargs)

Set self.json to the imported json module reference (legacy stub).

Retained for API compatibility. Prefer espn_nfl_pbp() (live) or nfl_pbp_disk() (offline) to populate self.json with an actual ESPN payload.

Returns

The Python json module reference (mirrors legacy behavior).

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401220403)
proc.nfl_pbp_json() # populates `self.json` with the json module

NFLPlayProcess.run_cleaning_pipeline()

Run the lighter cleaning pipeline against self.json.

Identical to run_processing_pipeline() up through the add_spread_time` step but stops short of EPA / WPA / QBR / drive aggregation and the advanced box score. Use this when you want clean play structure without the modeled features.

Returns

The cleaned game dict (or the subset specified by return_keys at construction).

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401671801)
proc.espn_nfl_pbp()
cleaned = proc.run_cleaning_pipeline()
"plays" in cleaned and "advBoxScore" not in cleaned

NFLPlayProcess.run_processing_pipeline()

Run the full feature-engineering pipeline against self.json.

Pipes the plays frame through the chain of helpers: downs, play-type flags, rush/pass flags, team-score variables, new play types, penalties, play-category flags, yardage cols, player cols, post-play cols, spread time, EPA, WPA, drive data, and QBR -- followed by the advanced box score build.

Returns

Dict | None: The full processed game dict (or the subset specified by return_keys at construction). Returns the partial result when corrupt_pbp_check() short-circuits.

Example

from sportsdataverse.nfl import NFLPlayProcess
proc = NFLPlayProcess(gameId=401671801)
proc.espn_nfl_pbp()
result = proc.run_processing_pipeline()
len(result["plays"]), len(result["drives"])

# Subset returned keys for downstream serialization

proc = NFLPlayProcess(
gameId=401671801,
return_keys=["plays", "advBoxScore", "winprobability"],
)
proc.espn_nfl_pbp()
slim = proc.run_processing_pipeline()
sorted(slim.keys())

get_current_nfl_season(roster: 'bool' = False) -> 'int'

Return the current NFL season year.

Parameters

ParameterTypeDefaultDescription
rosterboolFalseIf True, use roster-year logic (current calendar year on/after March 15, otherwise previous year). If False, use season logic (current calendar year on/after the Thursday following Labor Day, otherwise previous year).

Returns

The current season (or roster) year.

Example

from sportsdataverse.nfl import get_current_nfl_season
season = get_current_nfl_season()
print(season)

# Roster-year semantics (March 15 cutover)

roster_year = get_current_nfl_season(roster=True)

# Pair with a loader to fetch only the active season

from sportsdataverse.nfl import load_nfl_schedule
schedule = load_nfl_schedule(seasons=[get_current_nfl_season()])

get_current_nfl_week(use_date: 'bool' = True, roster: 'bool' = False) -> 'int'

Return the current NFL week (1-22).

Parameters

ParameterTypeDefaultDescription
use_dateboolTrueIf True (default), compute the week purely from the calendar (number of weeks since the first Thursday of September of the current season). If False, hit the live schedule via load_nfl_schedule() and return the week of the next unplayed game (matches nflreadpy's use_date=False path).
rosterboolFalseForwarded to get_current_nfl_season() for season inference.

Returns

The current week, capped at 22.

Example

from sportsdataverse.nfl import get_current_nfl_week
week = get_current_nfl_week()

# Schedule-driven week (hits the live schedule parquet)

week_live = get_current_nfl_week(use_date=False)

# Roster-year season inference

week_roster = get_current_nfl_week(roster=True)

# Pair with a PBP fetch to grab only the most recent season+week

import polars as pl
from sportsdataverse.nfl import (
get_current_nfl_season, get_current_nfl_week, load_nfl_pbp,
)
current_pbp = (
load_nfl_pbp(seasons=[get_current_nfl_season()])
.filter(pl.col("week") == get_current_nfl_week())
)

get_current_season(roster: 'bool' = False) -> 'int'

Return the current NFL season year.

Parameters

ParameterTypeDefaultDescription
rosterboolFalseIf True, use roster-year logic (current calendar year on/after March 15, otherwise previous year). If False, use season logic (current calendar year on/after the Thursday following Labor Day, otherwise previous year).

Returns

The current season (or roster) year.

Example

from sportsdataverse.nfl import get_current_nfl_season
season = get_current_nfl_season()
print(season)

# Roster-year semantics (March 15 cutover)

roster_year = get_current_nfl_season(roster=True)

# Pair with a loader to fetch only the active season

from sportsdataverse.nfl import load_nfl_schedule
schedule = load_nfl_schedule(seasons=[get_current_nfl_season()])

get_current_week(use_date: 'bool' = True, roster: 'bool' = False) -> 'int'

Return the current NFL week (1-22).

Parameters

ParameterTypeDefaultDescription
use_dateboolTrueIf True (default), compute the week purely from the calendar (number of weeks since the first Thursday of September of the current season). If False, hit the live schedule via load_nfl_schedule() and return the week of the next unplayed game (matches nflreadpy's use_date=False path).
rosterboolFalseForwarded to get_current_nfl_season() for season inference.

Returns

The current week, capped at 22.

Example

from sportsdataverse.nfl import get_current_nfl_week
week = get_current_nfl_week()

# Schedule-driven week (hits the live schedule parquet)

week_live = get_current_nfl_week(use_date=False)

# Roster-year season inference

week_roster = get_current_nfl_week(roster=True)

# Pair with a PBP fetch to grab only the most recent season+week

import polars as pl
from sportsdataverse.nfl import (
get_current_nfl_season, get_current_nfl_week, load_nfl_pbp,
)
current_pbp = (
load_nfl_pbp(seasons=[get_current_nfl_season()])
.filter(pl.col("week") == get_current_nfl_week())
)

most_recent_nfl_season(roster: 'bool' = False) -> 'int'

Alias for get_current_nfl_season() mirroring nflreadr's

most_recent_season().

Parameters

ParameterTypeDefaultDescription
rosterboolFalse

Example

from sportsdataverse.nfl.utils_date import most_recent_nfl_season
season = most_recent_nfl_season()

# Roster-year flavor

roster_year = most_recent_nfl_season(roster=True)

Other

NflConfig(cache_mode: 'CacheMode' = 'memory', cache_dir: 'Optional[Path]' = None, cache_duration: 'int' = 86400, verbose: 'bool' = True, timeout: 'int' = 30, user_agent: 'str' = 'sportsdataverse-py-nfl') -> None

Runtime configuration for sdv-py NFL loaders.

Fields mirror nflreadpy's NflreadpyConfig so users can swap engines without changing call sites. The defaults are conservative: in-memory caching with a 24-hour TTL, verbose progress bars on, 30-second HTTP timeout.

Parameters

ParameterTypeDefaultDescription
cache_modeCacheMode'memory'
cache_dirOptional[Path]None
cache_durationint86400
verboseboolTrue
timeoutint30
user_agentstr'sportsdataverse-py-nfl'

Example

from sportsdataverse.nfl import get_config
cfg = get_config() # NflConfig instance
cfg.cache_mode # "memory"
cfg.cache_duration # 86400 (24h)
cfg.timeout # 30 (seconds)

# Construct a fresh instance directly (rarely needed -- prefer ``update_config``)

from sportsdataverse.nfl import NflConfig
cfg = NflConfig(cache_mode="off", timeout=10)

cached_loader(func: 'F') -> 'F'

Decorator that adds caching to a load_nfl_* function.

Honors the active NflConfig.cache_mode:

  • memory: dict-based per-process cache.
  • filesystem: parquet-based cross-process cache under cache_dir.
  • off: no caching, function runs every time.

The cache key is the hash of (qualified_name, args, kwargs) with return_as_pandas excluded so memory / disk hits work regardless of which return shape the caller asked for. The cache always stores the polars frame internally and converts to pandas on read when requested.

Parameters

ParameterTypeDefaultDescription
funcF

Example

import polars as pl
from sportsdataverse.nfl.cache import cached_loader

@cached_loader
def load_my_thing(season: int, return_as_pandas: bool = False):
# ... fetch parquet, build a polars frame ...
return pl.DataFrame({"season": [season]})

df1 = load_my_thing(2024) # network hit, populates cache
df2 = load_my_thing(2024) # served from cache
df_pd = load_my_thing(2024, return_as_pandas=True)
# `return_as_pandas` is excluded from the cache key, so the
# polars hit is reused and converted to pandas on the way out.

# Switch caching modes at runtime

from sportsdataverse.nfl import clear_cache, update_config

update_config(cache_mode="filesystem") # parquet-on-disk reuse
df3 = load_my_thing(2024) # writes parquet under cache_dir
clear_cache() # wipe both memory + filesystem
update_config(cache_mode="off") # bypass cache entirely

clear_cache() -> 'None'

Clear both memory and filesystem caches.

Memory: empties the in-process dict. Filesystem: removes all entries under config.cache_dir. The directory itself is preserved so subsequent writes succeed without needing mkdir.

Example

from sportsdataverse.nfl import clear_cache, load_nfl_pbp
clear_cache()
pbp = load_nfl_pbp(seasons=[2024])

# Pair with a cache-mode switch

from sportsdataverse.nfl import clear_cache, update_config
update_config(cache_mode="filesystem")
# ... lots of cached calls accumulate parquet files on disk ...
clear_cache() # wipe disk + memory together

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 containing teams for the requested league. This function caches by default, so if you want to refresh the data, use the command sportsdataverse.nfl.espn_nfl_teams.clear_cache().

col_nametypedescription
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
team_alternate_colorcharacterTeam alternate color (hex without leading '#').
team_colorcharacterTeam primary color (hex without leading '#').
team_display_namecharacterFull team display name.
team_idcharacterUnique team identifier.
team_is_activelogicalTRUE if the team is currently active.
team_is_all_starlogicalTRUE if the row represents an All-Star team.
team_locationcharacterTeam city or location string.
team_logosintegerTeam logo metadata.
team_namecharacterFull team display name (e.g. 'Las Vegas Aces').
team_nicknamecharacterTeam nickname.
team_short_display_namecharacterShort team display name (e.g. 'Aces').
team_slugcharacterURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_uidcharacterESPN universal team identifier (UID format 's:40~l:...~t:...').

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()

# Force a refresh after upstream ESPN updates

espn_nfl_teams.cache_clear() # underlying lru_cache
teams = espn_nfl_teams()

get_config() -> 'NflConfig'

Return the live NflConfig singleton.

The same object is returned on every call; mutate via update_config rather than reassigning fields directly so future hooks (e.g. logging on config change) have a single choke point.

Example

from sportsdataverse.nfl import get_config
cfg = get_config()
print(cfg.cache_mode, cfg.cache_duration, cfg.cache_dir)

# Pair with ``update_config`` to verify a change took effect

from sportsdataverse.nfl import update_config, get_config
update_config(cache_mode="off")
assert get_config().cache_mode == "off"

nfl_combine_profiles(year: 'int' = 2024, limit: 'int' = 40, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com combine profiles -- one row per prospect (/football/v2/combine/profiles).

Records live under the combineProfiles key. Each row carries id, year, the nested person object, measurables (armLength, benchPress, broadJump, fortyYardDash, handSize, height, proFortyYardDash, sixtyYardShuttle), scout scores and grades.

Parameters

ParameterTypeDefaultDescription
yearint2024combine/draft year (e.g. 2024).
limitint40page size -- max profiles to return (paginated endpoint).
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per combine profile.

col_nametypedescription
idcharacterID of the player in the 'name' column.
yearinteger4-digit year.
armLengthdouble
athleticismScoredouble
benchPresscharacter
broadJumpcharacter
biocharacter
collegeClasscharacter
draftGradedouble
draftProjectioncharacter
fortyYardDashcharacter
gradedoubleESPN recruit grade (0-100; 0 = not rated).
handSizedouble
headshotcharacterNFL headshot url for player
heightdoubleOfficial height, in inches
nflComparisoncharacter
overviewcharacter
productionScoredouble
profileAuthorcharacter
proFortyYardDashcharacter
sixtyYardShuttlecharacter
sizeScorecharacter
sourcesTellUscharacter
strengthscharacter
tenYardSplitcharacter
threeConeDrillcharacter
twentyYardShuttlecharacter
weaknessescharacter
combineAttendancelogical
positioncharacterPrimary position as reported by NFL.com
positionGroupcharacter
verticalJumpcharacter
weightdoubleOfficial weight, in pounds
person_idcharacterUnique player identifier (V3 endpoints).
person_displayNamecharacter
person_esbIdcharacter
person_firstNamecharacter
person_lastNamecharacter
person_hometowncharacter
person_collegeNamescharacter
proFortyYardDash_designationcharacter
proFortyYardDash_secondsdouble
benchPress_designationcharacter
benchPress_repetitionsinteger
broadJump_designationcharacter
broadJump_inchesinteger
fortyYardDash_designationcharacter
fortyYardDash_secondsdouble
tenYardSplit_designationcharacter
tenYardSplit_secondsdouble
verticalJump_designationcharacter
verticalJump_inchesdouble
threeConeDrill_designationcharacter
threeConeDrill_secondsdouble
twentyYardShuttle_designationcharacter
twentyYardShuttle_secondsdouble

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_combine_profiles
>>> combine = nfl_combine_profiles(year=2024, limit=50)
>>> combine.select(["id", "year", "fortyYardDash", "benchPress"]).head()

nfl_draft_picks(year: 'int' = 2024, limit: 'int' = 40, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com draft pick report -- one row per pick (/football/v2/draft/picks/report).

The payload carries draft-state scalars plus a days list and a picks list; the records of interest are under picks. Each row carries year, draftRound, draftPosition, draftNumberOverall, personId, teamId, pickIsIn and tradeNote.

Parameters

ParameterTypeDefaultDescription
yearint2024draft year (e.g. 2024).
limitint40page size -- max picks to return (paginated endpoint).
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per draft pick.

col_nametypedescription
yearinteger4-digit year.
draftRoundinteger
draftPositioninteger
draftNumberOverallinteger
personIdcharacter
pickIsInlogical
teamIdcharacter
tradeNotecharacter
tweetSentlogical
tweetsSentlogical

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_draft_picks
>>> picks = nfl_draft_picks(year=2024, limit=300)
>>> picks.select(["draftRound", "draftNumberOverall", "teamId", "personId"]).head()

nfl_game_details(game_id: 'Optional[str]' = None, headers: 'Optional[Dict[str, str]]' = None, raw: 'bool' = False) -> 'Dict'

Pull full api.nfl.com game details (drives + plays) by game id.

Hits /experience/v1/gamedetails/{game_id}; the payload is the shield data.viewer.gameDetail object (plays, drives, scoring summaries, line scores, possession, weather, attendance, ...).

Parameters

ParameterTypeDefaultDescription
game_idstrNonethe uuid game id from nfl_game_schedule (e.g. '7d3e8f84-1312-11ef-afd1-646009f18b2e').
headersDict[str, str] | NoneNonePre-built header dict. Defaults to a fresh nfl_headers_gen call.
rawboolFalseIf True, return the full envelope ({"data": {...}}) untouched. If False (default), unwrap to the gameDetail object.

Returns

the gameDetail object (or the raw envelope when raw=True). Empty dict if the game has no detail payload.

Example

from sportsdataverse.nfl.nfl_games import nfl_game_details
detail = nfl_game_details(game_id="7d3e8f84-1312-11ef-afd1-646009f18b2e")
len(detail["plays"]), len(detail["drives"])

# Reuse headers across many calls (avoids re-minting tokens)

from sportsdataverse.nfl.nfl_games import nfl_game_details, nfl_headers_gen
hdrs = nfl_headers_gen()
detail = nfl_game_details(game_id="7d3e8f84-1312-11ef-afd1-646009f18b2e", headers=hdrs)

nfl_game_pbp(game_id: 'Optional[str]' = None, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com play-by-play -- one row per play (polars/pandas frame).

Tidy wrapper over nfl_game_details: flattens gameDetail.plays into a DataFrame (playId, quarter, down, yardsToGo, yardLine, playType, playDescription, possessionTeam_*, ...) and prepends the game context (game_id, home_team, visitor_team).

Parameters

ParameterTypeDefaultDescription
game_idstrNoneuuid game id from nfl_week_games / nfl_game_schedule.
headersOptional[Dict[str, str]]Nonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per play (empty frame if the game has no play-by-play yet).

col_nametypedescription
game_idcharacterTen digit identifier for NFL game.
home_teamcharacterThe home team. Note that this contains the designated home team for games which no team is playing at home such as Super Bowls or NFL International games.
visitor_teamcharacter
clockTimecharacter
downintegerThe down for the given play.
driveNetYardsinteger
drivePlayCountinteger
driveSequenceNumberinteger
driveTimeOfPossessioncharacter
endClockTimecharacter
endYardLinecharacter
firstDownlogical
goalToGological
isBigPlaycharacter
latestPlaycharacter
nextPlayIsGoalToGological
nextPlayTypecharacter
orderSequenceinteger
penaltyOnPlaylogical
playClockinteger
playReviewStatuscharacter
playDeletedlogical
playDescriptioncharacter
playDescriptionWithJerseyNumberscharacter
playIdintegerUnique play event identifier (UUID).
playStatsinteger
playTypecharacter
prePlayByPlaycharacter
quarterinteger
scoringPlaylogical
scoringPlayTypecharacter
scoringTeamcharacter
shortDescriptioncharacter
specialTeamsPlaylogical
stPlayTypecharacter
timeOfDaycharacter
yardLinecharacter
yardsintegerThe number of receiving yards
yardsToGointeger
possessionTeam_idcharacter
possessionTeam_abbreviationcharacter
possessionTeam_nickNamecharacter
possessionTeam_franchise_primaryColorcharacter
possessionTeam_franchise_secondaryColorcharacter
possessionTeam_franchise_tertiaryColorcharacter
possessionTeam_franchise_currentLogocharacter
possessionTeam_franchise_largeTypeColorcharacter
possessionTeam_franchise_decorativeElementsColorcharacter
scoringTeam_idcharacter
scoringTeam_abbreviationcharacter
scoringTeam_nickNamecharacter
scoringTeam_franchise_primaryColorcharacter
scoringTeam_franchise_secondaryColorcharacter
scoringTeam_franchise_tertiaryColorcharacter
scoringTeam_franchise_currentLogocharacter
scoringTeam_franchise_largeTypeColorcharacter
scoringTeam_franchise_decorativeElementsColorcharacter

Example

>>> from sportsdataverse.nfl import nfl_game_pbp
>>> pbp = nfl_game_pbp(game_id="7d3e8f84-1312-11ef-afd1-646009f18b2e")
>>> pbp.select(["quarter", "down", "yardsToGo", "playType", "playDescription"]).head()

nfl_game_schedule(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'int' = 1, headers: 'Optional[Dict[str, str]]' = None, raw: 'bool' = False) -> 'Dict'

List api.nfl.com games for a season/week slice (/football/v2/games).

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
season_typestr'REG'season type. One of "PRE", "REG", "POST".
weekint1week number (1-18 regular season, 1-4 post-season).
headersDict[str, str] | NoneNonePre-built header dict (skip the auth roundtrip). Defaults to a fresh nfl_headers_gen call.
rawboolFalsecurrently ignored; the function returns the parsed JSON payload.

Returns

payload with the games list under "games" plus "pagination". Each game carries id (the uuid game id used by nfl_game_details), homeTeam/awayTeam, date, status, externalIds (gsis etc.).

Example

from sportsdataverse.nfl.nfl_games import nfl_game_schedule
week_one = nfl_game_schedule(season=2024, season_type="REG", week=1)
first_id = week_one["games"][0]["id"]

nfl_game_summaries(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'int' = 1, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com live game summaries -- one row per game (/football/v2/stats/live/game-summaries).

Records live under the data key. Each row carries gameId, the live game-state fields (clock, quarter, phase, down, distance, yardLine, isRedZone, isGoalToGo), attendance, weather and nested homeTeam / awayTeam summary objects.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
season_typestr'REG'season type. One of "PRE", "REG", "POST".
weekint1week number.
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per game.

col_nametypedescription
gameIdcharacter
offsetinteger
attendanceintegerReported attendance.
clockcharacterGame clock value.
distanceintegerDistance value (in feet for shot data; otherwise context-dependent).
downintegerThe down for the given play.
gameBookUrlcharacter
isGoalToGological
isRedZonelogical
phasecharacterLottery phase identifier.
quartercharacter
startTimecharacterEvent start timestamp (ISO 8601).
weathercharacterString describing the weather including temperature, humidity and wind (direction and speed). Doesn't change during the game!
yardLinecharacter
awayTeam_teamIdcharacter
awayTeam_hasPossessionlogical
awayTeam_score_q1integer
awayTeam_score_q2integer
awayTeam_score_q3integer
awayTeam_score_q4integer
awayTeam_score_otinteger
awayTeam_score_totalinteger
awayTeam_timeouts_remaininginteger
awayTeam_timeouts_usedinteger
homeTeam_teamIdcharacter
homeTeam_hasPossessionlogical
homeTeam_score_q1integer
homeTeam_score_q2integer
homeTeam_score_q3integer
homeTeam_score_q4integer
homeTeam_score_otinteger
homeTeam_score_totalinteger
homeTeam_timeouts_remaininginteger
homeTeam_timeouts_usedinteger

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_game_summaries
>>> summaries = nfl_game_summaries(season=2024, season_type="REG", week=1)
>>> summaries.select(["gameId", "quarter", "phase", "homeTeam", "awayTeam"]).head()

nfl_headers_gen(token: 'Optional[str]' = None) -> 'Dict[str, str]'

Build the request-header dict expected by api.nfl.com.

Mints a fresh bearer token via nfl_token_gen (unless token is supplied) and combines it with the browser-style headers the NFL.com web app sends. Reuse the returned dict across calls to avoid re-minting tokens.

Parameters

ParameterTypeDefaultDescription
tokenOptional[str]NoneAn existing access token to reuse; mints a fresh one when None.

Returns

Header dict ready to drop into requests.get.

Example

from sportsdataverse.nfl.nfl_games import nfl_headers_gen, nfl_game_schedule
hdrs = nfl_headers_gen()
week_one = nfl_game_schedule(season=2024, season_type="REG", week=1, headers=hdrs)
week_two = nfl_game_schedule(season=2024, season_type="REG", week=2, headers=hdrs)

nfl_injuries(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'int' = 1, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com injury report -- one row per player (/football/v2/injuries).

Records live under the injuries key. Each row carries season, seasonType, week, team_*, the nested person object, injuryStatus, position, practiceStatus and a nested injuries list of body-part detail.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
season_typestr'REG'season type. One of "PRE", "REG", "POST".
weekint1week number.
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per injured player.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
weekintegerSeason week.
injuriescharacter
injuryStatuscharacter
practicescharacter
practiceDayscharacter
practiceStatuscharacter
positioncharacterPrimary position as reported by NFL.com
team_idcharacterUnique team identifier.
team_currentLogocharacter
team_fullNamecharacter
person_idcharacterUnique player identifier (V3 endpoints).
person_firstNamecharacter
person_commonFirstNamecharacter
person_lastNamecharacter
person_displayNamecharacter
person_gsisIdcharacter
person_headshotcharacter

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_injuries
>>> inj = nfl_injuries(season=2024, season_type="REG", week=1)
>>> inj.select(["team_abbreviation", "injuryStatus", "position"]).head()

nfl_ngs_gamecenter_overview(game_id, group: 'str' = 'passers', return_as_pandas: 'bool' = False)

NGS gamecenter overview for one game -- one row per player on a side.

Wraps /api/gamecenter/overview (keyed by NGS gameId). The payload splits each stat group into home and visitor entries; this function stacks both and tags every row with side ("home"/"visitor") plus the game's gameId. Note passers carries a single primary QB per side (two rows total) while rushers/receivers/passRushers are full lists.

Parameters

ParameterTypeDefaultDescription
game_idNGS gameId (e.g. "2024090500") from nfl_ngs_league_schedule.
groupstr'passers'which player group -- one of "passers", "rushers", "receivers", "passRushers".
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per player (both teams), with side and gameId columns prepended.

col_nametypedescription
sidecharacterO for offense, D for defense, S for special teams
gameIdcharacter
esbIdcharacter
teamIdcharacter
teamAbbrcharacter
shortNamecharacter
positioncharacterPrimary position as reported by NFL.com
jerseyNumberinteger
playerNamecharacter
zonesinteger
passYardsinteger
touchdownsinteger
interceptionsintegerThe number of interceptions thrown.
attemptsintegerThe number of pass attempts as defined by the NFL.
completionsintegerThe number of completed passes.
headshotcharacterNFL headshot url for player

Example

>>> from sportsdataverse.nfl import nfl_ngs_gamecenter_overview
>>> ov = nfl_ngs_gamecenter_overview(game_id="2024090500", group="passers")
>>> ov.select(["side", "playerName", "position"]).head()

nfl_ngs_leaders(category: 'str' = 'speed', season: 'int' = 2024, season_type: 'str' = 'REG', week: 'Optional[int]' = None, return_as_pandas: 'bool' = False)

NGS top-N "leaders" board for a single category (one row per leader play).

One parameterized wrapper over the single-list leader endpoints. Each record nests a leader (player/stat) block and a play (the play that produced the highlight) block, flattened to leader_* / play_* columns.

Categories (category= value -> endpoint):

  • "speed" -> /leaders/speed/ballCarrier (fastest ball-carrier speeds)
  • "distance_ballcarrier" -> /leaders/distance/ballCarrier
  • "distance_tackle" -> /leaders/distance/tackle
  • "time_sack" -> /leaders/time/sack
  • "completion_season" / "completion_week" -> /leaders/expectation/completion/{season,week} (most-improbable completions)
  • "ery_season" / "ery_week" -> /leaders/expectation/ery/{season,week} (expected rush yards over expectation)
  • "yac_season" / "yac_week" -> /leaders/expectation/yac/{season,week} (yards after catch over expectation)

Parameters

ParameterTypeDefaultDescription
categorystr'speed'one of the keys above. Defaults to "speed".
seasonint2024season year.
season_typestr'REG'"REG", "POST", or "PRE".
weekint | NoneNoneweek filter -- required (and only used) by the *_week categories; ignored by season/non-expectation boards.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per leader entry.

col_nametypedescription
leader_esbIdcharacter
leader_firstNamecharacter
leader_gsisIdcharacter
leader_jerseyNumberinteger
leader_lastNamecharacter
leader_playerNamecharacter
leader_positioncharacter
leader_positionGroupcharacter
leader_shortNamecharacter
leader_teamAbbrcharacter
leader_teamIdcharacter
leader_weekinteger
leader_yardsinteger
leader_inPlayDistdouble
leader_maxSpeeddouble
leader_headshotcharacter
play_gameIdinteger
play_playIdinteger
play_sequenceinteger
play_downinteger
play_gameClockcharacter
play_gameKeyinteger
play_health_playerTrackingcharacter
play_health_ballTrackingcharacter
play_homeScoreinteger
play_isBigPlaylogical
play_isEndQuarterlogical
play_isGoalToGological
play_isPenaltylogical
play_isSTPlaylogical
play_isScoringlogical
play_playDescriptioncharacter
play_playStatecharacter
play_playStatsinteger
play_playTypecharacter
play_playTypeCodeinteger
play_possessionTeamIdcharacter
play_preSnapHomeScoreinteger
play_preSnapVisitorScoreinteger
play_quarterinteger
play_timeOfDayUTCcharacter
play_visitorScoreinteger
play_yardlinecharacter
play_yardlineNumberinteger
play_yardlineSidecharacter
play_yardsToGointeger
play_absoluteYardlineNumberinteger
play_actualYardlineForFirstDowndouble
play_actualYardsToGodouble
play_endGameClockcharacter
play_isChangeOfPossessionlogical
play_playDirectioncharacter
play_startGameClockcharacter

Example

>>> from sportsdataverse.nfl import nfl_ngs_leaders
>>> fast = nfl_ngs_leaders(category="speed", season=2024, season_type="REG")
>>> fast.select(["leader_playerName", "leader_maxSpeed", "play_playDescription"]).head()

nfl_ngs_league_schedule(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'Optional[int]' = None, return_as_pandas: 'bool' = False)

NGS league schedule -- one row per game; source of NGS gameId values.

Wraps /api/league/schedule (which returns a top-level list of games). Each row carries gameId (the YYYYMMDDNN id used by the game-scoped functions here), gameKey, smartId (the api.nfl.com uuid), team abbreviations/ids/names, kickoff times, ngsGame (tracking-data flag) and season/seasonType/week.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year.
season_typestr'REG'"REG", "POST", or "PRE".
weekint | NoneNoneoptional single-week filter.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per scheduled game.

col_nametypedescription
gameKeyinteger
gameDatecharacterGame date-time (ISO 8601, UTC).
gameIdinteger
gameTimecharacter
gameTimeEasterncharacter
gameTypecharacterGame type identifier (3 for playoffs).
homeDisplayNamecharacter
homeNicknamecharacter
homeTeamAbbrcharacter
homeTeamIdcharacter
isoTimeinteger
networkChannelcharacter
ngsGamelogical
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
smartIdcharacter
visitorDisplayNamecharacter
visitorNicknamecharacter
visitorTeamAbbrcharacter
visitorTeamIdcharacter
weekintegerSeason week.
weekNameAbbrcharacter
liveDotsGamelogical
validatedlogical
releasedToClubslogical
homeTeam_teamIdcharacter
homeTeam_smartIdcharacter
homeTeam_logocharacter
homeTeam_abbrcharacter
homeTeam_cityStatecharacter
homeTeam_fullNamecharacter
homeTeam_nickcharacter
homeTeam_teamTypecharacter
homeTeam_conferenceAbbrcharacter
homeTeam_divisionAbbrcharacter
site_smartIdcharacter
site_siteIdinteger
site_siteFullNamecharacter
site_siteCitycharacter
site_siteStatecharacter
site_postalCodecharacter
site_roofTypecharacter
visitorTeam_teamIdcharacter
visitorTeam_smartIdcharacter
visitorTeam_logocharacter
visitorTeam_abbrcharacter
visitorTeam_cityStatecharacter
visitorTeam_fullNamecharacter
visitorTeam_nickcharacter
visitorTeam_teamTypecharacter
visitorTeam_conferenceAbbrcharacter
visitorTeam_divisionAbbrcharacter
score_timecharacter
score_phasecharacter
score_visitorTeamScore_pointTotalinteger
score_visitorTeamScore_pointQ1integer
score_visitorTeamScore_pointQ2integer
score_visitorTeamScore_pointQ3integer
score_visitorTeamScore_pointQ4integer
score_visitorTeamScore_pointOTinteger
score_visitorTeamScore_timeoutsRemaininginteger
score_homeTeamScore_pointTotalinteger
score_homeTeamScore_pointQ1integer
score_homeTeamScore_pointQ2integer
score_homeTeamScore_pointQ3integer
score_homeTeamScore_pointQ4integer
score_homeTeamScore_pointOTinteger
score_homeTeamScore_timeoutsRemaininginteger

Example

>>> from sportsdataverse.nfl import nfl_ngs_league_schedule
>>> sched = nfl_ngs_league_schedule(season=2024, season_type="REG", week=1)
>>> first_game_id = sched["gameId"][0]

nfl_ngs_league_schedule_current(return_as_pandas: 'bool' = False)

NGS schedule for the current week -- one row per game.

Wraps /api/league/schedule/current; the games are under the games key (alongside scalar season/seasonType/week describing the slice).

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per game in the current week.

col_nametypedescription
gameKeyinteger
gameDatecharacterGame date-time (ISO 8601, UTC).
gameIdinteger
gameTimecharacter
gameTimeEasterncharacter
gameTypecharacterGame type identifier (3 for playoffs).
homeDisplayNamecharacter
homeNicknamecharacter
homeTeamAbbrcharacter
homeTeamIdcharacter
isoTimeinteger
networkChannelcharacter
ngsGamelogical
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
smartIdcharacter
visitorDisplayNamecharacter
visitorNicknamecharacter
visitorTeamAbbrcharacter
visitorTeamIdcharacter
weekintegerSeason week.
weekNameAbbrcharacter
releasedToClubslogical
validatedlogical
homeTeam_teamIdcharacter
homeTeam_smartIdcharacter
homeTeam_logocharacter
homeTeam_abbrcharacter
homeTeam_cityStatecharacter
homeTeam_fullNamecharacter
homeTeam_nickcharacter
homeTeam_teamTypecharacter
homeTeam_conferenceAbbrcharacter
homeTeam_divisionAbbrcharacter
site_smartIdcharacter
site_siteIdinteger
site_siteFullNamecharacter
site_siteCitycharacter
site_siteStatecharacter
site_postalCodecharacter
site_roofTypecharacter
visitorTeam_teamIdcharacter
visitorTeam_smartIdcharacter
visitorTeam_logocharacter
visitorTeam_abbrcharacter
visitorTeam_cityStatecharacter
visitorTeam_fullNamecharacter
visitorTeam_nickcharacter
visitorTeam_teamTypecharacter
visitorTeam_conferenceAbbrcharacter
visitorTeam_divisionAbbrcharacter
score_timecharacter
score_phasecharacter
score_visitorTeamScore_pointTotalinteger
score_visitorTeamScore_pointQ1integer
score_visitorTeamScore_pointQ2integer
score_visitorTeamScore_pointQ3integer
score_visitorTeamScore_pointQ4integer
score_visitorTeamScore_pointOTinteger
score_visitorTeamScore_timeoutsRemaininginteger
score_homeTeamScore_pointTotalinteger
score_homeTeamScore_pointQ1integer
score_homeTeamScore_pointQ2integer
score_homeTeamScore_pointQ3integer
score_homeTeamScore_pointQ4integer
score_homeTeamScore_pointOTinteger
score_homeTeamScore_timeoutsRemaininginteger

Example

>>> from sportsdataverse.nfl import nfl_ngs_league_schedule_current
>>> cur = nfl_ngs_league_schedule_current()
>>> cur.select(["gameId", "homeTeamAbbr", "visitorTeamAbbr"]).head()

nfl_ngs_league_teams(return_as_pandas: 'bool' = False)

NGS team directory -- one row per team.

Wraps /api/league/teams (top-level list). Each row carries teamId, abbr, fullName, nick, conference/division, cityState, stadiumName, smartId, logo and site/ticket URLs.

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per team.

col_nametypedescription
abbrcharacter
cityStatecharacter
conferenceAbbrcharacter
fullNamecharacterFull name of the probable starting pitcher.
logocharacterTeam or league logo URL.
nickcharacter
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
smartIdcharacter
stadiumNamecharacter
teamIdcharacter
teamSiteTicketUrlcharacter
teamSiteUrlcharacter
teamTypecharacter
ticketPhoneNumbercharacter
yearFoundinteger
conference_idcharacterConference identifier.
conference_abbrcharacterConference abbreviation.
conference_fullNamecharacter
division_idcharacterDivision MLBAM ID.
division_abbrcharacterDivision abbreviation.
division_fullNamecharacter
divisionAbbrcharacter

Example

>>> from sportsdataverse.nfl import nfl_ngs_league_teams
>>> teams = nfl_ngs_league_teams()
>>> teams.select(["teamId", "abbr", "fullName", "conferenceAbbr"]).head()

nfl_ngs_microsite_chart(season: 'int' = 2024, season_type: 'str' = 'REG', week=None, chart_type=None, team_id=None, limit: 'int' = 100, offset: 'int' = 0, return_as_pandas: 'bool' = False)

NGS microsite chart catalogue -- one row per rendered player chart image.

Wraps /api/content/microsite/chart; records live under charts and each carries the chart imageName/type (qb-grid, pass, route, carry) plus the player and headline stats (passerRating, completions, etc.) and image-size URLs. Supports server-side paging.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year.
season_typestr'REG'"REG", "POST", or "PRE".
weekNoneoptional week filter (the API accepts "all" by default).
chart_typeNoneoptional chart-type filter (e.g. "qb-grid", "pass").
team_idNoneoptional team-id filter.
limitint100page size (passed as limit).
offsetint0page offset.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per chart in the page.

col_nametypedescription
imageNamecharacter
esbIdcharacter
firstNamecharacterScorer first name (localized list).
gameIdinteger
headshotcharacterNFL headshot url for player
lastNamecharacterScorer last name (localized list).
playerNamecharacter
positioncharacterPrimary position as reported by NFL.com
receivingYardsinteger
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
teamIdcharacter
timestampintegerResponse timestamp (ISO 8601).
touchdownsinteger
typecharacterRecord type / category.
weekintegerSeason week.
extraLargeImgcharacter
playerNameSlugcharacter
smallImgcharacter
mediumImgcharacter
largeImgcharacter
carriesintegerThe number of official rush attempts (incl. scrambles and kneel downs). Rushes after a lateral reception don't count as carry.
rushingYardsinteger
attemptsintegerThe number of pass attempts as defined by the NFL.
completionPercentagedouble
completionsintegerThe number of completed passes.
interceptionsintegerThe number of interceptions thrown.
passerRatingdouble
passingYardsinteger

Example

>>> from sportsdataverse.nfl import nfl_ngs_microsite_chart
>>> charts = nfl_ngs_microsite_chart(season=2024, season_type="REG", limit=25)
>>> charts.select(["playerName", "type", "imageName"]).head()

nfl_ngs_microsite_chart_players(season: 'int' = 2024, season_type: 'str' = 'REG', return_as_pandas: 'bool' = False)

NGS microsite chart player index -- one row per player with a chart.

Wraps /api/content/microsite/chart/players; records live under players and carry esbId, firstName, lastName and playerName. Useful as the lookup list of who has charts available for a given season.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year.
season_typestr'REG'"REG", "POST", or "PRE".
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per player.

col_nametypedescription
esbIdcharacter
firstNamecharacterScorer first name (localized list).
lastNamecharacterScorer last name (localized list).
playerNamecharacter

Example

>>> from sportsdataverse.nfl import nfl_ngs_microsite_chart_players
>>> who = nfl_ngs_microsite_chart_players(season=2024, season_type="REG")
>>> who.select(["playerName", "esbId"]).head()

nfl_ngs_play_is_highlight(game_id, play_id, return_as_pandas: 'bool' = False)

Look up whether a single play is an NGS highlight -- one-row frame.

Wraps /api/plays/isHighlight (keyed by NGS gameId + playId). When the play is a highlight, the response's nested highlight block (the play metadata, the players involved, season/week/team) is flattened onto the row alongside the top-level gameId/playId/isHighlight flag. Pull a real (gameId, playId) pair from nfl_ngs_leaders -- each leader entry's play_gameId / play_playId is a known highlight.

Parameters

ParameterTypeDefaultDescription
game_idNGS gameId (e.g. "2024111800").
play_idthe play id within that game (e.g. 1214).
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A one-row polars (or pandas) DataFrame with gameId, playId, isHighlight and (when true) flattened highlight_* columns.

col_nametypedescription
gameIdinteger
playIdintegerUnique play event identifier (UUID).
isHighlightlogical
highlight_gameIdinteger
highlight_playIdinteger
highlight_play_playTypecharacter
highlight_play_gameIdinteger
highlight_play_gameKeyinteger
highlight_play_yardlineSidecharacter
highlight_play_absoluteYardlineNumberinteger
highlight_play_yardlineNumberinteger
highlight_play_timeOfDayUTCcharacter
highlight_play_isPenaltylogical
highlight_play_homeScoreinteger
highlight_play_visitorScoreinteger
highlight_play_playStatsinteger
highlight_play_playIdinteger
highlight_play_playDescriptioncharacter
highlight_play_playTypeCodeinteger
highlight_play_quarterinteger
highlight_play_downinteger
highlight_play_yardsToGointeger
highlight_play_actualYardsToGodouble
highlight_play_actualYardlineForFirstDowndouble
highlight_play_possessionTeamIdcharacter
highlight_play_isGoalToGological
highlight_play_healthcharacter
highlight_play_endGameClockcharacter
highlight_play_startGameClockcharacter
highlight_play_playStatecharacter
highlight_play_preSnapHomeScoreinteger
highlight_play_preSnapVisitorScoreinteger
highlight_play_sequenceinteger
highlight_play_gameClockcharacter
highlight_play_yardlinecharacter
highlight_play_isScoringlogical
highlight_play_isEndQuarterlogical
highlight_play_isSTPlaylogical
highlight_play_playDirectioncharacter
highlight_play_isBigPlaylogical
highlight_play_isChangeOfPossessionlogical
highlight_playersinteger
highlight_seasoninteger
highlight_seasonTypecharacter
highlight_teamAbbrcharacter
highlight_teamIdcharacter
highlight_weekinteger

Example

>>> from sportsdataverse.nfl import nfl_ngs_leaders, nfl_ngs_play_is_highlight
>>> lead = nfl_ngs_leaders(category="speed", season=2024, season_type="REG")
>>> gid, pid = lead["play_gameId"][0], lead["play_playId"][0]
>>> hl = nfl_ngs_play_is_highlight(game_id=gid, play_id=pid)
>>> hl.select(["gameId", "playId", "isHighlight"]).head()

nfl_ngs_statboard(stat_type: 'str' = 'passing', season: 'int' = 2024, season_type: 'str' = 'REG', week: 'Optional[int]' = None, return_as_pandas: 'bool' = False)

NGS season/week statboard leaderboard for a stat family (one row per player).

Wraps /api/statboard/{passing,receiving,rushing}. Each record is a flat per-player stat line (e.g. for passing: completionPercentageAboveExpectation, avgTimeToThrow, aggressiveness, passerRating ...). The player's bio is nested under a player object and is flattened to player_* columns.

Parameters

ParameterTypeDefaultDescription
stat_typestr'passing'one of "passing", "receiving", "rushing". (For the cross-stat highlight board use nfl_ngs_statboard_leaders.)
seasonint2024season year, e.g. 2024.
season_typestr'REG'"REG", "POST", or "PRE".
weekint | NoneNonesingle week to filter to; None returns the full-season board.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per qualifying player.

col_nametypedescription
aggressivenessdoubleAggressiveness tracks the amount of passing attempts a quarterback makes that are into tight coverage, where there is a defender within 1 yard or less of the receiver at the time of completion or incompletion. AGG is shown as a % of attempts into tight windows over all passing attempts.
attemptsintegerThe number of pass attempts as defined by the NFL.
avgAirDistancedouble
avgAirYardsDifferentialdouble
avgAirYardsToSticksdouble
avgCompletedAirYardsdouble
avgIntendedAirYardsdouble
avgTimeToThrowdouble
completionPercentagedouble
completionPercentageAboveExpectationdouble
completionsintegerThe number of completed passes.
expectedCompletionPercentagedouble
gamesPlayedinteger
interceptionsintegerThe number of interceptions thrown.
maxAirDistancedouble
maxCompletedAirDistancedouble
passTouchdownsinteger
passYardsinteger
passerRatingdouble
playerNamecharacter
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
positioncharacterPrimary position as reported by NFL.com
teamIdcharacter
player_seasoninteger
player_currentTeamIdcharacter
player_displayNamecharacter
player_esbIdcharacter
player_firstNamecharacter
player_footballNamecharacter
player_gsisIdcharacter
player_gsisItIdinteger
player_headshotcharacterURL to the player headshot image.
player_jerseyNumberinteger
player_lastNamecharacter
player_positioncharacterPosition of the player accordinng to NGS
player_positionGroupcharacter
player_shortNamecharacter
player_smartIdcharacter
player_statuscharacter
player_uniformNumbercharacter
player_ngsPositioncharacter
player_ngsPositionGroupcharacter

Example

>>> from sportsdataverse.nfl import nfl_ngs_statboard
>>> qb = nfl_ngs_statboard(stat_type="passing", season=2024, season_type="REG")
>>> qb.select(["playerName", "passerRating", "completionPercentageAboveExpectation"]).head()

nfl_ngs_statboard_leaders(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'Optional[int]' = None, return_as_pandas: 'bool' = False)

NGS cross-stat "leaders" board, stacked long with a category column.

Wraps /api/statboard/leaders, which bundles several short top-N lists of mixed shape (fastestBallCarriers, fastestSacks, longestCompletions, highestSeparation, rushYardsOverExpected, completionPctAboveExpected, avgYACAboveExpected). Each list is normalized separately and concatenated diagonally (union of columns; missing cells become null), with a category column recording which board each row came from.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year.
season_typestr'REG'"REG", "POST", or "PRE".
weekint | NoneNoneoptional single-week filter.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame stacking every leader list, with a category column. Empty frame if no lists are present.

col_nametypedescription
categorycharacterBroader category of player positions
leader_esbIdcharacter
leader_firstNamecharacter
leader_gsisIdcharacter
leader_jerseyNumberinteger
leader_lastNamecharacter
leader_playerNamecharacter
leader_positioncharacter
leader_positionGroupcharacter
leader_shortNamecharacter
leader_teamAbbrcharacter
leader_teamIdcharacter
leader_weekinteger
leader_yardsinteger
leader_inPlayDistdouble
leader_maxSpeeddouble
leader_headshotcharacter
play_gameIdinteger
play_playIdinteger
play_sequenceinteger
play_downinteger
play_gameClockcharacter
play_gameKeyinteger
play_health_playerTrackingcharacter
play_health_ballTrackingcharacter
play_homeScoreinteger
play_isBigPlaylogical
play_isEndQuarterlogical
play_isGoalToGological
play_isPenaltylogical
play_isSTPlaylogical
play_isScoringlogical
play_playDescriptioncharacter
play_playStatecharacter
play_playStatsinteger
play_playTypecharacter
play_playTypeCodeinteger
play_possessionTeamIdcharacter
play_preSnapHomeScoreinteger
play_preSnapVisitorScoreinteger
play_quarterinteger
play_timeOfDayUTCcharacter
play_visitorScoreinteger
play_yardlinecharacter
play_yardlineNumberinteger
play_yardlineSidecharacter
play_yardsToGointeger
play_absoluteYardlineNumberinteger
play_actualYardlineForFirstDowndouble
play_actualYardsToGodouble
play_endGameClockcharacter
play_isChangeOfPossessionlogical
play_playDirectioncharacter
play_startGameClockcharacter
leader_timedouble
leader_seasonAvgdouble
leader_teamAvgdouble
aggressivenessdoubleAggressiveness tracks the amount of passing attempts a quarterback makes that are into tight coverage, where there is a defender within 1 yard or less of the receiver at the time of completion or incompletion. AGG is shown as a % of attempts into tight windows over all passing attempts.
attemptsintegerThe number of pass attempts as defined by the NFL.
avgAirDistancedouble
avgAirYardsDifferentialdouble
avgAirYardsToSticksdouble
avgCompletedAirYardsdouble
avgIntendedAirYardsdouble
avgTimeToThrowdouble
completionPercentagedouble
completionPercentageAboveExpectationdouble
completionsintegerThe number of completed passes.
expectedCompletionPercentagedouble
gamesPlayedinteger
interceptionsintegerThe number of interceptions thrown.
maxAirDistancedouble
maxCompletedAirDistancedouble
passTouchdownsinteger
passYardsinteger
passerRatingdouble
playerNamecharacter
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
positioncharacterPrimary position as reported by NFL.com
teamIdcharacter
player_seasoninteger
player_currentTeamIdcharacter
player_displayNamecharacter
player_esbIdcharacter
player_firstNamecharacter
player_footballNamecharacter
player_gsisIdcharacter
player_gsisItIdinteger
player_jerseyNumberinteger
player_lastNamecharacter
player_positioncharacterPosition of the player accordinng to NGS
player_positionGroupcharacter
player_shortNamecharacter
player_statuscharacter
player_uniformNumbercharacter
player_headshotcharacterURL to the player headshot image.
player_smartIdcharacter
player_ngsPositioncharacter
player_ngsPositionGroupcharacter
avgCushiondouble
avgExpectedYACdouble
avgSeparationdouble
avgYACdouble
avgYACAboveExpectationdouble
catchPercentagedouble
percentShareOfIntendedAirYardsdouble
recTouchdownsinteger
receptionsintegerThe number of pass receptions. Lateral receptions officially don't count as reception.
targetsintegerThe number of pass plays where the player was the targeted receiver.
yardsintegerThe number of receiving yards
avgTimeToLosdouble
expectedRushYardsdouble
rushAttemptsinteger
rushPctOverExpecteddouble
rushTouchdownsinteger
rushYardsinteger
rushYardsOverExpecteddouble
rushYardsOverExpectedPerAttdouble

Example

>>> from sportsdataverse.nfl import nfl_ngs_statboard_leaders
>>> bd = nfl_ngs_statboard_leaders(season=2024, season_type="REG")
>>> bd["category"].unique().to_list()

nfl_rosters(season: 'int' = 2024, limit: 'int' = 40, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com team rosters -- one row per team (/football/v2/rosters).

Records live under the rosters key. Each row is one team's roster for the season, carrying season, seasonType, team_* columns and a nested persons list of players (kept as a list column).

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
limitint40page size -- max rosters to return (this endpoint is paginated; default 40 covers all teams in one page).
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per team roster.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
personsinteger
team_idcharacterUnique team identifier.
team_abbreviationcharacterShort team abbreviation (e.g. 'LAS').
team_fullNamecharacter
team_conferenceAbbrcharacter
team_conferenceFullNamecharacter
team_currentLogocharacter
team_divisionFullNamecharacter
team_leaguecharacter
team_locationcharacterTeam city or location string.
team_nickNamecharacter
team_venuescharacter

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_rosters
>>> rosters = nfl_rosters(season=2024, limit=40)
>>> rosters.select(["team_abbreviation", "season", "seasonType"]).head()

nfl_standings(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'int' = 1, limit: 'int' = 40, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com standings -- one row per team (/football/v2/standings).

The payload nests records under weeks[].standings[]; this flattens every team standing across the returned week(s) into a single frame with team_*, overall_*, division_*, conference_*, home_*, road_*, last5_*, and clinched columns.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
season_typestr'REG'season type. One of "PRE", "REG", "POST".
weekint1week number whose standings snapshot to return.
limitint40max teams per page (default 40; there are 32 teams).
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict; defaults to a fresh mint.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per team standing.

col_nametypedescription
team_idcharacterUnique team identifier.
team_currentLogocharacter
team_fullNamecharacter
clinched_byelogical
clinched_divisionlogical
clinched_eliminatedlogical
clinched_homeFieldlogical
clinched_playofflogical
clinched_wildCardlogical
closeGames_winsinteger
closeGames_lossesinteger
closeGames_tiesinteger
conference_winsintegerTotal conference wins.
conference_winPctdouble
conference_lossesintegerTotal conference losses.
conference_tiesintegerTotal conference ties.
conference_rankinteger
conference_points_forinteger
conference_points_againstinteger
division_winsinteger
division_winPctdouble
division_lossesinteger
division_tiesinteger
division_rankinteger
division_points_forinteger
division_points_againstinteger
home_winsintegerHome team's wins.
home_winPctdouble
home_lossesintegerHome team's losses.
home_tiesintegerTotal home ties.
home_points_forinteger
home_points_againstinteger
last5_winsinteger
last5_winPctdouble
last5_lossesinteger
last5_tiesinteger
last5_points_forinteger
last5_points_againstinteger
overall_gamesinteger
overall_winsinteger
overall_winPctdouble
overall_lossesinteger
overall_tiesinteger
overall_points_forinteger
overall_points_againstinteger
overall_streak_typecharacter
overall_streak_lengthinteger
road_winsintegerRoad wins.
road_winPctdouble
road_lossesintegerRoad losses.
road_tiesintegerTies on the road.
road_points_forinteger
road_points_againstinteger

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_standings
>>> standings = nfl_standings(season=2024, season_type="REG", week=18)
>>> standings.select(["team_abbreviation", "overall_wins", "overall_losses"]).head()

nfl_team(team_id: 'str', headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com single-team detail -- one row (/football/v2/teams/{id}).

The endpoint returns one team object (not a list); this wraps it into a one-row frame with id, fullName, currentCoach_*, primaryColor, secondaryColor, yearEstablished, owners, socials and more.

Parameters

ParameterTypeDefaultDescription
team_idstrthe uuid team id from nfl_teams_history (e.g. '10403800-517c-7b8c-65a3-c61b95d86123' for ARI).
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame with a single team row.

col_nametypedescription
idcharacterID of the player in the 'name' column.
biocharacter
currentBackgroundcharacter
currentCoachcharacter
currentLogocharacter
primaryColorcharacter
secondaryColorcharacter
yearEstablishedinteger
fullNamecharacterFull name of the probable starting pitcher.
nflShopUrlcharacter
officialWebsiteUrlcharacter
ownerscharacter
teamTypecharacter
socialscharacter
vllChannelCallsigncharacter

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_team
>>> team = nfl_team(team_id="10403800-517c-7b8c-65a3-c61b95d86123")
>>> team.select(["id", "fullName", "yearEstablished"]).head()

nfl_teams_history(season: 'int' = 2024, limit: 'int' = 40, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com teams for a season -- one row per team (/football/v2/teams/history).

Records live under the teams key. Each row carries id (the uuid team id used by nfl_team), abbreviation, fullName, nickName, location, conferenceAbbr/divisionFullName, currentLogo and the nested venues list.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
limitint40page size (default 40).
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per team.

col_nametypedescription
idcharacterID of the player in the 'name' column.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
abbreviationcharacterShort abbreviation.
fullNamecharacterFull name of the probable starting pitcher.
teamTypecharacter
conferenceAbbrcharacter
conferenceFullNamecharacter
currentLogocharacter
divisionFullNamecharacter
leaguecharacterLeague slug.
locationcharacterEither Home if the home team is playing in their home stadium, or Neutral if the game is being played at a neutral location. This still shows as Home for games between the Giants and Jets even though they share the same home stadium.
nickNamecharacter
venuescharacter

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_teams_history
>>> teams = nfl_teams_history(season=2024)
>>> teams.select(["id", "abbreviation", "fullName"]).head()

nfl_token_gen(client_key: 'Optional[str]' = None, client_secret: 'Optional[str]' = None) -> 'str'

Mint a fresh api.nfl.com access token via /identity/v3/token.

Wraps the anonymous device-token grant the NFL.com web app uses. Credentials resolve in this order: explicit client_key/client_secret args -> NFL_CLIENT_KEY/NFL_CLIENT_SECRET env vars -> the bundled public WEB_DESKTOP web-app credentials.

Parameters

ParameterTypeDefaultDescription
client_keyOptional[str]NoneOverride the client key (else env var, else the web default).
client_secretOptional[str]NoneOverride the client secret (else env var, else the default).

Returns

The bearer accessToken string.

Example

from sportsdataverse.nfl.nfl_games import nfl_token_gen
token = nfl_token_gen()
assert isinstance(token, str) and token.startswith("ey")

nfl_week_games(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'int' = 1, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com week schedule -- one row per game (polars/pandas frame).

Tidy wrapper over nfl_game_schedule: flattens the games list into a DataFrame with id (uuid game id), season/seasonType/week, date, status_*, and homeTeam_* / awayTeam_* columns.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year. season_type (str): "PRE"/"REG"/"POST".
season_typestr'REG'
weekint1week number. headers: reuse a nfl_headers_gen dict.
headersOptional[Dict[str, str]]None
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per game.

col_nametypedescription
idcharacterID of the player in the 'name' column.
categorycharacterBroader category of player positions
datecharacterDate in YYYY-MM-DD format.
timecharacterTime at start of play provided in string format as minutes:seconds remaining in the quarter.
gameTypecharacterGame type identifier (3 for playoffs).
internationallogical
neutralSitelogicalWhether the game is at a neutral site.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
statuscharacterStatus label.
weekintegerSeason week.
weekTypecharacter
externalIdscharacter
ticketUrlcharacter
ticketVendorscharacter
extensionscharacter
versioninteger
homeTeam_idcharacter
homeTeam_currentLogocharacter
homeTeam_fullNamecharacter
awayTeam_idcharacter
awayTeam_currentLogocharacter
awayTeam_fullNamecharacter
broadcastInfo_homeNetworkChannelscharacter
broadcastInfo_awayNetworkChannelscharacter
broadcastInfo_internationalWatchOptionscharacter
broadcastInfo_streamingNetworkscharacter
broadcastInfo_territorycharacter
broadcastInfo_audioNetworkscharacter
venue_idcharacterUnique venue identifier.
venue_namecharacterVenue name.
venue_citycharacterVenue city.
venue_countrycharacter

Example

>>> from sportsdataverse.nfl import nfl_week_games
>>> sched = nfl_week_games(season=2024, season_type="REG", week=1)
>>> sched.select(["id", "homeTeam_fullName", "awayTeam_fullName"]).head()

nfl_weekly_game_details(season: 'int' = 2024, season_type: 'str' = 'REG', week: 'int' = 1, include_drive_chart: 'bool' = True, include_replays: 'bool' = False, include_standings: 'bool' = False, include_tagged_videos: 'bool' = False, headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com weekly game details -- one row per game.

Wraps /football/v2/experience/weekly-game-details, which returns a bare list of game objects (no wrapper key). Each row carries id (uuid game id), nested homeTeam / awayTeam, date, time, venue, status, broadcastInfo, externalIds, a summary object and, when requested, driveChart / replays / taggedVideos.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
season_typestr'REG'season type. One of "PRE", "REG", "POST"; sent on the wire as the type query param.
weekint1week number.
include_drive_chartboolTrueinclude the per-game driveChart block.
include_replaysboolFalseinclude the replays block.
include_standingsboolFalseinclude the standings block.
include_tagged_videosboolFalseinclude the taggedVideos block.
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per game.

col_nametypedescription
idcharacterID of the player in the 'name' column.
categorycharacterBroader category of player positions
datecharacterDate in YYYY-MM-DD format.
timecharacterTime at start of play provided in string format as minutes:seconds remaining in the quarter.
gameTypecharacterGame type identifier (3 for playoffs).
internationallogical
neutralSitelogicalWhether the game is at a neutral site.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
statuscharacterStatus label.
weekintegerSeason week.
weekTypecharacter
externalIdscharacter
ticketUrlcharacter
ticketVendorscharacter
extensionscharacter
versioninteger
replayscharacter
taggedVideoscharacter
awayTeamStandingscharacter
homeTeamStandingscharacter
homeTeam_idcharacter
homeTeam_currentLogocharacter
homeTeam_fullNamecharacter
awayTeam_idcharacter
awayTeam_currentLogocharacter
awayTeam_fullNamecharacter
broadcastInfo_homeNetworkChannelscharacter
broadcastInfo_awayNetworkChannelscharacter
broadcastInfo_internationalWatchOptionscharacter
broadcastInfo_streamingNetworkscharacter
broadcastInfo_territorycharacter
broadcastInfo_audioNetworkscharacter
venue_idcharacterUnique venue identifier.
venue_namecharacterVenue name.
venue_citycharacterVenue city.
venue_countrycharacter
summary_gameIdcharacter
summary_offsetinteger
summary_attendanceinteger
summary_clockcharacter
summary_distanceinteger
summary_downinteger
summary_gameBookUrlcharacter
summary_isGoalToGological
summary_isRedZonelogical
summary_phasecharacter
summary_quartercharacter
summary_startTimecharacter
summary_weathercharacter
summary_yardLinecharacter
summary_awayTeam_teamIdcharacter
summary_awayTeam_hasPossessionlogical
summary_awayTeam_scorecharacter
summary_awayTeam_timeoutscharacter
summary_homeTeam_teamIdcharacter
summary_homeTeam_hasPossessionlogical
summary_homeTeam_scorecharacter
summary_homeTeam_timeoutscharacter
driveChart_gameIdcharacter
driveChart_offsetinteger
driveChart_drivesinteger
driveChart_playsinteger
driveChart_scoringSummariesinteger

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_weekly_game_details
>>> details = nfl_weekly_game_details(season=2024, season_type="REG", week=1)
>>> details.select(["id", "date", "homeTeam", "awayTeam"]).head()

nfl_weeks(season: 'int' = 2024, season_type: 'str' = 'REG', headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com week calendar -- one row per week (/football/v2/weeks/...).

Records live under the weeks key. Each row carries season, seasonType, week, weekType, dateBegin, dateEnd and a byeTeams list.

Parameters

ParameterTypeDefaultDescription
seasonint2024season year (e.g. 2024).
season_typestr'REG'season type. One of "PRE", "REG", "POST".
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame, one row per week.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
weekintegerSeason week.
byeTeamscharacter
dateBegincharacter
dateEndcharacter
weekTypecharacter

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_weeks
>>> weeks = nfl_weeks(season=2024, season_type="REG")
>>> weeks.select(["week", "weekType", "dateBegin", "dateEnd"]).head()

nfl_weeks_by_date(date: 'str', headers: 'Optional[Dict[str, str]]' = None, return_as_pandas: 'bool' = False)

Parsed api.nfl.com week-for-a-date -- one row (/football/v2/weeks/date/{YYYY-MM-DD}).

The endpoint returns one week object (not a list); this wraps it into a one-row frame with season, seasonType, week, weekType, dateBegin, dateEnd and byeTeams.

Parameters

ParameterTypeDefaultDescription
datestrcalendar date in YYYY-MM-DD form (e.g. '2024-09-08').
headersDict[str, str] | NoneNonereuse a nfl_headers_gen dict.
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame with a single week row.

col_nametypedescription
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacter
weekintegerSeason week.
byeTeamscharacter
dateBegincharacter
dateEndcharacter
weekTypecharacter

Example

>>> from sportsdataverse.nfl.nfl_api import nfl_weeks_by_date
>>> wk = nfl_weeks_by_date(date="2024-09-08")
>>> wk.select(["season", "seasonType", "week"]).head()

reset_config() -> 'NflConfig'

Reset the active config to its env-var-derived defaults.

Convenience for tests / interactive sessions that want to undo a chain of update_config() calls without restarting the interpreter.

Example

from sportsdataverse.nfl import update_config, reset_config
update_config(cache_mode="off", timeout=5)
# ... do work ...
reset_config() # back to env-derived defaults

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.dl_utils import download
from sportsdataverse.nfl.nfl_schedule import scoreboard_event_parsing
url = "http://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard"
payload = download(url=url).json()
for ev in payload.get("events", []):
scoreboard_event_parsing(ev)
ev["competitions"][0]["home"]["abbreviation"]

update_config(**kwargs: 'object') -> 'NflConfig'

Update the active config in place.

Returns

The (mutated) global config object, for chaining or inspection.

Example

from sportsdataverse.nfl import update_config
update_config(cache_mode="filesystem", cache_duration=3600)

# Disable caching for development

update_config(cache_mode="off")

# Point cache at a custom directory

update_config(cache_dir="~/sdv-cache")