Skip to main content

NFL — additional Python functions — Dataset loaders: nfl_ff–nfl_pfr

load_nfl_ff_opportunity​

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​

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_idcharacterMyFantasyLeague.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_idcharacterSleeper ID - usually an integer with ~4 digits.
nfl_idcharacterNFL ID of player (this is used in Big Data Bowl Data)
espn_idcharacterESPN 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_idcharacterCBS 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_idcharacterRotowire 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_idcharacterKeepTradeCut ID - usual format is an integer with ~four digits.
stats_idcharacterStats ID - usual format is five digit integer
stats_global_idcharacterStats Global ID - usual format is a six digit integer
fantasy_data_idcharacterFantasyData 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​

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
idcharacterID 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_fp_curve​

load_nfl_fp_curve() -> 'pl.DataFrame'

Load the bundled NFL EP-by-yardline curve (no network).

Returns

yardline_own: Int64 (1..99), ep: Float64.

col_nametypedescription
yardline_ownintegerStarting yard line from the offense's own goal (1-99); one row per yard line of the bundled NFL EP-by-starting-yardline curve.
epdoubleUsing the scoring event probabilities, the estimated expected points with respect to the possession team for the given play.

Example

from sportsdataverse.nfl import load_nfl_fp_curve
curve = load_nfl_fp_curve()
curve.filter(curve["yardline_own"] == 30)

