Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ESPN hidden API Docs

ESPN's hidden API endpoints

Football

College Football

Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news

Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard

  • query params:

    • calendar: 'blacklist'
    • dates: any date in YYYYMMDD

Game Information: http://site.api.espn.com/apis/site/v2/sports/football/college-football/summary?event=:gameId

  • params:

    • gameId: identifier of some game (EX: 400934572 for 2017 Army vs Navy)

Team Information: http://site.api.espn.com/apis/site/v2/sports/football/college-football/teams/:team

  • params:

    • team: some team abbreviation (EX: 'all' for Allegheny, 'gt' for Georgia Tech, 'wisconsin' for Wisconsin)

Rankings: http://site.api.espn.com/apis/site/v2/sports/football/college-football/rankings

NFL

Scores: http://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard

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

All Teams: http://site.api.espn.com/apis/site/v2/sports/football/nfl/teams

Specific Team: http://site.api.espn.com/apis/site/v2/sports/football/nfl/teams/:team

Baseball

MLB

Scores: http://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard

News: http://site.api.espn.com/apis/site/v2/sports/baseball/mlb/news

All Teams: http://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams

Specific Team: http://site.api.espn.com/apis/site/v2/sports/baseball/mlb/teams/:team

College Baseball

Scores: https://site.api.espn.com/apis/site/v2/sports/baseball/college-baseball/scoreboard

Hockey

Scores: http://site.api.espn.com/apis/site/v2/sports/hockey/nhl/scoreboard

News: http://site.api.espn.com/apis/site/v2/sports/hockey/nhl/news

All Teams: http://site.api.espn.com/apis/site/v2/sports/hockey/nhl/teams

Specific Team: http://site.api.espn.com/apis/site/v2/sports/hockey/nhl/teams/:team

Basketball

NBA

Scores: http://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard

News: http://site.api.espn.com/apis/site/v2/sports/basketball/nba/news

All Teams: http://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams

Specific Team: http://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams/:team

WNBA

Scores: http://site.api.espn.com/apis/site/v2/sports/basketball/wnba/scoreboard

News: http://site.api.espn.com/apis/site/v2/sports/basketball/wnba/news

All Teams: http://site.api.espn.com/apis/site/v2/sports/basketball/wnba/teams

Specific Team: http://site.api.espn.com/apis/site/v2/sports/basketball/wnba/teams/:team

Women's College Basketball

Scores: http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/scoreboard

News: http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/news

All Teams: http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/teams

Specific Team: http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/teams/:team

Men's College Basketball

Scores: http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/scoreboard

News: http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/news

All Teams: http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/teams

Specific Team: http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/teams/:team

Soccer

Scores: http://site.api.espn.com/apis/site/v2/sports/soccer/:league/scoreboard

  • params:

    • league: some league abbreviation (EX: 'eng.1' for EPL, 'usa.1' for MLS)

Latest News: http://site.api.espn.com/apis/site/v2/sports/soccer/:league/news

List of Team Information: http://site.api.espn.com/apis/site/v2/sports/soccer/:league/teams

Will update with more information as I find more...

@tsearle7
Copy link

tsearle7 commented Dec 22, 2021

@YodaLightsabr To my understanding there's no official rate limit since the API isn't official either. Other developers above have mentioned sticking to every 30 sec - 1min when automating something as to not burden their servers. Hope this helps!

@YodaLightsabr
Copy link

YodaLightsabr commented Dec 24, 2021

@YodaLightsabr To my understanding there's no official rate limit since the API isn't official either. Other developers above have mentioned sticking to every 30 sec - 1min when automating something as to not burden their servers. Hope this helps!

Thanks! I'm planning on running a script every minute and then caching it whenever the data is needed so it doesn't spam the API.

@SheepEatLion
Copy link

SheepEatLion commented Feb 10, 2022

thank you! it save me !

@bradkimbrell
Copy link

bradkimbrell commented Feb 23, 2022

Team Roster and Depth Chart endpoints. Does anyone know of a way to get a single request and get all of the athletes in a single call rather than having to make 80 or so calls looping over each of those url's returned in the standard roster / depth chart? Parsing every player to populate a screen is VERY slow. I need both Roster and Depth Chart and they are both structured with separate URLs for every player. Any ideas? Thanks in advance!

@rondog
Copy link

rondog commented Feb 23, 2022

@bradkimbrell I dont think so, but could be wrong. You should setup a cron job that runs like once a day that queries the API and store that information in a DB so you aren't hitting the API so often. Your front end should query your DB if that is an option. It would be much faster that way.

@bradkimbrell
Copy link

bradkimbrell commented Feb 23, 2022

