Skip to main content

NFL — ESPN web API (v3)

sportsdataverse.nfl — 5 endpoints.

espn_nfl_player_overview​

ESPN endpoint.

Endpoint URL: GET https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/{athlete_id}/overview

Valid URL: https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/4239/overview

API ParameterPythonPatternRequiredNullableDescription
athlete_idathlete_idYathlete_id path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
athlete_idinteger
athlete_display_namecharacter
athlete_short_namecharacter
athlete_positioncharacter
athlete_jerseycharacter
athlete_team_idinteger
athlete_team_abbreviationcharacter
split_namecharacter
split_categorycharacter
games_playedcharacter
avg_minutescharacter
field_goal_pctcharacter
three_point_pctcharacter
free_throw_pctcharacter
avg_reboundscharacter
avg_assistscharacter
avg_blockscharacter
avg_stealscharacter
avg_foulscharacter
avg_turnoverscharacter
avg_pointscharacter

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

espn_nfl_player_overview(athlete_id='4239')

espn_nfl_player_stats_v3​

ESPN endpoint.

Endpoint URL: GET https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/{athlete_id}/stats

Valid URL: https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/3139477/stats

API ParameterPythonPatternRequiredNullableDescription
athlete_idathlete_idYathlete_id path parameter.
seasonseasonYSeason year (e.g. 2024).

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
categorycharacterESPN stat category the row belongs to (e.g., basketball "averages" / "totals" / "miscellaneous", NFL "passing", MLB "career-batting"). The stat columns after position are named from each category's own names list, so they differ by sport, and the other categories' columns are null on a row.
split_namecharacterSeason label of the row (e.g., "2010-11") on the Web v3 payload, or "Career" on the row built from the category's career totals; the split's name on payloads that ship named splits.
split_categorycharacterCategory of a named split; null on the Web v3 per-season rows.
split_valuecharacterValue of a named split; null on the Web v3 per-season rows.
seasonintegerSeason end year of the row (e.g., 2011 for 2010-11); null on the "Career" row.
team_idintegerESPN team id (Int64) the athlete played that season for; a traded player has one row per team. Null on the "Career" row.
positioncharacterPosition abbreviation the athlete was listed at for that season and team (e.g., "G"); null on the "Career" row.
games_playedcharacterGames played (GP), as ESPN ships it (a string).
completionscharacterPass completions (CMP).
passing_attemptscharacterPass attempts (ATT).
completion_pctcharacterCompletion percentage (CMP%).
passing_yardscharacterPassing yards (YDS).
yards_per_pass_attemptcharacterPassing yards per attempt (AVG).
passing_touchdownscharacterPassing touchdowns (TD).
interceptionscharacterPasses thrown that were intercepted (INT).
long_passingcharacterLongest completed pass in yards (LNG).
sackscharacterTimes sacked (SACK) on the passing line; a defender's sacks on the defensive line.
qb_ratingcharacterNFL passer rating (RTG).
adj_qbrcharacterESPN's adjusted Total QBR (QBR).
rushing_attemptscharacterRushing attempts (CAR).
rushing_yardscharacterRushing yards (YDS).
yards_per_rush_attemptcharacterRushing yards per attempt (AVG).
rushing_touchdownscharacterRushing touchdowns (TD).
long_rushingcharacterLongest run in yards (LNG).
rushing_first_downscharacterFirst downs gained by rushing (FD).
rushing_fumblescharacterFumbles on rushing plays (FUM).
rushing_fumbles_lostcharacterFumbles on rushing plays that the opponent recovered (LST).
receptionscharacterReceptions (REC).
receiving_targetscharacterTimes targeted by a pass (TGTS).
receiving_yardscharacterReceiving yards (YDS).
yards_per_receptioncharacterReceiving yards per reception (AVG).
receiving_touchdownscharacterReceiving touchdowns (TD).
long_receptioncharacterLongest reception in yards (LNG).
receiving_first_downscharacterFirst downs gained by reception (FD).
receiving_fumblescharacterFumbles after a reception (FUM).
receiving_fumbles_lostcharacterFumbles after a reception that the opponent recovered (LST).
total_tacklescharacterTotal tackles (TOT), solo plus assisted.
solo_tacklescharacterUnassisted tackles (SOLO).
assist_tacklescharacterAssisted tackles (AST).
fumbles_forcedcharacterForced fumbles (FF).
fumbles_recoveredcharacterFumbles recovered (FR).
fumbles_recovered_yardscharacterReturn yards after fumble recoveries (YDS).
interception_yardscharacterReturn yards after interceptions (YDS).
avg_interception_yardscharacterAverage return yards per interception (AVG).
interception_touchdownscharacterInterceptions returned for a touchdown (TD).
long_interceptioncharacterLongest interception return in yards (LNG).
passes_defendedcharacterPasses defended (PD).
stuffscharacterRunners stopped at or behind the line of scrimmage (STF).
stuff_yardscharacterYards lost on stuffs (STFYDS).
kicks_blockedcharacterKicks blocked (KB).
return_touchdownscharacterKick and punt return touchdowns (RET).
total_touchdownscharacterTouchdowns of every kind (TD).
total_two_point_convscharacterSuccessful two-point conversions (2PT).
kick_extra_pointscharacterKicked extra points made (PAT).
field_goalscharacterField goals made (FG).
total_pointscharacterPoints scored (PTS).

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

