GET/api/teams

Retrieve a list of all NBA 2K teams with their rosters.

Query Parameters

ParameterTypeDescriptionDefault
teamTypecurr | class | alltFilter by team type (current, classic, all-time)curr

Example Request

const response = await fetch(
  'https://api.nba2kapi.com/api/teams?teamType=curr',
  {
    headers: {
      'X-API-Key': 'your_api_key_here'
    }
  }
);

const data = await response.json();
console.log(data.data); // Array of all current NBA teams

Example Response

{
  "success": true,
  "data": [
    {
      "teamName": "Los Angeles Lakers",
      "teamType": "curr",
      "playerCount": 17,
      "averageRating": 82.4
    },
    {
      "teamName": "Boston Celtics",
      "teamType": "curr",
      "playerCount": 16,
      "averageRating": 81.8
    },
    // ... more teams
  ]
}

Get Team Roster

To get a specific team's roster, use the team roster endpoint:

const response = await fetch(
  'https://api.nba2kapi.com/api/teams/Los%20Angeles%20Lakers/roster?teamType=curr',
  {
    headers: {
      'X-API-Key': 'your_api_key_here'
    }
  }
);

const data = await response.json();
console.log(data.data); // Array of Lakers players

Team Types

  • curr- Current NBA teams (2024-25 season)
  • class- Classic teams (historic rosters)
  • allt- All-time teams (greatest players franchise history)