Skip to content

Instantly share code, notes, and snippets.

@nntrn
Last active September 15, 2024 00:50
Show Gist options
  • Save nntrn/ee26cb2a0716de0947a0a4e9a157bc1c to your computer and use it in GitHub Desktop.
Save nntrn/ee26cb2a0716de0947a0a4e9a157bc1c to your computer and use it in GitHub Desktop.
List of nfl api endpoints from espn

ESPN API NFL ENDPOINTS

This page is limited to NFL endpoints but can be refashioned for other leagues (i.e. /sports/football/leagues/nfl/ => /sports/baseball/leagues/mlb/)

Parameters

Name Description
season Integer year in which the season started (YYYY)
seasontype 1=pre, 2=regular, 3=post
league_id league Id from
bet_provider_id view under odds

NFL Endpoints

Base URL: sports.core.api.espn.com

NFL TEAMS

Fantasy

Current season and last 3 years

fantasy.espn.com/apis/v3/games/ffl/seasons/:season/segments/0/leagues/:league_id

League History - get all historical data

fantasy.espn.com/apis/v3/games/ffl/leagueHistory/:league_id?seasonId=:season


Detailed API

Leagues: sports.core.api.espn.com/v2/sports/football/leagues/nfl

Athletes: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/athletes/:athlete_id

Teams: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/teams

Team: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/teams/:team_id

Plays: sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/:game_id/competitions/:game_id/plays?limit=300

Depth charts: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/teams/:team_id/depthcharts

Whitelist dates: sports.core.api.espn.com/v2/sports/football/leagues/nfl/calendar/whitelist

Season: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season

Week: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/2020/types/:season_type/weeks/:week

All weeks sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/types/:season_type/weeks

List of games via date-range: site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard?limit=1000&dates=20200901-20210228

  • add &1577413600 at the end for overriding the cache
  • date range cannot exceed 13 months
  • format for date can be full date or year
    • YYYYMMDD,
    • YYYY

Odds

bet_provider_id:

  • 38=Caesars
  • 31=William Hill
  • 41=SugarHouse
  • 36=Unibet
  • 2000=Bet 365
  • 25=Westgate
  • 45=William Hill (NJ)
  • 1001=accuscore
  • 1004=consensus
  • 1003=numberfire
  • 1002=teamrankings

Win probabilities sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/:game_id/competitions/:game_id/probabilities?limit=200

Odds: sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/:game_id/competitions/:game_id/odds

Against-the-spread: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/types/2/teams/:team_id/ats

Futures: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/futures

Head-to-head (game): sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/:game_id/competitions/:game_id/odds/:bet_provider_id/head-to-heads

Odds records: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/types/0/teams/:team_id/odds-records

Odds history - Game: sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/401249063/competitions/401249063/odds/:bet_provider_id/history/0/movement?limit=100

Odds history - Team: sports.core.api.espn.com/v2/sports/football/leagues/nfl/teams/:team_id/odds/:bet_provider_id/past-performances?limit=200

Stats

Positions (enum): sports.core.api.espn.com/v2/sports/football/leagues/nfl/positions?limit=100

QBR Weekly/Game stats: sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/types/2/weeks/:week_num/qbr/10000

Athlete

all active athletes: sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes?active=true

site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/:athlete_id

site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/:athlete_id/splits?season=2020

site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/:athlete_id/gamelog

site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/:athlete_id/stats

site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/:athlete_id/bio

site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/:athlete_id/overview

sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/types/2/athletes/:athlete_id/statistics

sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/2020/types/2/athletes/:athlete_id/projections

sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/:game_id/competitions/:game_id/competitors/:team_id/roster/:athlete_id/statistics/0

Team

site.api.espn.com/apis/site/v2/sports/football/nfl/teams

site.api.espn.com/apis/site/v2/sports/football/nfl/teams/:team_id

site.api.espn.com/apis/site/v2/sports/football/nfl/teams/:team_id/roster

