Skip to main content

NFL — additional Python functions — NFL Pro: nfl_ngs–scrape_ngs

nfl_ngs_statboard_leaders​

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_esbIdcharacterESB (NFL's Enterprise Subscriber Base) identifier for the player featured in the leader record.
leader_firstNamecharacterFirst name of the player featured in the leader record.
leader_gsisIdcharacterGSIS (Game Statistics and Information System) identifier for the player featured in the leader record.
leader_jerseyNumberintegerJersey number of the player featured in the leader record.
leader_lastNamecharacterLast name of the player featured in the leader record.
leader_playerNamecharacterFull display name of the player featured in the leader record.
leader_positioncharacterPosition designation of the player featured in the leader record (e.g., 'QB', 'WR').
leader_positionGroupcharacterBroad position group of the player featured in the leader record (e.g., 'OFFENSE', 'DEFENSE').
leader_shortNamecharacterAbbreviated display name of the player featured in the leader record (e.g., 'P.Mahomes').
leader_teamAbbrcharacterTeam abbreviation of the player featured in the leader record (e.g., 'KC').
leader_teamIdcharacterNFL Shield team identifier for the team of the player featured in the leader record.
leader_weekintegerWeek number associated with the weekly leader record.
leader_yardsintegerYardage total associated with the featured leader statistic for this player.
leader_inPlayDistdoubleDistance (in yards) the player traveled while the ball was in play on the featured leader statistic.
leader_maxSpeeddoubleMaximum speed (in yards per second or mph) recorded by the player on the featured leader statistic play.
leader_headshotcharacterURL to the headshot image of the player featured in the leader record.
play_gameIdintegerNFL Shield API game identifier for the game this play belongs to.
play_playIdintegerNFL Shield API unique integer identifier for this play within the game.
play_sequenceintegerSequential order integer of this play within the game as used by the NFL Shield API.
play_downintegerDown number (1–4) at the time of this play.
play_gameClockcharacterGame clock time remaining at the start of this play in MM:SS format.
play_gameKeyintegerNFL Shield internal game key integer identifying the game in internal API routing.
play_health_playerTrackingcharacterData quality status string for player-tracking data on this play (e.g., 'GOOD', 'PARTIAL').
play_health_ballTrackingcharacterData quality status string for ball-tracking data on this play (e.g., 'GOOD', 'MISSING').
play_homeScoreintegerHome team's score at the end of this play.
play_isBigPlaylogicalBoolean flag indicating whether this play was classified as a 'big play' by the NFL Shield API.
play_isEndQuarterlogicalBoolean flag indicating whether this play was the final play of a quarter.
play_isGoalToGologicalBoolean flag indicating whether this play occurred in a goal-to-go situation.
play_isPenaltylogicalBoolean flag indicating whether a penalty was assessed on this play.
play_isSTPlaylogicalBoolean flag indicating whether this play was a special teams play.
play_isScoringlogicalBoolean flag indicating whether this play resulted in a score.
play_playDescriptioncharacterOfficial NFL text description of the play (e.g., '(2:11) J.Allen scrambles right end for 9 yards').
play_playStatecharacterStatus of the play record (e.g., 'FINAL', 'LIVE') in the NFL Shield API at time of capture.
play_playStatsintegerSerialized or encoded statistical detail for the play outcomes (e.g., yards, player IDs).
play_playTypecharacterText label classifying the play type (e.g., 'PASS', 'RUSH', 'PUNT') from the NFL Shield API.
play_playTypeCodeintegerInteger code corresponding to the play type classification in the NFL Shield API.
play_possessionTeamIdcharacterNFL Shield team identifier for the team that had possession during this play.
play_preSnapHomeScoreintegerHome team's score immediately before the snap of this play.
play_preSnapVisitorScoreintegerVisiting team's score immediately before the snap of this play.
play_quarterintegerQuarter number (1–4, or 5 for overtime) in which this play occurred.
play_timeOfDayUTCcharacterWall-clock timestamp in UTC at which this play occurred during the broadcast.
play_visitorScoreintegerVisiting team's score at the end of this play.
play_yardlinecharacterHuman-readable yardline string (e.g., 'DAL 22') indicating where this play began.
play_yardlineNumberintegerNumeric yard line (1–50 from nearest end zone) of the line of scrimmage at the snap.
play_yardlineSidecharacterTeam abbreviation indicating which team's side of the field the yardline is on.
play_yardsToGointegerInteger yards needed for a first down on this play.
play_absoluteYardlineNumberintegerAbsolute yard line number (1–100 from one end zone) of the line of scrimmage at the snap for this play.
play_actualYardlineForFirstDowndoubleActual yard line marker needed for a first down on this play.
play_actualYardsToGodoubleExact decimal yards required for a first down on this play.
play_endGameClockcharacterGame clock time remaining at the end of this play in MM:SS format.
play_isChangeOfPossessionlogicalBoolean flag indicating whether this play resulted in a change of possession.
play_playDirectioncharacterDirection of the play (left, right, middle) as recorded in NFL Shield tracking data.
play_startGameClockcharacterGame clock time remaining at the moment this play began, in MM:SS format.
leader_timedoubleElapsed time value associated with the leader record, such as time of possession or time-to-throw.
leader_seasonAvgdoubleSeason-to-date average of the featured leader statistic for this player.
leader_teamAvgdoubleTeam-level average of the featured statistic across all players on the team.
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.
avgAirDistancedoubleAverage air distance (in yards) the ball traveled on all pass attempts, from NFL Next Gen Stats.
avgAirYardsDifferentialdoubleAverage difference between intended air yards and completed air yards per attempt, indicating whether the passer throws short or long relative to the targeted depth.
avgAirYardsToSticksdoubleAverage air yards relative to the first-down marker on pass attempts, from NFL Next Gen Stats (negative = short of sticks, positive = past sticks).
avgCompletedAirYardsdoubleAverage air yards on completed passes only, from NFL Next Gen Stats.
avgIntendedAirYardsdoubleAverage intended air yards per pass attempt (including incompletions), from NFL Next Gen Stats.
avgTimeToThrowdoubleAverage time in seconds from snap to throw for the passer, from NFL Next Gen Stats.
completionPercentagedoublePercentage of pass attempts completed by the passer, from NFL Next Gen Stats statboard leaders.
completionPercentageAboveExpectationdoublePasser's actual completion percentage minus their expected completion percentage based on target depth, coverage, and game context (CPOE), from NFL Next Gen Stats.
completionsintegerThe number of completed passes.
expectedCompletionPercentagedoubleModel-predicted completion percentage for the passer based on depth of target, receiver separation, and coverage, from NFL Next Gen Stats.
gamesPlayedintegerNumber of games played by the player in the given season or time period.
interceptionsintegerThe number of interceptions thrown.
maxAirDistancedoubleMaximum air distance (in yards) recorded on a single pass attempt by the passer, from NFL Next Gen Stats.
maxCompletedAirDistancedoubleMaximum air distance on a completed pass for the passer, from NFL Next Gen Stats.
passTouchdownsintegerTotal passing touchdowns recorded by the player in the given period.
passYardsintegerTotal passing yards recorded by the player in the given period.
passerRatingdoubleNFL passer rating (0–158.3 scale) for the quarterback in the given period.
playerNamecharacterFull display name of the player associated with this NGS statboard leader record.
seasoninteger4 digit number indicating to which season(s) the specified timeframe belongs to.
seasonTypecharacterPhase of the season for this record (e.g., 'REG' for regular season, 'POST' for playoffs).
positioncharacterPrimary position as reported by NFL.com
teamIdcharacterNFL Shield team identifier for the team associated with this leader statistic.
player_seasonintegerNFL season year in which this player record is valid.
player_currentTeamIdcharacterNFL Shield team identifier for the player's current team.
player_displayNamecharacterPlayer's full display name as used by NFL Next Gen Stats (e.g., 'Patrick Mahomes').
player_esbIdcharacterESB (Enterprise Subscriber Base) identifier assigned to this player by the NFL.
player_firstNamecharacterPlayer's first name as recorded in the NFL Next Gen Stats player roster.
player_footballNamecharacterPlayer's preferred football name (may differ from legal first name) used on the field and in broadcasts.
player_gsisIdcharacterGSIS (Game Statistics and Information System) identifier, the primary NFL player identifier used across nflverse datasets.
player_gsisItIdintegerGSIS integrated tracking identifier, an alternate integer-form player ID used in the NFL Shield tracking system.
player_jerseyNumberintegerPlayer's jersey number as worn on the field.
player_lastNamecharacterPlayer's last name as recorded in the NFL Next Gen Stats player roster.
player_positioncharacterPosition of the player accordinng to NGS
player_positionGroupcharacterOfficial NFL position group for the player (e.g., 'OFFENSE', 'DEFENSE', 'SPECIAL_TEAMS').
player_shortNamecharacterAbbreviated player name used in display contexts (e.g., 'P.Mahomes').
player_statuscharacterPlayer's current roster status (e.g., 'ACT' for active, 'IR' for injured reserve).
player_uniformNumbercharacterPlayer's uniform number as a string, matching what appears on the jersey.
player_headshotcharacter
player_smartIdcharacterNFL Smart ID — a system-agnostic unique identifier for the player used across NFL Shield systems.
player_ngsPositioncharacterPlayer's position as classified by NFL Next Gen Stats (may differ from official NFL position; e.g., NGS uses 'ILB' vs 'LB').
player_ngsPositionGroupcharacterBroad position group assigned by NFL Next Gen Stats (e.g., 'QB', 'WR', 'DB', 'DL').
avgCushiondoubleAverage distance (in yards) between the receiver and the nearest defender at the snap, from NFL Next Gen Stats receiver tracking.
avgExpectedYACdoubleAverage yards after catch expected based on game situation and receiver location, from NFL Next Gen Stats models.
avgSeparationdoubleAverage separation (in yards) between the receiver and the nearest defender at the moment of catch or incompletion, from NFL Next Gen Stats.
avgYACdoubleAverage yards after catch per reception, from NFL Next Gen Stats receiver tracking.
avgYACAboveExpectationdoubleAverage yards after catch above statistical expectation (YAC - expected YAC), from NFL Next Gen Stats models.
catchPercentagedoublePercentage of targets caught by the receiver, from NFL Next Gen Stats statboard leaders.
percentShareOfIntendedAirYardsdoubleReceiver's share (as a percentage) of the team's total intended air yards, from NFL Next Gen Stats.
recTouchdownsintegerTotal receiving touchdowns recorded by the player in the given period.
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
avgTimeToLosdoubleAverage time (in seconds) for the ball carrier to reach the line of scrimmage on rush attempts, from NFL Next Gen Stats.
expectedRushYardsdoubleModel-predicted rushing yards based on field position, personnel, and pre-snap alignment, from NFL Next Gen Stats.
rushAttemptsintegerTotal rushing attempts by the player in the given period.
rushPctOverExpecteddoublePercentage of rush attempts on which the player gained more yards than the model-predicted expectation, from NFL Next Gen Stats.
rushTouchdownsintegerTotal rushing touchdowns recorded by the player in the given period.
rushYardsintegerTotal rushing yards recorded by the player in the given period.
rushYardsOverExpecteddoubleTotal rushing yards gained above statistical expectation (RYOE) in the given period, from NFL Next Gen Stats.
rushYardsOverExpectedPerAttdoubleAverage rushing yards over expected per attempt (RYOE/attempt), from NFL Next Gen Stats.

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_ngs_yac_oe​

nfl_ngs_yac_oe(seasons: 'Union[int, Sequence[int]]', *, min_receptions: 'int' = 10, return_as_pandas: 'bool' = False, _loader: 'Optional[Callable[..., pl.DataFrame]]' = None) -> 'Union[pl.DataFrame, pd.DataFrame]'

YAC over expected per receiver-season, stabilised with EB shrinkage.

yac_oe_raw is the NGS-shipped avg_yac_above_expectation passed through unchanged (per-reception yards after catch minus the NGS tracking-model expectation). yac_oe_shrunk applies per-season Efron-Morris empirical-Bayes shrinkage toward the reception-weighted league mean, weighted by receptions, so small-sample extremes are pulled in. The shrinkage prior is fit at call time on rows with receptions >= min_receptions — no bundled artifact.

Parameters

ParameterTypeDefaultDescription
seasonsUnion[int, Sequence[int]]Season(s) to compute, 2016+.
min_receptionsint10Qualification threshold for the prior fit and for receiving a yac_oe_rank. Defaults to sportsdataverse.nfl.nfl_ngs_constants.MIN_RECEPTIONS.
return_as_pandasboolFalseIf True, returns a pandas DataFrame.
_loaderOptional[Callable]NoneInjectable loader for offline tests.

Returns

One row per (season, player_gsis_id) with raw + shrunk YAC-OE, reliability in [0, 1], and a dense descending yac_oe_rank over qualified rows (null for unqualified rows). Empty input returns a zero-row frame with the documented schema.

col_nametypedescription
seasonintegerNFL season (YYYY).
player_gsis_idcharacterPlayer GSIS identifier (nflverse id, e.g. "00-0036223"), pinned Utf8.
player_display_namecharacterPlayer display name as shipped by NGS.
team_abbrcharacterTeam abbreviation.
positioncharacterPlayer position (from NGS player_position).
receptionsdoubleSeason reception count — the shrinkage weight.
avg_yacdoubleAverage yards after catch per reception.
avg_expected_yacdoubleNGS tracking-model expected YAC per reception.
yac_oe_rawdoubleNGS avg_yac_above_expectation passed through unchanged — per-reception YAC minus the tracking-model expectation.
yac_oe_shrunkdoubleyac_oe_raw after per-season empirical-Bayes shrinkage toward the reception-weighted league mean (sampling variance identified from weekly rows).
reliabilitydoubleShrinkage reliability tau2 / (tau2 + sigma2 / receptions) in [0, 1]; the fraction of the raw deviation retained.
yac_oe_rankintegerDense descending rank of yac_oe_shrunk within season over qualified rows; null when receptions < min_receptions.

Example

from sportsdataverse.nfl import nfl_ngs_yac_oe
df = nfl_ngs_yac_oe([2023])
print(df.sort("yac_oe_rank").head())

# Pandas output

df_pd = nfl_ngs_yac_oe(2023, return_as_pandas=True)

scrape_ngs_season​

scrape_ngs_season(stat_type: 'str', season: 'int', *, include_season_totals: 'bool' = True, return_as_pandas: 'bool' = False)

Scrape a full season of NGS statboard data, shaped like the nflverse parquet.

Port of nflverse ngs-data's R save_ngs_type: loop the regular-season weeks (1..max_reg where max_reg = 18 for season >= 2021 else 17) plus the playoff weeks (max_reg+1 .. max_reg+5, fetched with season_type="POST"), stack them diagonally, and -- when include_season_totals -- prepend the season-aggregate rows (NGS week=0, a REG call with no week param) tagged week=0. Duplicate rows (NGS returned dupes for some 2022 weeks) are de-duplicated on (season, week, player_gsis_id).

Output columns match the published nflverse NGS parquet read by sportsdataverse.nfl.load_nfl_nextgen_stats (snake_case, team_abbr resolved). It will not be byte-identical -- nflverse post-processes (column pruning / ordering) -- but the core metric columns and the player/team/week keys align.

NGS statboard rows are player-week aggregates, NOT per-play rows.

Parameters

ParameterTypeDefaultDescription
stat_typestrone of "passing", "rushing", "receiving".
seasonintseason year (NGS coverage starts in 2016).
include_season_totalsboolTruealso fetch the season-aggregate (week=0) rows. Defaults to True (matches ngs-data, whose week loop starts at 0).
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame stacking every week (and, by default, the season totals) for the requested stat_type and season. An EMPTY frame carrying the documented key schema if nothing is returned.

col_nametypedescription
aggressivenessdoublePercentage of pass attempts thrown into tight windows (defender within one yard of the receiver at completion or incompletion), from NFL Next Gen Stats. Passing only.
attemptsintegerPass attempts (including incompletions) recorded for the passer during the slice. Passing only.
avg_air_distancedoubleAverage air distance in yards on all pass attempts, measuring how far the ball travels through the air regardless of direction. Passing only.
avg_air_yards_differentialdoubleAverage difference between intended air yards and completed air yards, measuring accuracy relative to target depth. Passing only.
avg_air_yards_to_sticksdoubleAverage air yards relative to the first-down marker on pass attempts (positive = beyond the sticks). Passing only.
avg_completed_air_yardsdoubleAverage air yards on completed passes only, measuring depth of actual completions. Passing only.
avg_intended_air_yardsdoubleAverage depth of target on all pass attempts, regardless of completion. Passing/receiving.
avg_time_to_throwdoubleAverage time in seconds from snap to release for the passer, as tracked by NFL Next Gen Stats. Passing only.
completion_percentagedoubleActual completion percentage for the passer during the slice. Passing only.
completion_percentage_above_expectationdoubleCompletion percentage above the model-expected completion rate (CPOE/CPAE). Passing only.
completionsintegerCompleted passes for the passer during the slice. Passing only.
expected_completion_percentagedoubleModel-expected completion percentage based on target depth, separation, and coverage, from NFL Next Gen Stats. Passing only.
games_playedintegerNumber of games played by the player during the slice covered by the row.
interceptionsintegerInterceptions thrown by the passer during the slice. Passing only.
max_air_distancedoubleMaximum air distance in yards recorded on any single pass attempt during the slice. Passing only.
max_completed_air_distancedoubleMaximum air distance in yards recorded on any single completed pass during the slice. Passing only.
pass_touchdownsintegerPassing touchdowns thrown by the passer during the slice. Passing only.
pass_yardsintegerTotal passing yards accumulated by the passer during the slice. Passing only.
passer_ratingdoubleNFL passer rating (0–158.3 scale) for the passer during the slice. Passing only.
player_namecharacterDisplay name of the player as returned at the top-level statboard row.
seasonintegerNFL season year for the row.
season_typecharacterSeason segment for the row ('REG' for regular-season weeks and the week-0 aggregate, 'POST' for playoff weeks).
weekintegerNFL Next Gen Stats week tag; 0 is the season aggregate, 1..max_reg are regular-season weeks, and higher values are continuous playoff weeks.
positioncharacterPlayer position as returned at the top-level statboard row (e.g., 'QB', 'WR', 'RB').
team_idcharacterNFL Next Gen Stats team identifier for the player's team on this row; the key joined to resolve team_abbr.
player_seasonintegerNFL season year recorded in the nested player record.
player_season_typecharacterSeason segment recorded in the nested player record.
player_weekintegerWeek recorded in the nested player record (the loop week tag overrides this on the top-level week column).
player_jersey_numberintegerJersey number worn by the player.
player_last_namecharacterLast name of the player.
player_football_namecharacterFootball name used by the player, which may differ from the legal first name.
player_first_namecharacterFirst name of the player.
player_positioncharacterPlayer position from the nested player record.
player_gsis_it_idintegerNFL GSIS internal tracking integer identifier for the player.
player_gsis_idcharacterNFL GSIS (Game Statistics and Information System) identifier, the primary nflverse player key.
player_esb_idcharacterElias Sports Bureau (ESB) identifier for the player.
player_display_namecharacterFull display name of the player as used in NFL Next Gen Stats records.
player_short_namecharacterShortened display name for the player (e.g., 'P.Mahomes').
player_uniform_numbercharacterUniform number worn by the player, stored as a string to preserve leading zeros if applicable.
player_statuscharacterCurrent roster status of the player (e.g., 'ACT' for active, 'IR' for injured reserve).
player_current_team_idcharacterNFL Next Gen Stats team identifier for the team the player is currently rostered on.
player_smart_idcharacterNFL Next Gen Stats smart (UUID-style) identifier for the player.
player_headshotcharacterURL template for the player's headshot image.
player_position_groupcharacterBroad position group for the player (e.g., 'QB', 'WR') in the NGS player record.
player_ngs_positioncharacterPlayer's position as classified by the NFL Next Gen Stats system.
player_ngs_position_groupcharacterBroader position group the player belongs to as classified by the NFL Next Gen Stats system.
team_abbrcharacterTeam abbreviation resolved from team_id via the NGS team directory (relocated franchise abbreviations dropped to keep the mapping one-to-one).

Example

from sportsdataverse.nfl import scrape_ngs_season
pas = scrape_ngs_season("passing", 2023)
pas.select(["season", "week", "player_display_name", "team_abbr"]).head()

# Regular-season weeks only (skip the week-0 totals)

wk = scrape_ngs_season("receiving", 2023, include_season_totals=False)

# Column-compatible with the published parquet

from sportsdataverse.nfl import load_nfl_nextgen_stats
published = load_nfl_nextgen_stats(seasons=[2023], stat_type="passing")
shared = set(pas.columns) & set(published.columns)

scrape_ngs_week​

scrape_ngs_week(stat_type: 'str', season: 'int', week: 'int', season_type: 'str' = 'REG', *, return_as_pandas: 'bool' = False)

Scrape one (season, week) NGS statboard slice, shaped like the nflverse parquet.

Port of nflverse ngs-data's R load_week_ngs: fetch a single statboard slice via nfl_ngs_statboard, resolve team_abbr from the team directory, snake-case every column, and tag the row with the loop week. week=0 is the season-aggregate row (a season_type="REG" call with no week query param); weeks 1..max_reg are regular-season, and the playoff weeks (max_reg+1 upward) are fetched with season_type="POST".

NGS statboard rows are player-week aggregates (avg_intended_air_yards, completion_percentage_above_expectation, avg_time_to_throw, ...), NOT per-play rows -- this is a season-stats source, not a per-play air-yards / completion-probability source.

Parameters

ParameterTypeDefaultDescription
stat_typestrone of "passing", "rushing", "receiving".
seasonintseason year (NGS coverage starts in 2016).
weekintNGS week. 0 -> season aggregate; 1..max_reg -> REG; higher -> POST. The supplied value is what tags the returned rows.
season_typestr'REG'"REG" or "POST"; the caller (or scrape_ngs_season) selects this per week. Defaults to "REG".
return_as_pandasboolFalsereturn a pandas frame instead of polars.

Returns

A polars (or pandas) DataFrame of player-week NGS rows with snake-cased columns + a resolved team_abbr. An EMPTY frame carrying the documented key schema (not an exception) when the API yields no stats.

col_nametypedescription
aggressivenessdoublePercentage of pass attempts thrown into tight windows (defender within one yard of the receiver at completion or incompletion), from NFL Next Gen Stats. Passing only.
attemptsintegerPass attempts (including incompletions) recorded for the passer during the week. Passing only.
avg_air_distancedoubleAverage air distance in yards on all pass attempts, measuring how far the ball travels through the air regardless of direction. Passing only.
avg_air_yards_differentialdoubleAverage difference between intended air yards and completed air yards, measuring accuracy relative to target depth. Passing only.
avg_air_yards_to_sticksdoubleAverage air yards relative to the first-down marker on pass attempts (positive = beyond the sticks). Passing only.
avg_completed_air_yardsdoubleAverage air yards on completed passes only, measuring depth of actual completions. Passing only.
avg_intended_air_yardsdoubleAverage depth of target on all pass attempts, regardless of completion. Passing/receiving.
avg_time_to_throwdoubleAverage time in seconds from snap to release for the passer, as tracked by NFL Next Gen Stats. Passing only.
completion_percentagedoubleActual completion percentage for the passer during the week. Passing only.
completion_percentage_above_expectationdoubleCompletion percentage above the model-expected completion rate (CPOE/CPAE). Passing only.
completionsintegerCompleted passes for the passer during the week. Passing only.
expected_completion_percentagedoubleModel-expected completion percentage based on target depth, separation, and coverage, from NFL Next Gen Stats. Passing only.
games_playedintegerNumber of games played by the player during the slice covered by the row.
interceptionsintegerInterceptions thrown by the passer during the week. Passing only.
max_air_distancedoubleMaximum air distance in yards recorded on any single pass attempt during the week. Passing only.
max_completed_air_distancedoubleMaximum air distance in yards recorded on any single completed pass during the week. Passing only.
pass_touchdownsintegerPassing touchdowns thrown by the passer during the week. Passing only.
pass_yardsintegerTotal passing yards accumulated by the passer during the week. Passing only.
passer_ratingdoubleNFL passer rating (0–158.3 scale) for the passer during the week. Passing only.
player_namecharacterDisplay name of the player as returned at the top-level statboard row.
seasonintegerNFL season year for the row.
season_typecharacterSeason segment for the row ('REG' or 'POST') as supplied by the caller.
weekintegerNFL Next Gen Stats week tag supplied by the caller; 0 is the season aggregate, 1..max_reg are regular-season weeks, and higher values are continuous playoff weeks.
positioncharacterPlayer position as returned at the top-level statboard row (e.g., 'QB', 'WR', 'RB').
team_idcharacterNFL Next Gen Stats team identifier for the player's team on this row; the key joined to resolve team_abbr.
player_seasonintegerNFL season year recorded in the nested player record.
player_season_typecharacterSeason segment recorded in the nested player record.
player_weekintegerWeek recorded in the nested player record (the loop week tag overrides this on the top-level week column).
player_jersey_numberintegerJersey number worn by the player.
player_last_namecharacterLast name of the player.
player_football_namecharacterFootball name used by the player, which may differ from the legal first name.
player_first_namecharacterFirst name of the player.
player_positioncharacterPlayer position from the nested player record.
player_gsis_it_idintegerNFL GSIS internal tracking integer identifier for the player.
player_gsis_idcharacterNFL GSIS (Game Statistics and Information System) identifier, the primary nflverse player key.
player_esb_idcharacterElias Sports Bureau (ESB) identifier for the player.
player_display_namecharacterFull display name of the player as used in NFL Next Gen Stats records.
player_short_namecharacterShortened display name for the player (e.g., 'P.Mahomes').
player_uniform_numbercharacterUniform number worn by the player, stored as a string to preserve leading zeros if applicable.
player_statuscharacterCurrent roster status of the player (e.g., 'ACT' for active, 'IR' for injured reserve).
player_current_team_idcharacterNFL Next Gen Stats team identifier for the team the player is currently rostered on.
player_smart_idcharacterNFL Next Gen Stats smart (UUID-style) identifier for the player.
player_headshotcharacterURL template for the player's headshot image.
player_position_groupcharacterBroad position group for the player (e.g., 'QB', 'WR') in the NGS player record.
player_ngs_positioncharacterPlayer's position as classified by the NFL Next Gen Stats system.
player_ngs_position_groupcharacterBroader position group the player belongs to as classified by the NFL Next Gen Stats system.
team_abbrcharacterTeam abbreviation resolved from team_id via the NGS team directory (relocated franchise abbreviations dropped to keep the mapping one-to-one).

Example

from sportsdataverse.nfl import scrape_ngs_week
wk1 = scrape_ngs_week("passing", 2023, week=1)
wk1.select(["season", "week", "player_display_name", "team_abbr"]).head()

# Season-aggregate row (week 0)

tot = scrape_ngs_week("rushing", 2023, week=0)