load_nfl_nextgen_stats​

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​

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​

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​

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​

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_keycharacterUnique nflverse game identifier linking the officiating record to a specific NFL game.
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_pfr_advstats​

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_dropsdoubleTotal number of catchable passes thrown by the passer that were dropped by receivers per Pro Football Reference.
passing_drop_pctdoublePercentage of a passer's catchable targets that were dropped by the intended receiver.
receiving_dropdoubleNumber of catchable targets the receiver dropped during the game or season period per Pro Football Reference.
receiving_drop_pctdoublePercentage of the receiver's catchable targets that were dropped during the game or season period.
passing_bad_throwsdoubleTotal number of passes thrown by the passer that were classified as inaccurate or poor-quality throws per Pro Football Reference.
passing_bad_throw_pctdoublePercentage of a passer's attempts classified as bad throws (inaccurate, off-target, or uncatchable).
times_sackeddoubleTotal number of times the passer was sacked during the game or season period per Pro Football Reference.
times_blitzeddoubleNumber of times blitzed
times_hurrieddoubleNumber of times hurried
times_hitdoubleNumber of times hit
times_pressureddoubleNumber of times pressured
times_pressured_pctdoublePercentage of the passer's dropbacks during which they faced pressure from the opposing defense.
def_times_blitzeddoubleNumber of times the defensive player sent additional rushers on a blitz during the game or season period.
def_times_hurrieddoubleNumber of times the defensive player hurried or pressured the quarterback without recording a sack.
def_times_hitqbdoubleNumber of times the defensive player made contact with the quarterback (hit on the QB) during pass rushes.

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​

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).
gsdoubleNumber of games the player started during the season or period covered by this row.
intdoubleBinary flag for an interception.
tgtdoubleTotal number of times the player was the nearest defender on a pass attempt (targets in coverage) per Pro Football Reference.
cmpdoubleNumber of passes completed by the opposing quarterback when targeting the player in coverage.
cmp_percentdoubleCompletion percentage allowed by the player in coverage (completions divided by targets).
ydsdoubleTotal passing yards allowed by the player in coverage.
yds_cmpdoubleAverage yards allowed per completion when the player was in coverage.
yds_tgtdoubleAverage yards allowed per target thrown at the player in coverage.
tddoubleNumber of touchdowns allowed by the player in coverage.
ratdoublePasser rating allowed by the player in coverage — the NFL passer rating of quarterbacks when targeting this defender.
dadotdoubleDepth of target air yards on defended passes — average distance downfield at the point of the throw when the player was in coverage.
airdoubleTotal air yards (depth of target) on passes thrown at the player in coverage, as tracked by Pro Football Reference.
yacdoubleYards after catch allowed by the player — yards gained by receivers after the catch when the player was the nearest defender.
bltzdoubleNumber of snaps on which the player blitzed the quarterback, as recorded by Pro Football Reference.
hrrydoubleNumber of times the player hurried the opposing quarterback without recording a full sack, per Pro Football Reference.
qbkddoubleNumber of times the player knocked down the quarterback, making contact after or during a pass attempt.
skdoubleNumber of sacks recorded by the player, bringing the quarterback down behind the line of scrimmage.
prssdoubleNumber of times the player pressured the quarterback (combining sacks, hits, and hurries) per Pro Football Reference.
combdoubleTotal combined tackles (solo plus assisted) recorded by the player per Pro Football Reference.
m_tkldoubleNumber of missed tackles attributed to the player by Pro Football Reference.
m_tkl_percentdoublePercentage of tackle attempts the player missed out of total tackle opportunities.
loadedcharacterIndicator or metadata field from the Pro Football Reference data load, typically flagging the data source state or row completeness.
batsdoubleNumber of passes batted down at the line of scrimmage by the player.

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​

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_yardsdoubleTotal air yards on all pass attempts including incompletions, measuring aggregate downfield targeting intent from Pro Football Reference.
intended_air_yards_per_pass_attemptdoubleAverage intended air yards per pass attempt, capturing the passer's average depth of target regardless of completion outcome.
completed_air_yardsdoubleTotal air yards on completed passes only, measuring how far the ball traveled downfield through the air to the point of completion.
completed_air_yards_per_completiondoubleAverage air yards per completed pass, representing the passer's typical depth of target on successful throws.
completed_air_yards_per_pass_attemptdoubleAverage completed air yards per pass attempt (including incompletions), a rate measure of downfield passing efficiency.
pass_yards_after_catchdoubleTotal yards gained by receivers after the catch, isolating the yards generated after initial ball reception from Pro Football Reference.
pass_yards_after_catch_per_completiondoubleAverage yards after catch per completion, measuring how much yardage receivers generate on the ground after catching the ball.
scramblesdoubleTotal number of quarterback scrambles (designed dropback converted to a run) recorded by Pro Football Reference.
scramble_yards_per_attemptdoubleAverage yards gained per scramble attempt by the quarterback, from Pro Football Reference advanced passing stats.

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​

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).
gsdoubleNumber of games the player started at a receiver position during the period covered.
tgtdoubleTotal number of times the player was the intended receiver on a pass attempt.
recdoubleTotal receptions made by the player during the period covered.
ydsdoubleTotal receiving yards gained by the player on all receptions.
tddoubleTotal receiving touchdowns scored by the player.
x1ddoubleNumber of receptions by the player that resulted in a first down.
ybcdoubleTotal yards the ball traveled in the air (before the catch) on receptions by the player.
ybc_rdoubleAverage air yards before the catch per reception.
yacdoubleTotal yards gained by the player after the catch.
yac_rdoubleAverage yards after the catch per reception.
adotdoubleAverage depth of target — mean air yards at point of throw on pass attempts directed at the receiver, per Pro Football Reference.
brk_tkldoubleNumber of broken tackles credited to the player after a reception, per Pro Football Reference.
rec_brdoubleReceptions per broken tackle — number of receptions for each broken tackle the player forced after the catch, per Pro Football Reference.
dropdoubleNumber of catchable passes the player dropped (failed to secure after the ball reached the receiver's hands).
drop_percentdoublePercentage of catchable targets that the player dropped.
intdoubleBinary flag for an interception.
ratdoublePasser rating generated on passes thrown to the player — the NFL passer rating when the receiver is targeted.
loadedcharacterIndicator or metadata field from the Pro Football Reference data load, flagging the row's data source state or completeness.

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​

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).
gsdoubleNumber of games started by the player during the period covered.
attdoubleTotal rushing attempts by the player during the period covered.
ydsdoubleTotal rushing yards gained during the period covered.
tddoubleTotal rushing touchdowns scored during the period covered.
x1ddoubleNumber of first downs gained via rushing during the period covered.
ybcdoubleYards before contact accumulated on rushing plays, measuring yards gained in open field before being touched.
ybc_attdoubleYards before contact per rushing attempt.
yacdoubleYards after contact accumulated on rushing plays.
yac_attdoubleYards after contact per rushing attempt.
brk_tkldoubleNumber of broken tackles recorded on rushing plays.
att_brdoubleRushing attempts per broken tackle, measuring how often the player required contact to break free.
loadedcharacterSource or load-batch identifier indicating which data file or release this row was pulled from.

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​

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_intsdoubleInterceptions for the week (this loader is per-player-per-week, not career).
def_targetsdoubleNumber of passing attempts thrown at or into the coverage area of this defender during the week.
def_completions_alloweddoubleNumber of completions allowed by the defender on passes thrown into their coverage during the week.
def_completion_pctdoubleCompletion percentage allowed by the defender on targets thrown in their coverage during the week.
def_yards_alloweddoubleTotal receiving yards allowed by this defender in coverage during the week per Pro Football Reference.
def_yards_allowed_per_cmpdoubleReceiving yards allowed per completion by this defender in coverage during the week.
def_yards_allowed_per_tgtdoubleReceiving yards allowed per target thrown at this defender in coverage during the week.
def_receiving_td_alloweddoubleNumber of receiving touchdowns allowed by the defender while in coverage during the week.
def_passer_rating_alloweddoubleNFL passer rating of quarterbacks when targeting this defender in coverage during the week.
def_adotdoubleAverage depth of target (in yards) against this defender on passing plays during the week.
def_air_yards_completeddoubleTotal air yards on completed passes allowed by the defender during the week.
def_yards_after_catchdoubleTotal yards gained by receivers after the catch on completions allowed by this defender during the week.
def_times_blitzeddoubleNumber of times this defender was sent as a blitzer on a passing play during the week.
def_times_hurrieddoubleNumber of times this defender hurried the quarterback on a pass rush without recording a sack during the week.
def_times_hitqbdoubleNumber of times this defender made contact with the quarterback as part of a pass rush during the week.
def_sacksdoubleNumber of sacks form this player
def_pressuresdoubleTotal number of quarterback pressures (hurries + hits + sacks) generated by the defender during the week.
def_tackles_combineddoubleTotal combined tackles (solo + assisted) recorded by the defender during the week per Pro Football Reference.
def_missed_tacklesdoubleNumber of missed tackles recorded against this defender during the week per Pro Football Reference.
def_missed_tackle_pctdoublePercentage of the defender's tackle opportunities that resulted in a missed tackle during the week.

Example

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