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...

@KevinDuganJr
Copy link

I'd like to find out also, because I don't want to build a bunch of code for my website (some of which I've already done) that is going to suddenly disappear...

Develop your website in a manner that it just consumes an object using the API data as middleware. Then when/if the ESPN API changes or fails, you just have to find a new source and your website continues. This is what I had to do with mine. NFL changed their API, or rather closed it down.

@lexcraw4d
Copy link

What is yalls best approach on querying a player by name if you don't know the id?

@slovanos
Copy link

slovanos commented Nov 4, 2022

Hi, and thanks for the list!

Any ideas on how to get boxing Information?

I discover some urls for mma:
https://site.api.espn.com/apis/site/v2/sports/mma/ufc/news
https://site.api.espn.com/apis/site/v2/sports/mma/ufc/scorboard

And for boxing it should be something analogous like:
https://site.api.espn.com/apis/site/v2/sports/boxing/:something/scoreboard

but I'm not getting anything. Any help would be appreciated

@codecatalysts
Copy link

@slovanos If you use this link you can find paths further down the tree by navigating to the url in the $ref. I don't see a top level boxing but there are several in mma, maybe has what you are looking for.

http://sports.core.api.espn.com/v2/sports

@ZachManno
Copy link

Made a parser that will turn the JSON response into a scoreboard object:
https://github.com/ZachManno/sports-scoreboard-ticker-led/blob/master/espn-scores/Scoreboard.py

@slovanos
Copy link

slovanos commented Nov 7, 2022

@slovanos If you use this link you can find paths further down the tree by navigating to the url in the $ref. I don't see a top level boxing but there are several in mma, maybe has what you are looking for.

http://sports.core.api.espn.com/v2/sports

Thanks @codecatalysts for your replay. Unfortunately I still can not find boxing info. I'm just looking for the upcomming fights on boxing to begin with, and, if available, the results (like on the scoreboard for the other sports)

@justingolden21
Copy link

Is there a way to get all college football scores, not just top 25?

@reidwatson
Copy link

reidwatson commented Nov 7, 2022

Is there a way to get all college football scores, not just top 25?

Add ?groups=80 to your call. https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?groups=80

Scroll back in this to around August 30th for more discussion on this, I had the same question previously

@justingolden21
Copy link

justingolden21 commented Nov 7, 2022

Thanks for the reply! I see the list of conference IDs above, but that URL you just showed doesn't have every game. It's missing SDSU UNLV for example, which is a div 1 game that just happened. It's actually missing all mountain west games, plus plenty of others. I think it's still only top 25.

In fact, it's only got about 25 games:
image

@reidwatson
Copy link

Again, scroll up and check out this post, you need to specify a limit greater than 25 and even try a date range and you’ll get what you’re looking for.
https://gist.github.com/akeaswaran/b48b02f1c94f873c6655e7129910fc3b?permalink_comment_id=4284805#gistcomment-4284805

@justingolden21
Copy link

justingolden21 commented Nov 7, 2022

Got it by adding a limit, thanks!

https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?groups=80&limit=200

@justingolden21
Copy link

justingolden21 commented Nov 10, 2022

Has anyone been able to figure out NFL or MLB rankings? I looked at their docs and used those endpoints, but I get a 404 error. The other end points work fine:

const API_ENDPOINTS = {
	'mens-college-basketball': '/basketball/mens-college-basketball/rankings',
	'womens-college-basketball': '/basketball/womens-college-basketball/rankings',
	'college-football': '/football/college-football/rankings'
	// 'mlb-baseball': '/baseball/mlb/rankings',
	// 'nba-basketball': '/basketball/nba/rankings',
	// 'wnba-basketball': '/basketball/wnba/rankings',
	// 'nfl-football': '/football/nfl/rankings'
};
	
const response = await fetch(`https://site.api.espn.com/apis/site/v2/sports${API_ENDPOINTS[sport]}`);

{"code":404,"message":"Unable to get sport data for sport: baseball and league: mlb"} from https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/rankings

@ITIRadio
Copy link

I've put about 100 hours into a personal project that I thought was possible with this API, a Raspberry Pi Score Ticker to attach to a TV, such as a second TV or a monitor in a TV room. However, I ran into too many issues with the scoreboard & events calls:

  1. With baseball & hockey, there were too many disappearing data points that would come up in the middle of a game, such as the line score for the top of the 3rd inning would vanish in the bottom of the 6th. While it would reappear, sometimes, the errors & inconsistencies made the use of this API, albeit free for now, too frustrating to actually use on an actual project.

  2. The basic scoreboard call for basketball has some stats, plus 3 leaders, so one API call per run through the scores is sufficient, however, football is another story. Both scoreboard (NFL & college) calls for football has literally zero stats, except the 3 leaders (passing, rushing, & receiving) FOR BOTH TEAMS COMBINED (ugh). Team stats, even basic yardages, are non-existant. So, I tested with calling the events API for each game, and I quickly ran into throttling issues. Two quick consecutive calls, one to the scoreboard and one to an event (game) caused the second to be ignored, time out, and cause a cancellation of any other calls. Python sleeps didn't help. This was strange because manually loading the JSON for 2 calls in a browser can be manually done with just a few second gap, but this couldn't be automated.

In short, I have determined that this API might be OK for the simplest of projects, or maybe downloading a few stats occasionally, but it's not worth any investment of time. It's not worth it for anything involving more than a couple of hundreds of lines of code, such as a super-basic score ticker, and certainly not something involving a nice user interface. I have completed Python Linux command line output for basic scoreboards for the NFL, NBA, and college football & basketball. If there is any interest in me posting a cleaned-up version of this code in another project, please let me know.

@ddivins
Copy link

ddivins commented Nov 20, 2022 via email

@bobgodwin
Copy link

In short, I have determined that this API might be OK for the simplest of projects, or maybe downloading a few stats occasionally, but it's not worth any investment of time. It's not worth it for anything involving more than a couple of hundreds of lines of code, such as a super-basic score ticker, and certainly not something involving a nice user interface. I have completed Python Linux command line output for basic scoreboards for the NFL, NBA, and college football & basketball. If there is any interest in me posting a cleaned-up version of this code in another project, please let me know.

I'm not sure what you're trying to accomplish, but I've used it to run a football pool for three years. So far the API has worked fine for me. I've built multi sport live game tickers and other stuff with it. Data's data, so you just have to turn it into what you need (PHP works fine for my uses). And you're not ever going to get what you need with just the scoreboard data. The Pool and football squares are member only but here's a link to some NFL stats. Live it shows info for the game in progress:

https://bigearthweb.net/sports/nfl-stats/

I've other post not to far back with the live sport tickers and whatnot.

@ochawkeye
Copy link

Like @bobgodwin, I've used this API for NFL stats for the better part of three years to run the live scoring for my fantasy football league.

My experience is that it has been a very reliable replacement for the JSON data that used to feed NFL.com game center.

Sample Top Performers
Sample All Scores

@chrisblakley
Copy link

chrisblakley commented Nov 21, 2022

For anyone curious, here is the scoreboard endpoint URL for the FIFA World Cup:
https://site.api.espn.com/apis/site/v2/sports/soccer/fifa.world/scoreboard

The league abbreviation is fifa.world.

For example– specifying a date range plus a limit to try to max out the available data (probably overkill):
https://site.api.espn.com/apis/site/v2/sports/soccer/fifa.world/scoreboard?limit=950&dates=20221121-20221127

@stern1978
Copy link

Any one know how to get World Cup table data?

@YodaLightsabr
Copy link

This isn't ESPN, but someone else made World Cup JSON (GitHub), which is a REST API for World Cup teams and matches. There's also a JS client to go along with it (worldcup.js).

@stern1978
Copy link

For anyone curious, here is the scoreboard endpoint URL for the FIFA World Cup: https://site.api.espn.com/apis/site/v2/sports/soccer/fifa.world/scoreboard

The league abbreviation is fifa.world.

For example– specifying a date range plus a limit to try to max out the available data (probably overkill): https://site.api.espn.com/apis/site/v2/sports/soccer/fifa.world/scoreboard?limit=950&dates=20221121-20221127

One can also be found here.

https://site.api.espn.com/apis/v2/scoreboard/header?sport=soccer&league=fifa.world

@bryanperez43
Copy link

@ITIRadio
Copy link

ITIRadio commented Dec 3, 2022

Let me add a couple of specific responses to replies: the NFL API calls can be slow if event calls & scoreboard calls are done quickly in succession, as in when automated. I abandoned the ticker idea, as Python I/O libraries always have some crucial lack of functionality that make automation unusable. For example, PyAutoGUI has automatic vertical scrolling, which would have been nice, but there's no flag, event, or anything else that reports when PyAutoGUI has scrolled through all of the available text. So, I proceeded with something that dumps text in the Linux Command Line, and that I can simply read, redirect to a file, or cron at specific times throughout the week. I also wanted to be careful about overuse of this for-now free service, such as it is, and at the same time get some nice output, whether it's before games, during games, or after games.

As I previously stated, the NFL API is working well, so I can concur with other reports. College games (full scoreboard, not just Top 25) are performing better, though there are fewer event stats and calls, thanks to the fewer games now being played while I'm testing. If there are more games returned by the scoreboard call, as potentially may be the case during bowl season, throttling may begin again. My Box Scores programs provide pre-game info, such as weather & lines, team season stat averages, team stat leaders, injuries (NFL only), and last 5 game results. During games, there's full team stats, full individual stats (though I didn't parse out special teams), current drive stats, and last play. Post-game, there's all of the in-game stats, plus headlines, quarter scores, and scoring plays, suitable for saving as readable text, or saving some code as snippets for applications, such as fantasy football calculators. I wouldn't wear these out, although, for me, a middleware database is out-of-the-question and pointless for this application. It seems like, given the glacial speed of ESPN.com, that they're loading an in-browser app that builds pages client-side, accessing this data API as it goes. So, their traffic manager may think that I like to hit the refresh button a lot?

The NBA & college basketball scoreboards have nearly identical JSON structures. There's also some basic stats & individual leaders, no matter the game status (pre, during, or post). Since you're making just 1 call to the scoreboard API, you can ask for all Division I games for college, and get the kind of output that I've been looking for, though you get a LOT of games. The events API is throwing inconsistencies like with baseball & hockey, so I stopped working on more detailed output for basketball. The brief football ticker program based on the scoreboard API only is too data-free to bother posting.

I've posted the NFL & college football box score programs to my new repository at:

https://github.com/ITIRadio/ESPN-API

I'll post basketball as I have time. The code is lengthier than expected because there ended up being significantly more error checking than I could have imagined. REST API databases make me love MySQL databases all over again.

@hawkseye76
Copy link

Anybody know how to pull data, events, scores, etc for NCAA Womens Volleyball? API docs say it exists, but it returns a 404.

@stern1978
Copy link

@hawkseye76
Copy link

hawkseye76 commented Dec 6, 2022

@stern1978 That is exactly what i'm looking for! Thank you!

Wonder why https://site.api.espn.com/apis/site/v2/sports/volleyball/womens-college-volleyball/scoreboard doesn't work like the other sports?

Edit: Well, now that link works. Maybe i just had a typo or something. Regardless, Thanks @stern1978!!

@makeniii
Copy link

makeniii commented Dec 14, 2022

Is there a id for a NBA season? Doesn't seem like there is but thought I'd ask anyways.

Also, does anyone know what 4/5 means for this variable for example, schedule_json['events']['competitions'][0]['status']['type']['id']? Currently, I know that:

1 = scheduled
2 = live
3 = completed
6 = postponed

So I'm assuming that 4/5 must mean something too but I haven't come across it yet.

@CyrilNb
Copy link

CyrilNb commented Jan 10, 2023

Does any one succeed to get leader of a soccer league (like Premiere league for example?). Scoreboard endpoint does not give current standings of the season

@CyrilNb
Copy link

CyrilNb commented Jan 10, 2023

Same for NBA, I am trying to get the current standing for both conferences. Is there a way someone managed to get it?

@zhayes84
Copy link

I wrote a Python "handler" (I don't know the proper label) that handles most of the College Football Ranking data:

https://github.com/zhayes84/espn-college-football-rankings-api-python/blob/main/ncaa_rankings_json.py

@nworbdier
Copy link

Does anyone know the endpoints for:

PGA Schedule (List of all tournaments and info for a given year/month/date)

PGA Player Scorecards for a Specific Tournament (Ideally only the details for a single golfer for a specific tournament

@ryanbuckner
Copy link

ryanbuckner commented Jan 24, 2023

Is there a way to use the NCAA Men's Basketball feed to get all March Madness games and scores?
http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/scoreboard

@ryanbuckner
Copy link

ryanbuckner commented Jan 24, 2023

Let me add a couple of specific responses to replies: the NFL API calls can be slow if event calls & scoreboard calls are done quickly in succession, as in when automated. I abandoned the ticker idea, as Python I/O libraries always have some crucial lack of functionality that make automation unusable. For example, PyAutoGUI has automatic vertical scrolling, which would have been nice, but there's no flag, ......
I'll post basketball as I have time. The code is lengthier than expected because there ended up being significantly more error checking than I could have imagined. REST API databases make me love MySQL databases all over again.

I created a public google sheets that uses the NFL API and updates every 15 minutes
Sheets

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