@rondog
Copy link

rondog commented Feb 23, 2022

@bradkimbrell excellent, im glad you found that. Always good when people post their findings

@DawsonWebb
Copy link

DawsonWebb commented Feb 28, 2022

College Baseball

Scores: https://site.api.espn.com/apis/site/v2/sports/baseball/college-baseball/scoreboard
News: https://site.api.espn.com/apis/site/v2/sports/baseball/college-baseball/news
Teams: https://site.api.espn.com/apis/site/v2/sports/baseball/college-baseball/teams
Specific Team: https://site.api.espn.com/apis/site/v2/sports/baseball/college-baseball/teams/:team

Those all work. Scores brings back only Power 5 team games. Every teams group is 26 it looks like. Teams function doesn't bring back every team in Power 5 so you have to add the ?limit={int} parameter. When you select a non-power 5 team using their ID it will show the next game that shows up in scoreboard not their actual next game. Even some power 5 games are not on the scoreboard. I am really not sure how they decided which games cause the games from an invitational are not on the scoreboard.

@DigitalTechnicality
Copy link

DigitalTechnicality commented Mar 8, 2022

It seems like there should be an api endpoint for team stats like this https://www.espn.com/mens-college-basketball/team/stats/_/id/221

Can anyone help me find it?

@bradkimbrell
Copy link

bradkimbrell commented Mar 23, 2022

@webmechanic02
Copy link

webmechanic02 commented Apr 10, 2022

I am curious... does anyone know the correct MLB call to retrieve a list of MLB Homerun leaders? - Thanks!

@webmechanic02
Copy link

webmechanic02 commented Apr 10, 2022

@rondog Thanks for taking a look. I think there is a way to pull it using "leaders" but I couldn't get it right. Basically, I am looking to get the info that is on this page https://www.espn.com/mlb/stats/player/_/view/batting/table/batting/sort/homeRuns/dir/desc . I was using the feed from MLB but they changed it up this year and I thought this might be an easier route that working with MLB's new api.
I will take a look at what you sent and see if I can make that work. Thanks again!

@TheeOhioState
Copy link

TheeOhioState commented Apr 18, 2022

@TheeOhioState I went through and got all players (active and non-active) it's here

excellent , can you share the script or php your running to get those IDs? I need to match ESPN NFL Player IDs with another API list of playerIDs , and I'm only able to get Rostered players through the ESPN API and not getting any free agents

@ianpherbert
Copy link

ianpherbert commented Apr 18, 2022

@TheeOhioState Unfortunately the only way i found to get all player's id is to call the player endpoint (https://site.web.api.espn.com/apis/common/v3/sports/football/nfl/athletes/{playerId}) and increment the id by 1 each call...
I used a very simple node script to save the players' names with their id.
That being said I have a google script that updates that list with all active players once a day. I can make that lsit public if that is interesting to you.

@lmurdock12
Copy link

lmurdock12 commented Apr 25, 2022

Any API url for top headlines? I see individual news for each sport but wondering if there was one that holds the top stories across all sports.

@stern1978
Copy link

stern1978 commented Apr 26, 2022

Has anyone figured out how to get Golf's schedule? The closest I found was https://www.espn.com/golf/schedule/_/season/2022/tour/pga?_xhr=pageContent but you can see technically not part of the API. Its also missing some crucial information like tournament ID (aside from it being displayed in the link field. Specifically for this page: https://www.espn.com/golf/schedule

Is this what you are looking for?
https://site.api.espn.com/apis/site/v2/sports/golf/pga/scoreboard

@rondog
Copy link

rondog commented Apr 26, 2022

@stern1978 Yep that looks to be it what I was originally looking for, thank you

@TheeOhioState
Copy link

TheeOhioState commented May 5, 2022

@ianpherbert think i found a better way to collect all athlete IDs in the ESPN system. I checked and it contains all 2022 rookies , all current free agents , all rostered players and all former players back to when espn starting assigning IDs as far as i can tell.

If you go view the athletes page in v2 API - https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes
There is a list of 25 players

now add query to show 1000 (will not allow limit to be over 1000)
https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes?limit=1000

now add page and count of 1000 , so you can go through 17 pages using "pageCount":17 , about 17000 total former and current and free agent players , all IDs in their system
https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes?limit=1000&page=1
https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes?limit=1000&page=2
...
...

Armed with all the specific IDs you can loop through each player page and see who is active or inactive , or free agent and rostered. Save that info so next pass you can exempt former players if you want to only pass through rostered players and free agents.

Or use V3 which has player info on the initial page
https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=1000&page=1
https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=1000&page=2
...
...