espn_nfl_player_stats_v3(athlete_id='3139477')

espn_nfl_player_gamelog​

ESPN endpoint.

Endpoint URL: GET https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/{athlete_id}/gamelog

Valid URL: https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/4239/gamelog

API ParameterPythonPatternRequiredNullableDescription
athlete_idathlete_idYathlete_id path parameter.
seasonseasonYSeason year (e.g. 2024).

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
season_type_idinteger
season_type_namecharacter
categorycharacterBroader category of player positions
event_idinteger
event_datecharacter
home_awaycharacter
scorecharacter
opponent_idinteger
opponent_abbreviationcharacter
opponent_display_namecharacter
game_resultcharacter
game_processedcharacter
stat_0character
stat_1character
stat_2character
stat_3character
stat_4character
stat_5character
stat_6character
stat_7character
stat_8character
stat_9character
stat_10character
stat_11character
stat_12character
stat_13character

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

espn_nfl_player_gamelog(athlete_id='4239')

espn_nfl_player_splits​

ESPN endpoint.

Endpoint URL: GET https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/{athlete_id}/splits

Valid URL: https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/4239/splits

API ParameterPythonPatternRequiredNullableDescription
athlete_idathlete_idYathlete_id path parameter.
seasonseasonYSeason year (e.g. 2024).

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
descriptionscharacter
display_namecharacterFull name of player
display_namescharacter
filterscharacter
labelscharacter
namescharacter
split_categoriescharacter

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

espn_nfl_player_splits(athlete_id='4239')

espn_nfl_leaders​

ESPN endpoint.

Endpoint URL: GET https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/statistics/byathlete

Valid URL: https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/statistics/byathlete?limit=50&page=1

