pseudo-r / Public-ESPN-API

The ESPN API documentation provides a list of available API endpoints and the parameters they accept. It also includes examples of how to call the API endpoints, as well as the expected response format.
57 stars 6 forks source link

DISCLAIMER:

This is a public API provided by ESPN, and I am not affiliated with ESPN or responsible for any usage of this API. This information is provided solely for educational and informational purposes. Please use this API responsibly and abide by ESPN's terms of service.

Public ESPN API Endpoints

The ESPN API provides access to a wide range of sports-related data and content, including news, scores, schedules, and standings. Here are some of the available endpoints:

General Endpoints

Tennis

Sports

News

Scores

Standings

Athletes

https://site.web.api.espn.com/apis/site/v2/sports/{sport}/{league}/athletes/{id}: Returns information about the specified athlete. Replace {sport} with the sport slug, {league} with the league slug, and {id} with the athlete ID. Example: https://site.web.api.espn.com/apis/site/v2/sports/football/nfl/athletes/13982

Teams

Events

Videos

Example: https://site.web.api.espn.com/apis/site/v2/sports/football/nfl/videos

Endpoints

Sports

Returns information about the available sports.

Endpoint: https://site.api.espn.com/apis/site/v2/sports

Example: https://site.api.espn.com/apis/site/v2/sports

Leagues

Returns information about the available leagues for a specific sport.

Endpoint: https://site.api.espn.com/apis/site/v2/sports/{sport}

Replace {sport} with the sport slug (e.g. baseball, basketball, football).

Example: https://site.api.espn.com/apis/site/v2/sports/football

Teams

Returns information about the teams for a specific league.

Endpoint: https://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/teams

Replace {sport} with the sport slug (e.g. baseball, basketball, football) and {league} with the league slug (e.g. mlb, nba, nfl).

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

Standings

Returns the current standings for a specific league.

Endpoint: https://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/standings

Replace {sport} with the sport slug (e.g. baseball, basketball, football) and {league} with the league slug (e.g. mlb, nba, nfl).

Example: https://site.api.espn.com/apis/site/v2/sports/football/nfl/standings

Events

Returns information about the events for a specific league.

Endpoint: https://site.web.api.espn.com/apis/v2/sports/{sport}/{league}/scoreboard

Replace {sport} with the sport slug and {league} with the league slug.

Example: https://site.web.api.espn.com/apis/v2/sports/football/nfl/events

Videos

Returns the latest videos for a specific sport and league.

Endpoint: https://api.espn.com/v1/sports/{sport}/{league}/videos

Replace {sport} with the sport slug and {league} with the league slug.

Example: https://api.espn.com/v1/sports/football/nfl/videos

Player and Player Stats Information

Unfortunately, it does not seem like there is a public ESPN API endpoint for retrieving player and player stats information for baseball. If you come across any new information, please feel free to share.