ESPN Teams Data
Teams 
Smells like team spirit
-
The ESPN Teams API enables you to get information, including roster, stats, and more, for individual teams. You can also fetch teams by conference or division.
This API is currently a version 1 (/v1/) release.
Availability Public Partner Premium Partner ESPN This API is great for:
- Team applications
- Displaying roster information
- Printing team records and stats
- Building division/conference applications
- Fetching athlete IDs per team
- Fetching team IDs by conference/division
-
The ESPN Teams API accepts a GET request.
Team information is available for most major sports.
The format of an API request is as follows:
http://api.espn.com/:version/:resource/:method?apikey=:yourkeySample Teams Requests
Action URI Description GET http://api.espn.com/v1/sports/baseball/mlb/teams All MLB teams. GET http://api.espn.com/v1/sports/baseball/mlb/teams/2 Specific MLB team. GET http://api.espn.com/v1/sports/baseball/mlb/teams/2?enable=roster Specific MLB team, including the current roster. Subject to access tier. GET http://api.espn.com/v1/sports/baseball/mlb/teams?groups=1 All teams within the American League East division in MLB. GET http://api.espn.com/v1/sports/baseball/mlb/teams?groups=1&lang=es All teams within the American League East division in MLB, with Spanish-language option enabled. -
Quick Navigation
Resources
Back to topResource Name Description
Availabilitypublic partner premium
partnerespn /sports/baseball/mlb Major League Baseball (MLB) /sports/basketball/mens-college-basketball NCAA Men's College Basketball /sports/basketball/nba National Basketball Association (NBA) /sports/basketball/wnba Women's National Basketball Association /sports/basketball/womens-college-basketball NCAA Women's College Basketball /sports/football/college-football NCAA College Football /sports/football/nfl National Football League (NFL) /sports/hockey/nhl National Hockey League (NHL) /sports/soccer/:leagueName Specific professional soccer league. Use a helper API call for a complete list of supported soccer leagues. Methods
Back to topURI Parameters
Back to top -
Quick Navigation
- Returned Data
- General Stats Extension
- College Basketball (Men) Stats Extension
- College Football Stats Extension
- MLB Stats Extension
- NBA Stats Extension
- NFL Stats Extension
- NHL Stats Extension
- Soccer Stats Extension
- Sample Response
Returned Data
Requests to this API return the following information.
Back to topElement Description
Availabilitypublic partner premium
partnerespn sports A collection of sports associated with the request, e.g. "baseball." Contains a leagues collection and also has the following properties: name The name of the sport, e.g. "Baseball." id the ID of the sport in the ESPN API. leagues Collection within 'sports' that contains a 'teams' collection and also the following properties: id the ID of the sport in ESPN's meta-tagging system. groupId The ID, unique to the selected organizing body, of the conference/division being used. name the name of the league/conference/division, e.g. "American League East." shortName Shorter version of the league/conference/division. abbreviation the abbreviation for the league/conference/division, e.g. "al" for "American League." teams Collection of team objects within 'leagues' containing all the properties below: id The team's ID within that sport. location The team's location, e.g. "New York." name The team's nickname, e.g. "Yankees." abbreviation The team's abbreviation, e.g. "nyy." color Hexadecimal value of the team's identifying color, e.g. "00314B" logos Collection of team logos as specified below, each containing href, width, and height attributes. Note that soccer support is limited international teams and the following leagues: Spanish Primera Division (esp.1), English Premier League (eng.1), Italian Serie A (ita.1), Portuguese Liga (por.1), and Mexico (mex.1) . full Largest, non-resized team logo available, currently 500x500. large 110x110 team logo medium 80x80 team logo small 50x50 team logo xsmall 40x40 team logo xxsmall 25x25 team logo record Object containing the following data: summary A string representation of the team's record, e.g. "75-42". wins Wins for the season specified. losses Losses for the season specified. ties Ties for the season specified (where applicable). overTimeLosses Overtime (or extra inning) losses for the season specified. Not applicable for all sports. season Object containing the follow properties: year - the calendar year in which the majority of the sport's season is played. type - Integer corresponding to the season type (1 = preseason, 2 = regular season, 3 = postseason). description - String representation of the season type (e.g. "regular" for season type = 2). startDate - date for which the season starts for this sport/league. endDate - date for which the season ends for this sport/league. ranks When enabled, returns an array of rank objects containing the following properties: type Enum value indicating the type of ranking. Possible values across sports include "power" (ESPN Power Rankings), "ap" (AP Poll), "bcs" (BCS Ranking)", "seed" (Seed in current tournament), etc. name Text description of the ranking type. value Integer value of the ranking, e.g. 27. roster When enabled, contains a collection of athletes. See the Athlete API for details. leaders When enabled, contains a collection of season stat leaders for the team. Data includes: stat id firstName lastName links Collection of relevant API endpoints links Collection of relevant API endpoints and canonical URLs for the team The following tables outline the statistics returned for various sports when the "statistics" property is enabled.
General Stats Extension
Back to topCollege Basketball Stats Extension
Back to topCollege Football Stats Extension
Back to topMLB Stats Extension
Back to topNBA Stats Extension
Back to topNFL Stats Extension
Back to topNHL Stats Extension
Back to topSoccer Stats Extension
Back to topSample Response
Back to topXMLThe following XML output was rendered with a public key calling:
http://api.espn.com/v1/sports/basketball/nba/teams/2?apikey=:yourkey.JSONThe following JSON output was rendered with a public key calling:
http://api.espn.com/v1/sports/basketball/nba/teams/2?apikey=:yourkey. -
Sample Code
JavaScript// Example JSONP request with jQuery $.ajax({ url: "http://api.espn.com/v1/sports/baseball/mlb/teams", data: { // enter your developer api key here apikey: "{api key}", // the type of data you're expecting back from the api _accept: "application/json" }, dataType: "jsonp", success: function(data) { // create an unordered list of headlines var ul = $('<ul/>'); $.each(data.name, function() { var li = $('<li/>').text(this.name); ul.append(li) }); // append this list to the document body $('body').append(ul); }, error: function() { // handle the error } });