API ParameterPythonPatternRequiredNullableDescription
categorycategoryYLeaderboard population: the athletes ranked in that category, whose values it fills (other categories come back null). Football takes <group>:<category> (offense:passing, offense:rushing, offense:receiving, defense:defensive, scoring:scoring); a bare passing is rejected with HTTP 400 (ValueError). Basketball takes the bare name (offensive).
seasonseasonYSeason year (e.g. 2024).
seasontypeseason_typeYSeason phase: 1=preseason, 2=regular season, 3=postseason.
limitlimitYMaximum number of items to return.
pagepageYpage query parameter.
sortsortYSort key <category>.<statName>:<asc|desc>, the names in the payload's categories (passing.passingYards:desc, offensive.avgPoints:desc). A stat without its category is rejected with HTTP 400 (ValueError).

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
sort_orderintegerPosition of the athlete in ESPN's leaderboard order (the requested category or sort), counted across pages: (page - 1) * limit + position on the page. A position, not a rank: tied athletes still count up; ESPN's per-stat ranks stay in the raw payload (return_parsed=False).
athlete_idintegerESPN id of the athlete, the key the athlete endpoints (athlete_overview, athlete_stats) take.
athlete_uidcharacterESPN composite athlete uid (s:<sport>~l:<league>~a:<athlete id>), kept as text.
athlete_display_namecharacterAthlete's full display name.
athlete_short_namecharacterAthlete's abbreviated name (e.g. 'B. Nix').
athlete_first_namecharacterAthlete's first name.
athlete_last_namecharacterAthlete's last name.
athlete_positioncharacterAthlete's position abbreviation (e.g. QB, G, C).
athlete_statuscharacterAthlete's ESPN status name (e.g. Active, Inactive) as ESPN reports it at request time, not for the requested season.
team_idintegerESPN id of the team the athlete played for in the requested season.
team_abbreviationcharacterAbbreviation of the athlete's team in the requested season (ESPN teamShortName, e.g. ORE).
team_namecharacterNickname of the athlete's team in the requested season (ESPN teamName, e.g. Ducks).
general_games_playeddoubleGames Played (ESPN 'general' category).
general_fumbles_forceddoubleForced Fumbles (ESPN 'general' category): The total number of forced fumbles.
general_fumbles_recovereddoubleFumbles Recovered (ESPN 'general' category): The number of fumbles recovered.
general_fumbles_touchdownsdoubleFumbles Touchdowns (ESPN 'general' category): The number of times a fumbles is recovered and returned for a touchdown.
passing_completionsdoubleCompletions (ESPN 'passing' category): The times a player completes a pass to another player who is eligible to catch a pass.
passing_passing_attemptsdoublePassing Attempts (ESPN 'passing' category): The number of times a pass is attempted.
passing_completion_pctdoubleCompletion Percentage (ESPN 'passing' category): The percentage of completed passes.
passing_passing_yardsdoublePassing Yards (ESPN 'passing' category): The total passing yards.
passing_yards_per_pass_attemptdoubleYards Per Pass Attempt (ESPN 'passing' category): The average number yards per pass attempt.
passing_passing_yards_per_gamedoublePassing Yards Per Game (ESPN 'passing' category): The number of passing yards per game.
passing_long_passingdoubleLongest Pass (ESPN 'passing' category): The longest pass play completed in terms of yards.
passing_passing_touchdownsdoublePassing Touchdowns (ESPN 'passing' category): The total number of passing touchdowns.
passing_interceptionsdoubleInterceptions (ESPN 'passing' category): The number of passes thrown that were intercepted by the opposing team.
passing_sacksdoubleTotal Sacks (ESPN 'passing' category): The total number of sacks.
passing_sack_yards_lostdoubleSack Yards Lost (ESPN 'passing' category): The amount of yards lost due to sacks.
passing_qbrdoubleTotal QBR (ESPN 'passing' category): Total Quarterback Rating, which values quarterback on all play types on a 0-to-100 scale.
passing_qb_ratingdoublePasser Rating (ESPN 'passing' category).
passing_adj_qbrdoubleAdjusted QBR (ESPN 'passing' category): Adjusted Quarterback Rating.
rushing_rushing_attemptsdoubleRushing Attempts (ESPN 'rushing' category): The total number of attempted rushes.
rushing_rushing_yardsdoubleRushing Yards (ESPN 'rushing' category): The total rushing yards.
rushing_yards_per_rush_attemptdoubleYards Per Rush Attempt (ESPN 'rushing' category): The average number of yards per rush attempt.
rushing_long_rushingdoubleLong Rushing (ESPN 'rushing' category): The amount of yards for the longest run.
rushing_rushing_big_playsdouble20+ Yard Rushing Plays (ESPN 'rushing' category): The number of rushing big plays gained.
rushing_rushing_touchdownsdoubleRushing Touchdowns (ESPN 'rushing' category): The total number of rushing touchdowns.
rushing_rushing_yards_per_gamedoubleRushing Yards Per Game (ESPN 'rushing' category): The average number of rushing yards per game.
rushing_rushing_fumblesdoubleRushing Fumbles (ESPN 'rushing' category): The number of times there is a run and then the ball is fumbled.
rushing_rushing_fumbles_lostdoubleRushing Fumbles Lost (ESPN 'rushing' category): The number of times there is a run and then the ball is fumbled.
rushing_rushing_first_downsdoubleRushing 1st downs (ESPN 'rushing' category): The number of times a first down is picked up by a run.
receiving_receptionsdoubleReceptions (ESPN 'receiving' category): The total number of receptions.
receiving_receiving_targetsdoubleReceiving Targets (ESPN 'receiving' category): The number of times a receiver is thrown to.
receiving_receiving_yardsdoubleReceiving Yards (ESPN 'receiving' category): The total receiving yards.
receiving_yards_per_receptiondoubleYards Per Reception (ESPN 'receiving' category): The average number of yards per reception.
receiving_receiving_touchdownsdoubleReceiving Touchdowns (ESPN 'receiving' category): The total number of receiving touchdowns.
receiving_long_receptiondoubleLong Reception (ESPN 'receiving' category): The amount of yards for the longest reception.
receiving_receiving_big_playsdouble20+ Yard Receiving Plays (ESPN 'receiving' category): The number of receiving big plays gained.
receiving_receiving_yards_per_gamedoubleReceiving Yards Per Game (ESPN 'receiving' category): The average number of receiving yards per game.
receiving_receiving_fumblesdoubleReceiving Fumbles (ESPN 'receiving' category): The number of times a reception is made and then the ball is fumbled.
receiving_receiving_fumbles_lostdoubleReceiving Fumbles Lost (ESPN 'receiving' category): The number of times a reception is made and the balled is fumbled and recovered by the opposing team.
receiving_receiving_yards_after_catchdoubleReceiving Yards After Catch (ESPN 'receiving' category): The number of yards gained after the catch has been made.
receiving_receiving_first_downsdoubleReceiving First Downs (ESPN 'receiving' category): The number of times a first down is picked up by a reception.
defensive_solo_tacklesdoubleSolo Tackles (ESPN 'defensive' category): The number of times a tackle was made unassisted.
defensive_assist_tacklesdoubleAssist Tackles (ESPN 'defensive' category): The number of assists on tackles.
defensive_total_tacklesdoubleTotal Tackles (ESPN 'defensive' category): The total number of tackles.
defensive_sacksdoubleSacks (ESPN 'defensive' category): The total number of sacks.
defensive_sack_yardsdoubleSack Yards (ESPN 'defensive' category): The number of yards lost from sacks.
defensive_tackles_for_lossdoubleTackles For Loss (ESPN 'defensive' category): The number of tackles that result in a loss of yardage.
defensive_passes_defendeddoublePasses Defended (ESPN 'defensive' category): The total number of passes defended.
defensive_long_interceptiondoubleLong Interception (ESPN 'defensive' category): The amount of yards of the longest interception return.
defensiveinterceptions_interceptionsdoubleInterceptions (ESPN 'defensiveinterceptions' category): The total number of interceptions.
defensiveinterceptions_interception_yardsdoubleInterception Yards (ESPN 'defensiveinterceptions' category): The number of yards gained after an interception.
defensiveinterceptions_interception_touchdownsdoubleInterception Touchdowns (ESPN 'defensiveinterceptions' category): The number of times an interception is returned for a touchdown.
scoring_rushing_touchdownsdoubleRushing Touchdowns (ESPN 'scoring' category): The total number of rushing touchdowns.
scoring_receiving_touchdownsdoubleReceiving Touchdowns (ESPN 'scoring' category): The total number of receiving touchdowns.
scoring_return_touchdownsdoubleReturn Touchdowns (ESPN 'scoring' category): The total number of return touchdowns.
scoring_total_touchdownsdoubleTotal Touchdowns (ESPN 'scoring' category): The number of touchdowns scored in total.
scoring_field_goalsdoubleField Goals (ESPN 'scoring' category): The number of field goals made.
scoring_kick_extra_pointsdoubleKick Extra Points (ESPN 'scoring' category): The number of extra points made.
scoring_total_two_point_convsdoubleTotal Two Point Conversions (ESPN 'scoring' category): The number of times a 2-point conversion is successful.
scoring_total_pointsdoubleTotal Points (ESPN 'scoring' category): The number of total points scored.
scoring_total_points_per_gamedoubleTotal Points Per Game (ESPN 'scoring' category): The number of points scored per game.
returning_kick_returnsdoubleKick Returns (ESPN 'returning' category): The number of kick returns.
returning_kick_return_yardsdoubleKick Return Yards (ESPN 'returning' category): The total yardage of kick returns.
returning_yards_per_kick_returndoubleYards Per Kick Return (ESPN 'returning' category): The average number of yards per kick return.
returning_long_kick_returndoubleLong Kick Return (ESPN 'returning' category): The longest kick return in yards.
returning_kick_return_touchdownsdoubleKick Return Touchdowns (ESPN 'returning' category): The number of kick return touchdowns.
returning_punt_returnsdoublePunt Returns (ESPN 'returning' category): The number of punt returns.
returning_punt_return_yardsdoublePunt Return Yards (ESPN 'returning' category): The total yardage of punt returns.
returning_yards_per_punt_returndoubleYards Per Punt Return (ESPN 'returning' category): The average number of yards per punt return.
returning_long_punt_returndoubleLong Punt Return (ESPN 'returning' category): The longest punt return in yards.
returning_punt_return_touchdownsdoublePunt Return Touchdowns (ESPN 'returning' category): The number of punt return touchdowns.
returning_punt_return_fair_catchesdoublePunt Return Fair Catches (ESPN 'returning' category): The number of punt return fair catches.
kicking_field_goals_madedoubleField Goal Made (ESPN 'kicking' category): The number of times a field goal is made.
kicking_field_goal_attemptsdoubleField Goal Attempts (ESPN 'kicking' category): The number of times a field goal is attempted.
kicking_field_goal_pctdoubleField Goal Percentage (ESPN 'kicking' category): The percentage of field goals attempted that are made.
kicking_long_field_goal_madedoubleLong Field Goal Made (ESPN 'kicking' category): The distance of the longest field goal made.
kicking_field_goals_made1_19doubleField Goals Made 1-19 (ESPN 'kicking' category): The number of field goals made from 1-19 yards.
kicking_field_goals_made20_29doubleField Goals Made 20-29 (ESPN 'kicking' category): The number of field goals made from 20-29 yards.
kicking_field_goals_made30_39doubleField Goals Made 30-39 (ESPN 'kicking' category): The number of field goals made from 30-39 yards.
kicking_field_goals_made40_49doubleField Goals Made 40-49 (ESPN 'kicking' category): The number of field goals made from 40-49 yards.
kicking_field_goals_made50doubleField Goals Made 50+ (ESPN 'kicking' category): The number of field goals made from 50+ yards.
kicking_field_goal_attempts1_19doubleField Goal Attempts 1-19 (ESPN 'kicking' category): The number of field goals attempted from 1-19 yards.
kicking_field_goal_attempts20_29doubleField Goal Attempts 20-29 (ESPN 'kicking' category): The number of field goals attempted from 20-29 yards.
kicking_field_goal_attempts30_39doubleField Goal Attempts 30-39 (ESPN 'kicking' category): The number of field goals attempted from 30-39 yards.
kicking_field_goal_attempts40_49doubleField Goal Attempts 40-49 (ESPN 'kicking' category): The number of field goals attempted from 40-49 yards.
kicking_field_goal_attempts50doubleField Goal Attempts 50+ (ESPN 'kicking' category): The number of field goals attempted from 50+ yards.
kicking_extra_points_madedoubleExtra Points Made (ESPN 'kicking' category): The number of extra point attempts made.
kicking_extra_point_attemptsdoubleExtra Point Attempts (ESPN 'kicking' category): The number of extra point attempts.
kicking_extra_point_pctdoubleExtra Point Percentage (ESPN 'kicking' category): The percentage of extra point attempts that are converted.
punting_puntsdoublePunts (ESPN 'punting' category): The number of punts taken.
punting_punt_yardsdoublePunt Yards (ESPN 'punting' category): The total amount of yardage of punts.
punting_long_puntdoubleLong Punt (ESPN 'punting' category): The distance of the longest punt.
punting_gross_avg_punt_yardsdoubleGross Average Punt Yards (ESPN 'punting' category): The average gross number of yards per punt.
punting_net_avg_punt_yardsdoubleNet Average Punt Yards (ESPN 'punting' category): The average net number of yards per punt.
punting_punts_blockeddoublePunts Blocked (ESPN 'punting' category): The number of times a punt was blocked.
punting_punts_inside20doublePunts Inside 20 (ESPN 'punting' category): The number of times a punt is downed inside the 20.
punting_touchbacksdoubleTouchbacks (ESPN 'punting' category): The number of kickoffs that result in touchbacks.
punting_fair_catchesdoubleFair Catches (ESPN 'punting' category): The number of fair catches.
punting_punt_returnsdoublePunt Returns (ESPN 'punting' category): The number of times a punt was returned.
punting_punt_return_yardsdoublePunt Return Yards (ESPN 'punting' category): The total amount of yardage of punt returns.
punting_avg_punt_return_yardsdoubleAverage Punt Return Yards (ESPN 'punting' category): The average number of yards per punt return.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

espn_nfl_leaders()