site.api.espn.com/apis/site/v2/sports/football/nfl/teams/:team_id/schedule{?season,seasontype}

sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/2020/types/2/teams/:team_id/statistics

sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/2020/teams/:team_id/projection

sports.core.api.espn.com/v2/sports/football/leagues/nfl/teams/:team_id/odds/1002/past-performances?limit=140

sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/:game_id/competitions/:game_id/competitors/:team_id/roster?season=YYYY

site.api.espn.com/apis/site/v2/sports/football/nfl/teams/3?enable=roster

sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/teams/:team_id/projection

sports.core.api.espn.com/v2/sports/football/leagues/nfl/teams/:team_id/odds/:bet_provider_id/past-performances?limit=200

Leaders

site.api.espn.com/apis/site/v3/sports/football/nfl/leaders{?season,seasontype}

Scoreboard

site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard{?dates=YYYYMMDD}

Search

site.web.api.espn.com/apis/common/v3/search?region=us&lang=en&query=nfl&limit=5&mode=prefix

site.web.api.espn.com/apis/common/v3/search

site.web.api.espn.com/apis/fantasy/v2/games/ffl/games?dates={YYYYMMDD}-{YYYYMMDD}&pbpOnly=true

News

site.api.espn.com/apis/site/v2/sports/football/nfl/news

Header

site.web.api.espn.com/apis/v2/scoreboard/header?sport=football&league=nfl

https://stmorse.github.io/journal/espn-fantasy-v3.html

Misc

sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes/2/statisticslog

sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/teams/:team_id

sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/:season/teams/:team_id/athletes?limit=200

--

Resources

@terrencewhaley
Copy link

@nntrn Thank you so much for this script!

@mattabets
Copy link

This might be a noob question, I'm fairly new to programming, but I'm trying to setup a search function to pull player profile information (i.e name, headshot, age, number, team), the only issue being that for the search to work as I've set it up I can't just search "Ryan Tannehill" and get that information, I need to search using their player id, which isn't intuitive for users.

https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes/14876

Is it a situation where I'm better of having a local file that has all the key: value pairings e.g. { "Ryan Tannehill" : 14876 } or is there a better way to do this?

alternatively, I just used @nntrn 's script to build a python function to reverse lookup the player id by their name. You can find the documentation here: https://github.com/mattabets/espn_api_player_id_reverse_lookup/blob/main/README.md

@newadventure079
Copy link

newadventure079 commented Jun 5, 2024

There's another endpoint for the pickem challenges that I've used
https://fantasy.espn.com/apis/v1/challenges/'+game_type+'-'+year+'/members/
In 2023, it didn't require auth.

In 2024, it has changed to the below and now requires auth
https://gambit-api.fantasy.espn.com/apis/v1/challenges/'+game_type+'-'+year+'/members/

To include the credentials (cookies) for auth, I added

xhrFields: {
    withCredentials: true
},
crossDomain: true

to the call

@newadventure079
Copy link

Does anyone know of a way to tell if a user has submitted their picks for the week in the pickem challenges?

You used to be able to click on their name and it'd tell you if they have submitted their picks or not but I believe during the site redesign a few years ago, espn removed that feature.

@JamesSingleton
Copy link

Has anyone figured out how to get College Football weeks? https://site.api.espn.com/apis/common/v3/sports/football/college-football/seasons gives all seasons from 1872 to 2024 which I only need a single season. I tried adding ?season=2024, ?year=2024 with no luck. You can do https://site.api.espn.com/apis/common/v3/sports/football/college-football/seasons/2024 to get the 2024 season, but it doesn't give the weeks, even doing ?seasonType=2 doesn't.

@newadventure079
Copy link

Using the first url, after you get the data, you should be able to reference what you want to get by doing something like
const season2024 = data.seasons.find(season => season.year === 2024);

@JamesSingleton
Copy link

