What is the ESPN API?

The ESPN API refers to a collection of undocumented endpoints that developers have discovered by reverse-engineering ESPN's web and mobile applications. While ESPN doesn't offer an official public API, these hidden endpoints provide free access to a wealth of sports data:

Key Benefits

  • Free Access: No subscription or payment required
  • No Authentication: No API key or token needed
  • JSON Responses: Clean, structured data format
  • Comprehensive Coverage: All major US sports plus international soccer

API Base URLs

ESPN's hidden API uses several base domains, each serving different types of data:

Domain Purpose
site.api.espn.com General site data - scores, news, teams, standings
sports.core.api.espn.com Core sports data - athletes, detailed stats, odds, venues
site.web.api.espn.com Web-specific APIs - search, game summaries, athlete overviews
fantasy.espn.com Fantasy sports data (may require authentication for private leagues)
cdn.espn.com Content delivery - optimized for speed and caching

Supported Sports & Leagues

The ESPN API covers a wide range of sports and leagues. Here are the most commonly used:

Football

  • NFL (football/nfl)
  • College Football (football/college-football)

Basketball

  • NBA (basketball/nba)
  • WNBA (basketball/wnba)
  • Men's CBB (basketball/mens-college-basketball)
  • Women's CBB (basketball/womens-college-basketball)

Baseball

  • MLB (baseball/mlb)
  • College Baseball (baseball/college-baseball)

Hockey

  • NHL (hockey/nhl)

Soccer

  • MLS (soccer/usa.1)
  • Premier League (soccer/eng.1)
  • La Liga (soccer/esp.1)
  • And many more...

Other Sports

  • Golf
  • Tennis
  • MMA/UFC
  • Racing

Key Endpoints

Most endpoints follow a consistent pattern: /apis/site/v2/sports/{sport}/{league}/{endpoint}

Endpoint Description Example
/scoreboard Live scores and game status /sports/football/nfl/scoreboard
/news Latest news articles /sports/basketball/nba/news
/teams All teams in a league /sports/baseball/mlb/teams
/teams/{id} Specific team details /sports/football/nfl/teams/12
/summary Game details with box score /sports/basketball/nba/summary?event=401234567
/standings League standings /sports/hockey/nhl/standings
/rankings Power rankings (college) /sports/football/college-football/rankings

Common Query Parameters

Parameter Description Example
dates Filter by date (YYYYMMDD format) ?dates=20251201
limit Maximum number of results ?limit=50
season Specific season year ?season=2025
seasontype Season type (1=preseason, 2=regular, 3=postseason) ?seasontype=2
week Specific week (football) ?week=10
groups Conference/division filter ?groups=80 (FBS)

Code Examples

Here are practical examples for fetching data from the ESPN API:

Get NFL Scores

JavaScript
// Fetch today's NFL scores
fetch('https://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard')
  .then(response => response.json())
  .then(data => {
    data.events.forEach(game => {
      console.log(game.name, game.status.type.description);
    });
  });
Python
import requests

# Fetch today's NFL scores
url = 'https://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard'
response = requests.get(url)
data = response.json()

for game in data['events']:
    print(game['name'], game['status']['type']['description'])
cURL
# Fetch today's NFL scores
curl 'https://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard'

Get NBA Game Summary

JavaScript
// Fetch detailed game data (replace eventId with actual game ID)
const eventId = '401584793';
const url = `https://site.web.api.espn.com/apis/site/v2/sports/basketball/nba/summary?event=${eventId}`;

fetch(url)
  .then(response => response.json())
  .then(data => {
    console.log('Boxscore:', data.boxscore);
    console.log('Play-by-play:', data.plays);
  });
Python
import requests

# Fetch detailed game data
event_id = '401584793'
url = f'https://site.web.api.espn.com/apis/site/v2/sports/basketball/nba/summary?event={event_id}'

response = requests.get(url)
data = response.json()

print('Boxscore:', data.get('boxscore'))
print('Play-by-play:', data.get('plays'))

Get Scores for Specific Date

JavaScript
// Fetch MLB scores for a specific date
const date = '20251001'; // YYYYMMDD format
fetch(`https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard?dates=${date}`)
  .then(response => response.json())
  .then(data => console.log(data));

Limitations & Considerations

Important: Unofficial API

The ESPN API is not officially supported. Keep these limitations in mind:

Recommendations

  • For Hobby Projects: The ESPN API works great for personal projects, learning, and experimentation
  • For Production Apps: Consider official sports data providers for applications requiring guaranteed uptime and support
  • Error Handling: Implement robust error handling since endpoints may change unexpectedly
  • Caching: Cache responses to reduce API calls and improve reliability

Browse Official API Providers →

Community Resources

These community-maintained resources provide additional documentation and tools for working with the ESPN API:

Frequently Asked Questions

Does ESPN have a free API?

ESPN does not offer an official public API, but developers have discovered undocumented endpoints that provide free access to scores, stats, news, and standings data. These hidden APIs require no authentication or API key, making them accessible for personal projects and experimentation.

Is the ESPN API official?

No. The ESPN API endpoints discussed here are unofficial and undocumented. They were discovered by reverse-engineering ESPN's web and mobile applications. ESPN does not provide official API documentation, support, or any service level agreements for these endpoints.

What sports does the ESPN API cover?

The ESPN API covers NFL, NBA, MLB, NHL, WNBA, college football, men's and women's college basketball, college baseball, MLS, international soccer leagues (Premier League, La Liga, Bundesliga, Serie A, etc.), golf, tennis, MMA/UFC, racing, and many other sports.

Do I need an API key for the ESPN API?

No. The ESPN hidden API endpoints are publicly accessible and do not require authentication, API keys, or tokens. You can make simple HTTP GET requests to retrieve data. However, private fantasy league data may require authentication cookies.

Is the ESPN API reliable for production use?

The ESPN API is not recommended for production applications that require guaranteed stability and uptime. Since these are unofficial endpoints, ESPN can modify or remove them at any time without notice. For production applications, consider using official sports data providers that offer documentation, support, and SLAs.

How do I get NBA scores from the ESPN API?

To get NBA scores, make a GET request to: https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard. The response includes all games for the current day with scores, team info, and game status. Add ?dates=YYYYMMDD to get scores for a specific date.

Need More Reliable Sports Data?

While the ESPN API is great for hobby projects, production applications often need guaranteed uptime and official support. Compare professional sports data providers in our directory.