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_idInt64
athlete_display_nameString
athlete_short_nameString
athlete_positionString
athlete_jerseyString
athlete_team_idInt64
athlete_team_abbreviationString
split_nameString
split_categoryString
games_playedString
avg_minutesString
field_goal_pctString
three_point_pctString
free_throw_pctString
avg_reboundsString
avg_assistsString
avg_blocksString
avg_stealsString
avg_foulsString
avg_turnoversString
avg_pointsString

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
categoryStringESPN 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_nameStringSeason 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_categoryStringCategory of a named split; null on the Web v3 per-season rows.
split_valueStringValue of a named split; null on the Web v3 per-season rows.
seasonInt64Season end year of the row (e.g., 2011 for 2010-11); null on the "Career" row.
team_idInt64ESPN team id (Int64) the athlete played that season for; a traded player has one row per team. Null on the "Career" row.
positionStringPosition abbreviation the athlete was listed at for that season and team (e.g., "G"); null on the "Career" row.
games_playedStringGames played (GP), as ESPN ships it (a string).
completionsStringPass completions (CMP).
passing_attemptsStringPass attempts (ATT).
completion_pctStringCompletion percentage (CMP%).
passing_yardsStringPassing yards (YDS).
yards_per_pass_attemptStringPassing yards per attempt (AVG).
passing_touchdownsStringPassing touchdowns (TD).
interceptionsStringPasses thrown that were intercepted (INT).
long_passingStringLongest completed pass in yards (LNG).
sacksStringTimes sacked (SACK) on the passing line; a defender's sacks on the defensive line.
qb_ratingStringNFL passer rating (RTG).
adj_qbrStringESPN's adjusted Total QBR (QBR).
rushing_attemptsStringRushing attempts (CAR).
rushing_yardsStringRushing yards (YDS).
yards_per_rush_attemptStringRushing yards per attempt (AVG).
rushing_touchdownsStringRushing touchdowns (TD).
long_rushingStringLongest run in yards (LNG).
rushing_first_downsStringFirst downs gained by rushing (FD).
rushing_fumblesStringFumbles on rushing plays (FUM).
rushing_fumbles_lostStringFumbles on rushing plays that the opponent recovered (LST).
receptionsStringReceptions (REC).
receiving_targetsStringTimes targeted by a pass (TGTS).
receiving_yardsStringReceiving yards (YDS).
yards_per_receptionStringReceiving yards per reception (AVG).
receiving_touchdownsStringReceiving touchdowns (TD).
long_receptionStringLongest reception in yards (LNG).
receiving_first_downsStringFirst downs gained by reception (FD).
receiving_fumblesStringFumbles after a reception (FUM).
receiving_fumbles_lostStringFumbles after a reception that the opponent recovered (LST).
total_tacklesStringTotal tackles (TOT), solo plus assisted.
solo_tacklesStringUnassisted tackles (SOLO).
assist_tacklesStringAssisted tackles (AST).
fumbles_forcedStringForced fumbles (FF).
fumbles_recoveredStringFumbles recovered (FR).
fumbles_recovered_yardsStringReturn yards after fumble recoveries (YDS).
interception_yardsStringReturn yards after interceptions (YDS).
avg_interception_yardsStringAverage return yards per interception (AVG).
interception_touchdownsStringInterceptions returned for a touchdown (TD).
long_interceptionStringLongest interception return in yards (LNG).
passes_defendedStringPasses defended (PD).
stuffsStringRunners stopped at or behind the line of scrimmage (STF).
stuff_yardsStringYards lost on stuffs (STFYDS).
kicks_blockedStringKicks blocked (KB).
return_touchdownsStringKick and punt return touchdowns (RET).
total_touchdownsStringTouchdowns of every kind (TD).
total_two_point_convsStringSuccessful two-point conversions (2PT).
kick_extra_pointsStringKicked extra points made (PAT).
field_goalsStringField goals made (FG).
total_pointsStringPoints 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_idInt64
season_type_nameString
categoryStringBroader category of player positions
event_idInt64
event_dateString
home_awayString
scoreString
opponent_idInt64
opponent_abbreviationString
opponent_display_nameString
game_resultString
game_processedString
stat_0String
stat_1String
stat_2String
stat_3String
stat_4String
stat_5String
stat_6String
stat_7String
stat_8String
stat_9String
stat_10String
stat_11String
stat_12String
stat_13String

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
descriptionsString
display_nameStringFull name of player
display_namesString
filtersString
labelsString
namesString
split_categoriesString

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_orderInt64Position 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_idInt64ESPN id of the athlete, the key the athlete endpoints (athlete_overview, athlete_stats) take.
athlete_uidStringESPN composite athlete uid (s:<sport>~l:<league>~a:<athlete id>), kept as text.
athlete_display_nameStringAthlete's full display name.
athlete_short_nameStringAthlete's abbreviated name (e.g. 'B. Nix').
athlete_first_nameStringAthlete's first name.
athlete_last_nameStringAthlete's last name.
athlete_positionStringAthlete's position abbreviation (e.g. QB, G, C).
athlete_statusStringAthlete's ESPN status name (e.g. Active, Inactive) as ESPN reports it at request time, not for the requested season.
team_idInt64ESPN id of the team the athlete played for in the requested season.
team_abbreviationStringAbbreviation of the athlete's team in the requested season (ESPN teamShortName, e.g. ORE).
team_nameStringNickname of the athlete's team in the requested season (ESPN teamName, e.g. Ducks).
general_games_playedFloat64Games Played (ESPN 'general' category).
general_fumbles_forcedFloat64Forced Fumbles (ESPN 'general' category): The total number of forced fumbles.
general_fumbles_recoveredFloat64Fumbles Recovered (ESPN 'general' category): The number of fumbles recovered.
general_fumbles_touchdownsFloat64Fumbles Touchdowns (ESPN 'general' category): The number of times a fumbles is recovered and returned for a touchdown.
passing_completionsFloat64Completions (ESPN 'passing' category): The times a player completes a pass to another player who is eligible to catch a pass.
passing_passing_attemptsFloat64Passing Attempts (ESPN 'passing' category): The number of times a pass is attempted.
passing_completion_pctFloat64Completion Percentage (ESPN 'passing' category): The percentage of completed passes.
passing_passing_yardsFloat64Passing Yards (ESPN 'passing' category): The total passing yards.
passing_yards_per_pass_attemptFloat64Yards Per Pass Attempt (ESPN 'passing' category): The average number yards per pass attempt.
passing_passing_yards_per_gameFloat64Passing Yards Per Game (ESPN 'passing' category): The number of passing yards per game.
passing_long_passingFloat64Longest Pass (ESPN 'passing' category): The longest pass play completed in terms of yards.
passing_passing_touchdownsFloat64Passing Touchdowns (ESPN 'passing' category): The total number of passing touchdowns.
passing_interceptionsFloat64Interceptions (ESPN 'passing' category): The number of passes thrown that were intercepted by the opposing team.
passing_sacksFloat64Total Sacks (ESPN 'passing' category): The total number of sacks.
passing_sack_yards_lostFloat64Sack Yards Lost (ESPN 'passing' category): The amount of yards lost due to sacks.
passing_qbrFloat64Total QBR (ESPN 'passing' category): Total Quarterback Rating, which values quarterback on all play types on a 0-to-100 scale.
passing_qb_ratingFloat64Passer Rating (ESPN 'passing' category).
passing_adj_qbrFloat64Adjusted QBR (ESPN 'passing' category): Adjusted Quarterback Rating.
rushing_rushing_attemptsFloat64Rushing Attempts (ESPN 'rushing' category): The total number of attempted rushes.
rushing_rushing_yardsFloat64Rushing Yards (ESPN 'rushing' category): The total rushing yards.
rushing_yards_per_rush_attemptFloat64Yards Per Rush Attempt (ESPN 'rushing' category): The average number of yards per rush attempt.
rushing_long_rushingFloat64Long Rushing (ESPN 'rushing' category): The amount of yards for the longest run.
rushing_rushing_big_playsFloat6420+ Yard Rushing Plays (ESPN 'rushing' category): The number of rushing big plays gained.
rushing_rushing_touchdownsFloat64Rushing Touchdowns (ESPN 'rushing' category): The total number of rushing touchdowns.
rushing_rushing_yards_per_gameFloat64Rushing Yards Per Game (ESPN 'rushing' category): The average number of rushing yards per game.
rushing_rushing_fumblesFloat64Rushing Fumbles (ESPN 'rushing' category): The number of times there is a run and then the ball is fumbled.
rushing_rushing_fumbles_lostFloat64Rushing Fumbles Lost (ESPN 'rushing' category): The number of times there is a run and then the ball is fumbled.
rushing_rushing_first_downsFloat64Rushing 1st downs (ESPN 'rushing' category): The number of times a first down is picked up by a run.
receiving_receptionsFloat64Receptions (ESPN 'receiving' category): The total number of receptions.
receiving_receiving_targetsFloat64Receiving Targets (ESPN 'receiving' category): The number of times a receiver is thrown to.
receiving_receiving_yardsFloat64Receiving Yards (ESPN 'receiving' category): The total receiving yards.
receiving_yards_per_receptionFloat64Yards Per Reception (ESPN 'receiving' category): The average number of yards per reception.
receiving_receiving_touchdownsFloat64Receiving Touchdowns (ESPN 'receiving' category): The total number of receiving touchdowns.
receiving_long_receptionFloat64Long Reception (ESPN 'receiving' category): The amount of yards for the longest reception.
receiving_receiving_big_playsFloat6420+ Yard Receiving Plays (ESPN 'receiving' category): The number of receiving big plays gained.
receiving_receiving_yards_per_gameFloat64Receiving Yards Per Game (ESPN 'receiving' category): The average number of receiving yards per game.
receiving_receiving_fumblesFloat64Receiving Fumbles (ESPN 'receiving' category): The number of times a reception is made and then the ball is fumbled.
receiving_receiving_fumbles_lostFloat64Receiving 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_catchFloat64Receiving Yards After Catch (ESPN 'receiving' category): The number of yards gained after the catch has been made.
receiving_receiving_first_downsFloat64Receiving First Downs (ESPN 'receiving' category): The number of times a first down is picked up by a reception.
defensive_solo_tacklesFloat64Solo Tackles (ESPN 'defensive' category): The number of times a tackle was made unassisted.
defensive_assist_tacklesFloat64Assist Tackles (ESPN 'defensive' category): The number of assists on tackles.
defensive_total_tacklesFloat64Total Tackles (ESPN 'defensive' category): The total number of tackles.
defensive_sacksFloat64Sacks (ESPN 'defensive' category): The total number of sacks.
defensive_sack_yardsFloat64Sack Yards (ESPN 'defensive' category): The number of yards lost from sacks.
defensive_tackles_for_lossFloat64Tackles For Loss (ESPN 'defensive' category): The number of tackles that result in a loss of yardage.
defensive_passes_defendedFloat64Passes Defended (ESPN 'defensive' category): The total number of passes defended.
defensive_long_interceptionFloat64Long Interception (ESPN 'defensive' category): The amount of yards of the longest interception return.
defensiveinterceptions_interceptionsFloat64Interceptions (ESPN 'defensiveinterceptions' category): The total number of interceptions.
defensiveinterceptions_interception_yardsFloat64Interception Yards (ESPN 'defensiveinterceptions' category): The number of yards gained after an interception.
defensiveinterceptions_interception_touchdownsFloat64Interception Touchdowns (ESPN 'defensiveinterceptions' category): The number of times an interception is returned for a touchdown.
scoring_rushing_touchdownsFloat64Rushing Touchdowns (ESPN 'scoring' category): The total number of rushing touchdowns.
scoring_receiving_touchdownsFloat64Receiving Touchdowns (ESPN 'scoring' category): The total number of receiving touchdowns.
scoring_return_touchdownsFloat64Return Touchdowns (ESPN 'scoring' category): The total number of return touchdowns.
scoring_total_touchdownsFloat64Total Touchdowns (ESPN 'scoring' category): The number of touchdowns scored in total.
scoring_field_goalsFloat64Field Goals (ESPN 'scoring' category): The number of field goals made.
scoring_kick_extra_pointsFloat64Kick Extra Points (ESPN 'scoring' category): The number of extra points made.
scoring_total_two_point_convsFloat64Total Two Point Conversions (ESPN 'scoring' category): The number of times a 2-point conversion is successful.
scoring_total_pointsFloat64Total Points (ESPN 'scoring' category): The number of total points scored.
scoring_total_points_per_gameFloat64Total Points Per Game (ESPN 'scoring' category): The number of points scored per game.
returning_kick_returnsFloat64Kick Returns (ESPN 'returning' category): The number of kick returns.
returning_kick_return_yardsFloat64Kick Return Yards (ESPN 'returning' category): The total yardage of kick returns.
returning_yards_per_kick_returnFloat64Yards Per Kick Return (ESPN 'returning' category): The average number of yards per kick return.
returning_long_kick_returnFloat64Long Kick Return (ESPN 'returning' category): The longest kick return in yards.
returning_kick_return_touchdownsFloat64Kick Return Touchdowns (ESPN 'returning' category): The number of kick return touchdowns.
returning_punt_returnsFloat64Punt Returns (ESPN 'returning' category): The number of punt returns.
returning_punt_return_yardsFloat64Punt Return Yards (ESPN 'returning' category): The total yardage of punt returns.
returning_yards_per_punt_returnFloat64Yards Per Punt Return (ESPN 'returning' category): The average number of yards per punt return.
returning_long_punt_returnFloat64Long Punt Return (ESPN 'returning' category): The longest punt return in yards.
returning_punt_return_touchdownsFloat64Punt Return Touchdowns (ESPN 'returning' category): The number of punt return touchdowns.
returning_punt_return_fair_catchesFloat64Punt Return Fair Catches (ESPN 'returning' category): The number of punt return fair catches.
kicking_field_goals_madeFloat64Field Goal Made (ESPN 'kicking' category): The number of times a field goal is made.
kicking_field_goal_attemptsFloat64Field Goal Attempts (ESPN 'kicking' category): The number of times a field goal is attempted.
kicking_field_goal_pctFloat64Field Goal Percentage (ESPN 'kicking' category): The percentage of field goals attempted that are made.
kicking_long_field_goal_madeFloat64Long Field Goal Made (ESPN 'kicking' category): The distance of the longest field goal made.
kicking_field_goals_made1_19Float64Field Goals Made 1-19 (ESPN 'kicking' category): The number of field goals made from 1-19 yards.
kicking_field_goals_made20_29Float64Field Goals Made 20-29 (ESPN 'kicking' category): The number of field goals made from 20-29 yards.
kicking_field_goals_made30_39Float64Field Goals Made 30-39 (ESPN 'kicking' category): The number of field goals made from 30-39 yards.
kicking_field_goals_made40_49Float64Field Goals Made 40-49 (ESPN 'kicking' category): The number of field goals made from 40-49 yards.
kicking_field_goals_made50Float64Field Goals Made 50+ (ESPN 'kicking' category): The number of field goals made from 50+ yards.
kicking_field_goal_attempts1_19Float64Field Goal Attempts 1-19 (ESPN 'kicking' category): The number of field goals attempted from 1-19 yards.
kicking_field_goal_attempts20_29Float64Field Goal Attempts 20-29 (ESPN 'kicking' category): The number of field goals attempted from 20-29 yards.
kicking_field_goal_attempts30_39Float64Field Goal Attempts 30-39 (ESPN 'kicking' category): The number of field goals attempted from 30-39 yards.
kicking_field_goal_attempts40_49Float64Field Goal Attempts 40-49 (ESPN 'kicking' category): The number of field goals attempted from 40-49 yards.
kicking_field_goal_attempts50Float64Field Goal Attempts 50+ (ESPN 'kicking' category): The number of field goals attempted from 50+ yards.
kicking_extra_points_madeFloat64Extra Points Made (ESPN 'kicking' category): The number of extra point attempts made.
kicking_extra_point_attemptsFloat64Extra Point Attempts (ESPN 'kicking' category): The number of extra point attempts.
kicking_extra_point_pctFloat64Extra Point Percentage (ESPN 'kicking' category): The percentage of extra point attempts that are converted.
punting_puntsFloat64Punts (ESPN 'punting' category): The number of punts taken.
punting_punt_yardsFloat64Punt Yards (ESPN 'punting' category): The total amount of yardage of punts.
punting_long_puntFloat64Long Punt (ESPN 'punting' category): The distance of the longest punt.
punting_gross_avg_punt_yardsFloat64Gross Average Punt Yards (ESPN 'punting' category): The average gross number of yards per punt.
punting_net_avg_punt_yardsFloat64Net Average Punt Yards (ESPN 'punting' category): The average net number of yards per punt.
punting_punts_blockedFloat64Punts Blocked (ESPN 'punting' category): The number of times a punt was blocked.
punting_punts_inside20Float64Punts Inside 20 (ESPN 'punting' category): The number of times a punt is downed inside the 20.
punting_touchbacksFloat64Touchbacks (ESPN 'punting' category): The number of kickoffs that result in touchbacks.
punting_fair_catchesFloat64Fair Catches (ESPN 'punting' category): The number of fair catches.
punting_punt_returnsFloat64Punt Returns (ESPN 'punting' category): The number of times a punt was returned.
punting_punt_return_yardsFloat64Punt Return Yards (ESPN 'punting' category): The total amount of yardage of punt returns.
punting_avg_punt_return_yardsFloat64Average 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()