@newadventure079 yea that is true I could do that... But I was trying to avoid having to get a massive payload (I guess not that massive as it's 8.3 kB). I do find it interesting that /seasons will give the breakdown of the weeks, but /seasons/2024 won't

@newadventure079
Copy link

The API is a big black box lol

@JamesSingleton
Copy link

@newadventure079 yea... I am building a College Football Top 25 voting system for my website and I don't want to have to hardcode the weeks into my API routes, so that is why I was looking at using the API endpoint. I also noticed for ESPN, they classify Week 1 as 8/24-9/3 but that includes Week 0 and Week 1, I found that interesting.

@newadventure079
Copy link

Does anyone know of a way to tell if a user has submitted their picks for the week in the pickem challenges?

@seastco
Copy link

seastco commented Aug 15, 2024

does anyone the rate limit and if it's by hour or day? and how's reliability? anyone using this for a production app?

@ryanbuckner
Copy link

ryanbuckner commented Aug 15, 2024 via email

@nntrn
Copy link
Author

nntrn commented Aug 16, 2024

Does anyone know of a way to tell if a user has submitted their picks for the week in the pickem challenges? - @newadventure079

https://gambit-api.fantasy.espn.com/apis/v1/challenges/nfl-win-totals-{SEASON}/groups/{GROUP_ID}?view={VIEW_NAME}

Views:

@newadventure079
Copy link

Does anyone know of a way to tell if a user has submitted their picks for the week in the pickem challenges? - @newadventure079

https://gambit-api.fantasy.espn.com/apis/v1/challenges/nfl-win-totals-{SEASON}/groups/{GROUP_ID}?view={VIEW_NAME}

Views:

@nntrn Thanks you for this. I'll take a look at it when the season starts. It might only show the picks they made after the game starts tho.

What I'm trying to solve for is knowing if a user has made their picks for the week before kickoff. Before the site redesign a few years ago, you used to be able to view a person's profile and it'd say something like "User X has not submitted their picks for this week". Now that message isn't shown. We have a lot of people in our group that forget to make their picks and miss out.

@mattabets
Copy link

mattabets commented Aug 19, 2024

Anyone know how to pull NFL rosters for different years? I am using this url but it is only returning the current rosters no matter the year: https://site.api.espn.com/apis/site/v2/sports/football/nfl/teams/12?enable=roster&season=2022

@Morshed11218
Copy link

Does anyone know how to get live fantasy draft picks or somehow figure out which players have been drafted when the fantasy draft is in progress?

@kingkool68
Copy link

This list is a great resource. Does anyone know how to get the career stats for a player? I found https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes/2576336/statisticslog, for example, to get links to each season but there doesn't seem to be a way to get career stats unless I download each year's stats and add them up myself.

@JimNayzium
Copy link

JimNayzium commented Aug 22, 2024

What happens if we exceed 2500 calls per day?
Do we get our IP banned for good?
Or do responses just not work after that for the day?

@JimNayzium
Copy link

Does anyone have an exhaustive list of the play "types" with ids that ESPN drive or plays items has? Here is what I have found in the first two games i have manuallyl gone through.

[ { "id": "53", "text": "Kickoff", "abbreviation": "K" }, { "id": "5", "text": "Rush", "abbreviation": "RUSH" }, { "id": "24", "text": "Pass Reception", "abbreviation": "REC" }, { "id": "3", "text": "Pass Incompletion" }, { "id": "21", "text": "Timeout", "abbreviation": "TO" }, { "id": "74", "text": "Official Timeout", "abbreviation": "Off TO" }, { "id": "52", "text": "Punt", "abbreviation": "PUNT" }, { "id": "68", "text": "Rushing Touchdown", "abbreviation": "TD" }, { "id": "61", "text": "Extra Point Good", "abbreviation": "Extra Point Good", "value": 1 }, { "id": "2", "text": "End Period", "abbreviation": "EP" }, { "id": "7", "text": "Sack" }, { "id": "59", "text": "Field Goal Good", "abbreviation": "FG" }, { "id": "8", "text": "Penalty", "abbreviation": "PEN" }, { "id": "67", "text": "Passing Touchdown", "abbreviation": "TD" }, { "id": "75", "text": "Two-minute warning", "abbreviation": "2Min Warn" }, { "id": "65", "text": "End of Half", "abbreviation": "EH" }, { "id": "12", "text": "Kickoff Return (Offense)" }, { "id": "9", "text": "Fumble Recovery (Own)" }, { "id": "66", "text": "End of Game", "abbreviation": "EG" }, { "id": "29", "text": "Fumble Recovery (Opponent)" }, { "id": "26", "text": "Pass Interception Return", "abbreviation": "INTR" }, { "id": "29", "text": "Fumble Recovery (Opponent)" }, { "id": "52", "text": "Punt", "abbreviation": "PUNT" } ]

@ryanbuckner
Copy link

Can you share the API where you saw these so we can try to dig?

@JimNayzium
Copy link

JimNayzium commented Aug 22, 2024

Sure! I just went to one of the links above:
https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/events/401249063/competitions/401249063/plays?limit=300

Also, Here is an updated list, as GitHut Co-Pilot auto filled a few of them and I uncommented them if I was able to confirm then on an end point. I clicked the above one as well as few others like events or similar. Anything I could find that showed individual plays.
`

[
// { "id": "1", "text": "Period Start", "abbreviation": "PS" },
{ "id": "2", "text": "End Period", "abbreviation": "EP" },
{ "id": "3", "text": "Pass Incompletion" },
// { "id": "4", "text": null },
{ "id": "5", "text": "Rush", "abbreviation": "RUSH" },
// { "id": "6", "text": null },
{ "id": "7", "text": "Sack" },
{ "id": "8", "text": "Penalty", "abbreviation": "PEN" },
{ "id": "9", "text": "Fumble Recovery (Own)" },
// { "id": "10", "text": null },
// { "id": "11", "text": null },
{ "id": "12", "text": "Kickoff Return (Offense)" },
// { "id": "13", "text": null },
// { "id": "14", "text": null },
// { "id": "15", "text": null },
// { "id": "16", "text": null },
// { "id": "17", "text": null },
// { "id": "18", "text": null },
// { "id": "19", "text": null },
// { "id": "20", "text": null },

{ "id": "21", "text": "Timeout", "abbreviation": "TO" },
// { "id": "22", "text": null },
// { "id": "23", "text": null },
{ "id": "24", "text": "Pass Reception", "abbreviation": "REC" },
// { "id": "25", "text": null },
{ "id": "26", "text": "Pass Interception Return", "abbreviation": "INTR" },
// { "id": "27", "text": null },
// { "id": "28", "text": null },
{ "id": "29", "text": "Fumble Recovery (Opponent)" },
// { "id": "30", "text": null },
// { "id": "31", "text": null },
// { "id": "32", "text": null },
// { "id": "33", "text": null },
// { "id": "34", "text": null },
// { "id": "35", "text": null },
// { "id": "36", "text": null },
// { "id": "37", "text": null },
// { "id": "38", "text": null },
// { "id": "39", "text": null },
// { "id": "40", "text": null },
// { "id": "41", "text": null },
// { "id": "42", "text": null },
// { "id": "43", "text": null },
// { "id": "44", "text": null },
// { "id": "45", "text": null },
// { "id": "46", "text": null },
// { "id": "47", "text": null },
// { "id": "48", "text": null },
// { "id": "49", "text": null },
// { "id": "50", "text": null },
// { "id": "51", "text": null },
{ "id": "52", "text": "Punt", "abbreviation": "PUNT" },
{ "id": "53", "text": "Kickoff", "abbreviation": "K" },
// { "id": "54", "text": null },
// { "id": "55", "text": null },
// { "id": "56", "text": null },
// { "id": "57", "text": null },
// { "id": "58", "text": null },
{ "id": "59", "text": "Field Goal Good", "abbreviation": "FG" },
{ "id": "60", "text": "Field Goal Missed", "abbreviation": "FG Miss" },
{ "id": "61", "text": "Extra Point Good", "abbreviation": "Extra Point Good", "value": 1 },
// { "id": "62", "text": "Extra Point Missed", "abbreviation": "Extra Point Miss" },
// { "id": "63", "text": "Safety", "abbreviation": "SAF" },
// { "id": "64", "text": "Safety Free Kick", "abbreviation": "SAF FK" },
{ "id": "65", "text": "End of Half", "abbreviation": "EH" },
{ "id": "66", "text": "End of Game", "abbreviation": "EG" },
{ "id": "67", "text": "Passing Touchdown", "abbreviation": "TD" },
{ "id": "68", "text": "Rushing Touchdown", "abbreviation": "TD" },
// { "id": "69", "text": null },
{ "id": "70", "text": "Coin Toss" },
// { "id": "71", "text": null },
// { "id": "72", "text": null },
// { "id": "73", "text": null },
{ "id": "74", "text": "Official Timeout", "abbreviation": "Off TO" },
{ "id": "75", "text": "Two-minute warning", "abbreviation": "2Min Warn" }

]
`

@ryanbuckner
Copy link

ryanbuckner commented Aug 23, 2024

What happens if we exceed 2500 calls per day? Do we get our IP banned for good? Or do responses just not work after that for the day?

You'll receive an error on the next calls until your quota resets. I don't think it's as cut and dry as 2500 per day. I think there are restrictions on frequency too. I've had errors come back saying I've hit a limit and then waited an hour or two to rerun successfully.

The APIs are not supported so I think the 2500 number is a guess.

@JimNayzium
Copy link

I appreciate your input and experience! Thanks for helping me.
In your opinion if I was attempting to generate some live-play-by-play data, and of course would be pulling up to 16 games on any given Sunday depending on the date of the game, what frequency do you think would be wise to go under the block-radar? 5 minutes? 3 minutes?

I realize this is your best guess and won't hold you to anything!!

@ryanbuckner
Copy link

ryanbuckner commented Aug 24, 2024 via email

@JimNayzium
Copy link

Thanks man!
Here is an updated list of play_type_ids I have found so far in preseason and verified.
(Some of the abbreviations are not verified as some of them do not carry abbreviations so I use my own. Also, espn uses the full word "abbreviation" not "abv")

But the numbers on the indexes as the play_type_id are verified for these:

"PLAY_TYPE_IDS" => [ 2 => ["text" => "End Period", "abv" => "EP"], 3 => ["text" => "Pass Incompletion", "abv" => "Pass Inc"], 5 => ["text" => "Rush", "abv" => "RUSH"], 7 => ["text" => "Sack", "abv" => "SACK"], 8 => ["text" => "Penalty", "abv" => "PEN"], 9 => ["text" => "Fumble Recovery (Own)", "abv" => "Fumble Rec (Own)"], 12 => ["text" => "Kickoff Return (Offense)", "abv" => "KOR"], 16 => ["text" => "Two Point Rush", "abv" => "Two Point Rush"], 21 => ["text" => "Timeout", "abv" => "TO"], 24 => ["text" => "Pass Reception", "abv" => "REC"], 26 => ["text" => "Pass Interception Return", "abv" => "INTR"], 29 => ["text" => "Fumble Recovery (Opponent)", "abv" => "Fumble Rec (Opp)"], 36 => ["text" => "Interception Return Touchdown", "abv" => "TD"], 40 => ["text" => "Missed Field Goal Return", "abv" => "AFG"], 52 => ["text" => "Punt", "abv" => "PUNT"], 53 => ["text" => "Kickoff", "abv" => "K"], 59 => ["text" => "Field Goal Good", "abv" => "FG"], 60 => ["text" => "Field Goal Missed", "abv" => "FG Miss"], 61 => ["text" => "Extra Point Good", "abv" => "Extra Point Good", "value" => 1], 65 => ["text" => "End of Half", "abv" => "EH"], 66 => ["text" => "End of Game", "abv" => "EG"], 67 => ["text" => "Passing Touchdown", "abv" => "TD"], 68 => ["text" => "Rushing Touchdown", "abv" => "TD"], 70 => ["text" => "Coin Toss", "abv" => "CT"], 74 => ["text" => "Official Timeout", "abv" => "Off TO"], 75 => ["text" => "Two-minute warning", "abv" => "2Min Warn"] ],

@chriscampana
Copy link

Does ESPN use a different API call for their schedule (eg https://www.espn.com/college-football/schedule) page vs scoreboard (eg https://www.espn.com/college-football/scoreboard) page? What the heck is the difference in those pages anyways ?

What I really want is all college football games by week. When I enter the week, I only get top 25 (ie http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?week=4) but if I enter exact date I get all the games (ie http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?dates=20240907)

@BarryLaminack
Copy link

Does ESPN use a different API call for their schedule (eg https://www.espn.com/college-football/schedule) page vs scoreboard (eg https://www.espn.com/college-football/scoreboard) page? What the heck is the difference in those pages anyways ?

What I really want is all college football games by week. When I enter the week, I only get top 25 (ie http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?week=4) but if I enter exact date I get all the games (ie http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?dates=20240907)

try adding:

&groups=80

to the end of your path.
80 is the "group" or "conference" designation for "FBS", or all the FBS games.

Here's a list of all the "group" or "conference" IDs:
Default = Top 25
80 = FBS (I-A)
81 = FCS (I-AA)
1 = ACC
4 = Big 12
5 = Big Ten
8 = SEC
9 = Pac 12
12 = CUSA
15 = MAC
17 = Mountain West
18 = FBS Indep
20 = Big Sky
21 = MVFC
22 = Ivy
24 = MEAC
25 = NEC
27 = Patriot
28 = Pioneer
29 = Southern
30 = Southland
31 = SWAC
32 = FCS Indep.
35 = DIV II/III
37 = Sun Belt
48 = CAA
151 = American
177 = UAC
179 = BIg South-0VC

So this path for example:
https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?week=2&groups=80
returns all the FBS games for week 2

and this path:
https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?week=2&groups=5
returns all the Big Ten games for week 2

@JimNayzium
Copy link

JimNayzium commented Sep 8, 2024

Here are the play types I have confirmed so far in addition to the above.

$confirmedWithJavascript = [ 2 => ["text" => 'End Period', "abv" => 'EP'], 3 => ["text" => 'Pass Incompletion', "abv" => null], 5 => ["text" => 'Rush', "abv" => 'RUSH'], 7 => ["text" => 'Sack', "abv" => null], 8 => ["text" => 'Penalty', "abv" => 'PEN'], 9 => ["text" => 'Fumble Recovery (Own)', "abv" => null], 12 => ["text" => 'Kickoff Return (Offense)', "abv" => null], 18 => ['text' => 'Blocked Field Goal', 'abv' => 'BFG'], 21 => ["text" => 'Timeout', "abv" => 'TO'], 24 => ["text" => 'Pass Reception', "abv" => 'REC'], 26 => ["text" => 'Pass Interception Return', "abv" => 'INTR'], 36 => ["text" => 'Interception Return Touchdown', "abv" => 'TD'], 51 => ["text" => 'Pass', "abv" => 'PASS'], 52 => ["text" => 'Punt', "abv" => 'PUNT'], 53 => ["text" => 'Kickoff', "abv" => 'K'], 59 => ["text" => 'Field Goal Good', "abv" => 'FG'], 60 => ["text" => 'Field Goal Missed', "abv" => 'FGM'], 65 => ["text" => 'End of Half', "abv" => 'EH'], 66 => ["text" => 'End of Game', "abv" => 'EG'], 67 => ["text" => 'Passing Touchdown', "abv" => 'TD'], 68 => ["text" => 'Rushing Touchdown', "abv" => 'TD'], 74 => ["text" => 'Official Timeout', "abv" => 'Off TO'], 75 => ["text" => 'Two-minute warning', "abv" => '2Min Warn'], 79 => ["text" => 'End of Regulation', "abv" => 'ER'] ];

Anyone else know where to find a comprehensive list of these from the ESPN play-by-play or drive end-points?

@JimNayzium
Copy link

JimNayzium commented Sep 10, 2024

Here is the list I have compiled of the play_type_id's (which are my index numbers in the array, with the text and abbreviation for espn's play by play feeds.

If the value is null, it means I have not found and confirmed a play with that number play_type_id yet.

I have imported and digested all the 2023 season and searched through it fully.
I am working on other past seasons to try and fill in the gaps.

`
$play_types = [

1 => null,
2 => ["text" => 'End Period', "abv" => 'EP'],
3 => ["text" => 'Pass Incompletion', "abv" => null],
4 => null,
5 => ["text" => 'Rush', "abv" => 'RUSH'],
6 => null,
7 => ["text" => 'Sack', "abv" => null],
8 => ["text" => 'Penalty', "abv" => 'PEN'],
9 => ["text" => 'Fumble Recovery (Own)', "abv" => null],
10 => null,
11 => null,
12 => ["text" => 'Kickoff Return (Offense)', "abv" => null],
13 => null,
14 => null,
15 => null,
16 => null,
17 => ['text' => 'Blocked Punt', 'abv' => 'BP'],
18 => ['text' => 'Blocked Field Goal', 'abv' => 'BFG'],
19 => null,
20 => ['text' => 'Safety', 'abv' => 'SF'],
21 => ["text" => 'Timeout', "abv" => 'TO'],
22 => null,
23 => null,
24 => ["text" => 'Pass Reception', "abv" => 'REC'],
25 => null,
26 => ["text" => 'Pass Interception Return', "abv" => 'INTR'],
27 => null,
28 => null,
29 => ['text' => 'Fumble Recovery (Opponent)', 'abv' => null],
30 => null,
31 => null,
32 => ['text' => 'Kickoff Return Touchdown', 'abv' => 'TD'],
33 => null,
34 => ['text' => 'Punt Return Touchdown', 'abv' => 'TD'],
35 => null,
36 => ["text" => 'Interception Return Touchdown', "abv" => 'TD'],
37 => ['text' => 'Blocked Punt Touchdown', 'abv' => 'TD'],
38 => ['text' => 'Blocked Field Goal Touchdown', 'abv' => 'TD'],
39 => ['text' => 'Fumble Return Touchdown', 'abv' => 'TD'],
40 => ['text' => 'Missed Field Goal Return', 'abv' => 'AFG'],
41 => null,
42 => null,
43 => null,
44 => null,
45 => null,
46 => null,
47 => null,
48 => null,
49 => null,
50 => null,
51 => ["text" => 'Pass', "abv" => 'PASS'],
52 => ["text" => 'Punt', "abv" => 'PUNT'],
53 => ["text" => 'Kickoff', "abv" => 'K'],
54 => null,
55 => null,
56 => null,
57 => ['text' => 'Defensive 2pt Conversion', 'abv' => 'D2P'],
58 => null,
59 => ["text" => 'Field Goal Good', "abv" => 'FG'],
60 => ["text" => 'Field Goal Missed', "abv" => 'FGM'],
61 => null,
62 => null,
63 => null,
64 => null,
65 => ["text" => 'End of Half', "abv" => 'EH'],
66 => ["text" => 'End of Game', "abv" => 'EG'],
67 => ["text" => 'Passing Touchdown', "abv" => 'TD'],
68 => ["text" => 'Rushing Touchdown', "abv" => 'TD'],
69 => null,
70 => null,
71 => null,
72 => null,
73 => null,
74 => ["text" => 'Official Timeout', "abv" => 'Off TO'],
75 => ["text" => 'Two-minute warning', "abv" => '2Min Warn'],
76 => null,
77 => null,
78 => null,
79 => ["text" => 'End of Regulation', "abv" => 'ER']

];
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment