GET
/api/playersRetrieve a list of NBA 2K players with optional filtering and pagination.
Query Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
| teamType | curr | class | allt | Filter by team type (current, classic, all-time) | curr |
| team | string | Filter by team name | - |
| position | string | Filter by position (PG, SG, SF, PF, C) | - |
| minRating | number | Minimum overall rating (0-99) | - |
| maxRating | number | Maximum overall rating (0-99) | - |
| limit | number | Number of results to return (max 100) | 50 |
| cursor | string | Pagination 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
| Field | Type | Description |
|---|---|---|
| _id | string | Unique player identifier |
| name | string | Player's full name |
| slug | string | URL-friendly identifier (e.g., "lebron-james") |
| overall | number | Overall player rating (0-99) |
| positions | string[] | Player positions (PG, SG, SF, PF, C) |
| team | string | Team name |
Related Endpoints
GET /api/players/slug/:slug- Get a single player by slug (use?teamType=class&team=Team Namefor players on multiple teams)GET /api/players/search- Search players by nameGET /api/teams- Get all teams