GET/api/players

Retrieve a list of NBA 2K players with optional filtering and pagination.

Query Parameters

ParameterTypeDescriptionDefault
teamTypecurr | class | alltFilter by team type (current, classic, all-time)curr
teamstringFilter by team name-
positionstringFilter by position (PG, SG, SF, PF, C)-
minRatingnumberMinimum overall rating (0-99)-
maxRatingnumberMaximum overall rating (0-99)-
limitnumberNumber of results to return (max 100)50
cursorstringPagination cursor from previous response-

Example Request

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

const data = await response.json();
console.log(data.data); // Array of top 10 current players rated 90+

Example Response

{
  "success": true,
  "data": [
    {
      "_id": "abc123",
      "name": "LeBron James",
      "slug": "lebron-james",
      "team": "Los Angeles Lakers",
      "teamType": "curr",
      "overall": 97,
      "positions": ["SF", "PF"],
      "height": "6'9\"",
      "weight": "250 lbs",
      "playerImage": "https://...",
      "teamImg": "https://...",
      "closeShot": 92,
      "midRangeShot": 88,
      "threePointShot": 44,
      "freeThrow": 70,
      "shotIQ": 95,
      "offensiveConsistency": 95,
      // ... 30+ more attributes
      "lastUpdated": "2025-01-15T00:00:00.000Z"
    },
    // ... more players
  ],
  "pagination": {
    "hasMore": true,
    "nextCursor": "abc123",
    "count": 10,
    "limit": 10
  },
  "meta": {
    "timestamp": "2025-01-15T00:00:00.000Z"
  }
}

Response Fields

FieldTypeDescription
_idstringUnique player identifier
namestringPlayer's full name
slugstringURL-friendly identifier (e.g., "lebron-james")
overallnumberOverall player rating (0-99)
positionsstring[]Player positions (PG, SG, SF, PF, C)
teamstringTeam name

Related Endpoints

  • GET /api/players/slug/:slug- Get a single player by slug (use ?teamType=class&team=Team Name for players on multiple teams)
  • GET /api/players/search- Search players by name
  • GET /api/teams- Get all teams