Skip to content

Instantly share code, notes, and snippets.

@akeaswaran
Last active December 24, 2024 19:34
Show Gist options
  • Save akeaswaran/b48b02f1c94f873c6655e7129910fc3b to your computer and use it in GitHub Desktop.
Save akeaswaran/b48b02f1c94f873c6655e7129910fc3b to your computer and use it in GitHub Desktop.
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...

@althepal78
Copy link

Anyone able to get play-by-play data of MMA? Basically I am looking for the "timeline" of a fight.

if it doesn't exist on the website you probably won't find it in the api. The best I could find is something like this for UFC308: https://site.web.api.espn.com/apis/common/v3/sports/mma/ufc/fightcenter/600044733

Looks like a good starting endpoint (that's a weird phrase) for UFC fights would be: https://site.api.espn.com/apis/personalized/v2/scoreboard/header?sport=mma&league=ufc

and for MMA would be: https://site.api.espn.com/apis/personalized/v2/scoreboard/header?sport=mma

I have not tried never cared about doing this but maybe I will try to help tomorrow or monday evening :)

@althepal78
Copy link

never mind I figured out the team news thing with this link thanks a lot ;)
https://site.api.espn.com/apis/site/v2/sports/basketball/nba/news?team=ny

@dleather25
Copy link

can I use this to get specific teams stats such as turnovers, offensive efficiency, defensive efficiency, rushing defense, etc etc

@althepal78
Copy link

I think you can you have to learn how to like for news with NBA I had to add ?team=ny

@jdgilhuly
Copy link

Anyone know how to get statistics for a certain season for a NBA player i.e. Luka Doncic 2024-2025 stats?

@althepal78
Copy link

https://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams/ny/roster you might be able to do something like this with that team it is getting me team roster you have to fiddle with it @jdgilhuly

@martinwilliamsiet
Copy link

Is it possible to get injury data for soccer from this somehow?

@hashuser1
Copy link

Does anyone know how to pull box scores for the NBA?

@MichaelMon12
Copy link

MichaelMon12 commented Nov 23, 2024

I'm trying to find the full upcoming schedule for the USA Men's National Soccer Team (USMNT). I was able to find: https://site.api.espn.com/apis/site/v2/sports/soccer/all/teams/660/schedule, but that just lists the already played games. I'm trying to find the API with the upcoming games listed here: https://www.espn.com/soccer/team/fixtures/_/id/660/usa. Thanks.

@sheo77
Copy link

sheo77 commented Nov 26, 2024

Does anyone know how I can get all the football leagues? I only know usa.1 and eng.1 https://site.api.espn.com/apis/site/v2/sports/soccer/eng.1/scoreboard , but I need the Champions League code

Use https://sports.core.api.espn.com/v2/sports/soccer/leagues for a complete list -> uefa.champions

@justingolden21
Copy link

Looking for basketball conferences / groups and can't find anything anywhere, either online or from the API. I compiled this list but can't find CAA:

        'Top 25': 0,
        'America East': 1,
        'Atlantic Coast': 2,
        'Atlantic 10': 3,
        'Big East': 4,
        'Big Sky': 5,
        'Big South': 6,
        'Big Ten': 7,
        'Big 12': 8,
        'Big West': 9,
        'Coastal Athletic': 10,
        'Conference USA': 11,
        'Ivy League': 12,
        'Metro Atlantic Athletic': 13,
        'Mid-American': 14,
        'Mid-Eastern Athletic': 16,
        'Missouri Valley': 18,
        'Northeast': 19,
        'Ohio Valley': 20,
        // 21 is power five, no big east and yes pac12
        'Patriot League': 22,
        'Southeastern': 23,
        'Southern': 24,
        'Southland': 25,
        'Southwestern Athletic': 26,
        'Sun Belt': 27,
        'West Coast': 29,
        'Western Athletic': 30,
        // not sure what 31-43 are
        'Mountain West': 44,
        'Horizon League': 45,
        'Atlantic Sun': 46,
        // not sure what 47-48 are
        'Summit League': 49,
        'American Athletic': 62,

Hopefully this helps someone!

@justingolden21
Copy link

50 seems to be everything? And 52 seems to be the same? No other insights from me...

@ischmidt20
Copy link