Well hell using V3 same query , you can find EVERY player ID , name on a single page - query allows limit to be over 1000 in v3

https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=20000

I put limit at 20k to allow for new players for next few seasons

This returns all 16000+ players in the system , name , id and DOB for example. I am noticing about 200+ players that have same names and DOB , but different IDs , so ESPN has duplicate IDs for at least 200 players

function GetESPNIds() {
	var url = 'https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=20000';
	$.ajax({
		type: "GET",
      		url: url,
      		success: function (data) {
			for (var i=0;i<data.items.length;i++) {
				if(data.items[i].hasOwnProperty("lastName") && data.items[i].hasOwnProperty("firstName") && data.items[i].hasOwnProperty("dateOfBirth")) {
					console.log("Name: "+data.items[i].lastName+","+data.items[i].firstName +" ID: " +data.items[i].id +" DOB: " +data.items[i].dateOfBirth);
				}
			}
      		}
   	});
}

GetESPNIds();

@lmurdock12
Copy link

lmurdock12 commented May 10, 2022

Anyone know why the API endpoint for the NBA teams does not show all 30 teams?

http://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams

I am only getting 25 teams.

@ianpherbert
Copy link

ianpherbert commented May 10, 2022

@lmurdock12 with all of their API's you have to set your own limit
so - http://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams?limit=30

@davidbti
Copy link

davidbti commented May 12, 2022

@ddivins
Copy link

ddivins commented Jun 4, 2022

Thanks everyone. I hope this is allowed, I just published a python script that is the beginning of a ticker just to learn python and json, maybe some will find it helpful (?):
https://github.com/ddivins/SportsTicker

@v2k
Copy link

v2k commented Jun 22, 2022

@ianpherbert think i found a better way to collect all athlete IDs in the ESPN system. I checked and it contains all 2022 rookies , all current free agents , all rostered players and all former players back to when espn starting assigning IDs as far as i can tell.

If you go view the athletes page in v2 API - https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes There is a list of 25 players

now add query to show 1000 (will not allow limit to be over 1000) https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes?limit=1000

now add page and count of 1000 , so you can go through 17 pages using "pageCount":17 , about 17000 total former and current and free agent players , all IDs in their system https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes?limit=1000&page=1 https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/athletes?limit=1000&page=2 ... ...

Armed with all the specific IDs you can loop through each player page and see who is active or inactive , or free agent and rostered. Save that info so next pass you can exempt former players if you want to only pass through rostered players and free agents.

Or use V3 which has player info on the initial page https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=1000&page=1 https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=1000&page=2 ... ...

Well hell using V3 same query , you can find EVERY player ID , name on a single page - query allows limit to be over 1000 in v3

https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=20000

I put limit at 20k to allow for new players for next few seasons

This returns all 16000+ players in the system , name , id and DOB for example. I am noticing about 200+ players that have same names and DOB , but different IDs , so ESPN has duplicate IDs for at least 200 players

function GetESPNIds() {
	var url = 'https://sports.core.api.espn.com/v3/sports/football/nfl/athletes?limit=20000';
	$.ajax({
		type: "GET",
      		url: url,
      		success: function (data) {
			for (var i=0;i<data.items.length;i++) {
				if(data.items[i].hasOwnProperty("lastName") && data.items[i].hasOwnProperty("firstName") && data.items[i].hasOwnProperty("dateOfBirth")) {
					console.log("Name: "+data.items[i].lastName+","+data.items[i].firstName +" ID: " +data.items[i].id +" DOB: " +data.items[i].dateOfBirth);
				}
			}
      		}
   	});
}

GetESPNIds();

@TheeOhioState any chance you figured out a way to filter these by team id?

@dmb4086
Copy link

dmb4086 commented Jun 27, 2022

If anyone was curious for the UFC route for a specific athlete here it is

https://sports.core.api.espn.com/v2/sports/mma/leagues/ufc/athletes/:athlete-id

@brenttyler
Copy link

brenttyler commented Jul 14, 2022

Looking at the NFL scoreboard linked above, I see it's returning 2021 data. Is there a way to specify 2022 at this point or will it just automatically roll over to 2022 nearer to the season actually starting?

@hawkseye76
Copy link

hawkseye76 commented Aug 5, 2022

Looking at the NFL scoreboard linked above, I see it's returning 2021 data. Is there a way to specify 2022 at this point or will it just automatically roll over to 2022 nearer to the season actually starting?

It should rollover as it nears the season.

@zwheatley502
Copy link

zwheatley502 commented Aug 8, 2022

Anyway to get college football season summary stats for the whole team? Looking for the underlying data to this page: https://www.espn.com/college-football/team/stats/_/type/team/id/96

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