The CAA is listed as Coastal Athletic (#10). But setting groups=50 will give you all D1, just make sure you set the limit high enough to return all of the games for a single day. The postseason tournaments (NCAA, NIT, etc.) also have codes in the 90s (can't recall exactly), but they should also still return with groups=50.

@justingolden21
Copy link

The CAA is listed as Coastal Athletic (#10). But setting groups=50 will give you all D1, just make sure you set the limit high enough to return all of the games for a single day. The postseason tournaments (NCAA, NIT, etc.) also have codes in the 90s (can't recall exactly), but they should also still return with groups=50.

Awesome, thank you!

@zslabs
Copy link

zslabs commented Nov 30, 2024

Thanks for this list! Is there a way to grab retired players as well? For example, Michael Jordan's profile is 1035 but he won't show up on a roster since he's not part of a team.

@ryanbuckner
Copy link

I've pulled a ton of data using this API for NFL, MLB, and NHL into PowerBI. Organizes the data and I have some visuals ready to go. I'd be willing to share the .pbix file if anyone can suggest a good way of doing so and/or if that would help someone?

Would you be willing to share what the MLB JSON looks like during a game? I'm looking to see what live information is available (eg: outs, strikes, balls, players on base)

@kliuc
Copy link

kliuc commented Dec 20, 2024

Anyone have an idea of how to get college football teams for FBS only? I have tried several REST urls to no avail.
Tacking on "groups=80" in the query-string does not seem to do anything.
To get ALL (I think) college football teams you can do this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/teams?limit=700
I can get the college-football groups with this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/groups

For all college football FBS games I was able to use the following API below. I would double check but for this weekend I was able to return 49 games. If you were to run it without the limit and groups it would only return 17 games.

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

Having the same issue, any ideas?

@akreu
Copy link

akreu commented Dec 20, 2024

Anyone have an idea of how to get college football teams for FBS only? I have tried several REST urls to no avail.
Tacking on "groups=80" in the query-string does not seem to do anything.
To get ALL (I think) college football teams you can do this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/teams?limit=700
I can get the college-football groups with this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/groups

For all college football FBS games I was able to use the following API below. I would double check but for this weekend I was able to return 49 games. If you were to run it without the limit and groups it would only return 17 games.
https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?limit=100&groups=80

Having the same issue, any ideas?

You could try this:
https://site.web.api.espn.com/apis/site/v2/sports/football/college-football/teams?groups=80&groupType=conference&enable=groups

@kliuc
Copy link

kliuc commented Dec 20, 2024

Anyone have an idea of how to get college football teams for FBS only? I have tried several REST urls to no avail.
Tacking on "groups=80" in the query-string does not seem to do anything.
To get ALL (I think) college football teams you can do this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/teams?limit=700
I can get the college-football groups with this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/groups

For all college football FBS games I was able to use the following API below. I would double check but for this weekend I was able to return 49 games. If you were to run it without the limit and groups it would only return 17 games.
https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?limit=100&groups=80

Having the same issue, any ideas?

You could try this: https://site.web.api.espn.com/apis/site/v2/sports/football/college-football/teams?groups=80&groupType=conference&enable=groups

This works, thanks! Just curious how did you figure this out?

@akreu
Copy link

akreu commented Dec 20, 2024

Anyone have an idea of how to get college football teams for FBS only? I have tried several REST urls to no avail.
Tacking on "groups=80" in the query-string does not seem to do anything.
To get ALL (I think) college football teams you can do this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/teams?limit=700
I can get the college-football groups with this:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/groups

For all college football FBS games I was able to use the following API below. I would double check but for this weekend I was able to return 49 games. If you were to run it without the limit and groups it would only return 17 games.
https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?limit=100&groups=80

Having the same issue, any ideas?

You could try this: https://site.web.api.espn.com/apis/site/v2/sports/football/college-football/teams?groups=80&groupType=conference&enable=groups

This works, thanks! Just curious how did you figure this out?

Just browsing the site w/ dev tools open and finding the requests, for example this page and viewing requests after changing the conference dropdown: https://www.espn.com/college-football/teams

@ThreatAgario
Copy link

Hey would there be an endpoint that contains lineup information for games? Specifically soccer. I've tried to find one with no luck.

@ryanbuckner
Copy link

ryanbuckner commented Dec 23, 2024

Any idea what information ESPN uses to determine "too many calls in one day" rate limits? I tried using a VPN but that didn't change it. I just need to run it once today to update scores from last night, but I've hit the limit.

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