Documentation of API-NBA [V2]
So as a great fan of Basketball and a lover of the MERN stack technology, I decided to build a simple NBA scorebaord project, which will…
Table of ContentsHow to get access to the NBA API1. Sign Up for a RapidAPI User Account2. Navigate to the NBA API Console3. Subscribe to the NBA APIHow To Use the NBA API with PythonNBA API Endpoints OverviewGetting the NBA Team Standings DataHow to Build a Team Standings Chart App for the NBA SeasonPrerequisitesPython LibrariesCoding …
News, projections and advanced analytics for NBA DFS.
All NBA Stats DATA, Games, Livescore, Standings, Statistics, Teams, Players, Seasons, Leagues. Documentation : https://api-sports.io/documentation/nba/v2
Review the https://rapidapi.com/api-sports/api/api-nba NBA API docs and learn https://blog.rapidapi.com/nba-basketball-stats-api how to use the API.
All {season}
can be used in other endpoints as filters
This endpoint does not require any parameters
GET
AllGet all available {season}
get("https://api-nba-v1.p.rapidapi.com/seasons/");
{
"api": {
"status": 200,
"message": "GET seasons/",
"results": 5,
"filters": [],
"seasons": [
"2015",
"2016",
"2017",
"2018",
"2019"
]
}
}
All {leagues}
can be used in other endpoints as filters
This endpoint does not require any parameters
GET
AllGet all available {leagues}
get("https://api-nba-v1.p.rapidapi.com/leagues/");
{
"api": {
"status": 200,
"message": "GET leagues/",
"results": 6,
"filters": [],
"leagues": [
"africa",
"orlando",
"sacramento",
"standard",
"utah",
"vegas"
]
}
}
The team {id}
are unique in the API
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>teamId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
<tr>
<td>league</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>city</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>shortName</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>nickName</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>confName</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>divName</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
</table>
GET
By teamIdGet one team from one team {teamId}
get("https://api-nba-v1.p.rapidapi.com/teams/teamId/1");
GET
By leagueGet one team from one team {league}
get("https://api-nba-v1.p.rapidapi.com/teams/league/standard");
GET
By cityGet all teams from one {city}
get("https://api-nba-v1.p.rapidapi.com/teams/city/Atlanta");
GET
By shortNameGet one team from one {shortName}
get("https://api-nba-v1.p.rapidapi.com/teams/shortName/ATL");
GET
By nickNameGet one team from one {nickName}
get("https://api-nba-v1.p.rapidapi.com/teams/nickName/Hawks");
GET
By confNameGet all teams from one {confName}
get("https://api-nba-v1.p.rapidapi.com/teams/confName/East");
GET
By divNameGet all teams from one {divName}
get("https://api-nba-v1.p.rapidapi.com/teams/divName/Southeast");
{
"api": {
"status": 200,
"message": "GET teams/teamId/1",
"results": 1,
"filters": [
"teamId",
"league",
"city",
"shortName",
"nickName",
"confName",
"divName"
],
"teams": [
{
"city": "Atlanta",
"fullName": "Atlanta Hawks",
"teamId": 1,
"nickname": "Hawks",
"logo": "https://upload.wikimedia.org/wikipedia/fr/e/ee/Hawks_2016.png",
"shortName": "ATL",
"allStar": 0,
"nbaFranchise": 1,
"leagues": {
"standard": {
"confName": "East",
"divName": "Southeast"
},
"vegas": {
"confName": "summer",
"divName": null
},
"utah": {
"confName": "Utah",
"divName": null
}
}
}
]
}
}
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>league</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
<tr>
<td>season</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer [YYYY]</td>
</tr>
<tr>
<td>teamId</td>
<td>integer</td>
<td>false</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
<tr>
<td>conference</td>
<td>string</td>
<td>false</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>division</td>
<td>string</td>
<td>false</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
</table>
GET
By leagueGet all Standings from one {league}
& {season}
get("https://api-nba-v1.p.rapidapi.com/standings/standard/2019");
GET
By league & teamIdGet all Standings from one {league}
& {season}
& {teamId}
get("https://api-nba-v1.p.rapidapi.com/standings/standard/2019/teamId/1");
GET
By league & conferenceGet all Standings from one {league}
& {season}
& {conference}
get("https://api-nba-v1.p.rapidapi.com/standings/standard/2019/conference/east");
GET
By league & divisionGet all Standings from one {league}
& {season}
& {division}
get("https://api-nba-v1.p.rapidapi.com/standings/standard/2019/division/southeast");
{
"api": {
"status": 200,
"message": "GET standings/standard/2019",
"results": 30,
"filters": [
"conference",
"division",
"teamId"
],
"standings": [
{
"league": "standard",
"teamId": 26,
"win": 7,
"loss": 10,
"gamesBehind": "7.5",
"lastTenWin": 5,
"lastTenLoss": 5,
"streak": 1,
"seasonYear": 2019,
"conference": {
"name": "east",
"rank": 8,
"win": 5,
"loss": 7
},
"division": {
"name": "southeast",
"rank": 2,
"win": 1,
"loss": 1,
"GamesBehind": "5.0"
},
"winPercentage": ".412",
"lossPercentage": ".588",
"home": {
"win": 6,
"loss": 3
},
"away": {
"win": 1,
"loss": 7
},
"winStreak": 1,
"tieBreakerPoints": null
}
]
}
}
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>gameId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
<tr>
<td>date</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than a valid date [YYYY-MM-DD]</td>
</tr>
<tr>
<td>live</td>
<td>none</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>teamId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
<tr>
<td>season</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer [YYYY]</td>
</tr>
<tr>
<td>league</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>league</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
</table>
GET
By gameIdGet games from one game {gameId}
get("https://api-nba-v1.p.rapidapi.com/games/gameId/6642");
GET
By liveGet all available games in play
get("https://api-nba-v1.p.rapidapi.com/games/live/");
GET
By leagueGet all available games from one {league}
& {season}
get("https://api-nba-v1.p.rapidapi.com/games/league/standard/2019");
GET
By teamIdGet all available games from one {teamId}
get("https://api-nba-v1.p.rapidapi.com/games/teamId/1");
GET
By dateGet all available games from one {date}
get("https://api-nba-v1.p.rapidapi.com/games/date/2019-11-28");
{
"api": {
"status": 200,
"message": "GET games/gameId/6642",
"results": 1,
"filters": [
"seasonYear",
"league",
"gameId",
"teamId",
"date",
"live"
],
"games": [
{
"seasonYear": "2019",
"league": "standard",
"gameId": "6642",
"startTimeUTC": "2019-11-28T00:00:00.000Z",
"endTimeUTC": "2019-11-28T02:43:00.000Z",
"arena": "TD Garden",
"city": "Boston",
"country": "USA",
"clock": "",
"gameDuration": "2:15",
"currentPeriod": "4/4",
"halftime": "0",
"EndOfPeriod": "0",
"seasonStage": "2",
"statusShortGame": "3",
"statusGame": "Finished",
"vTeam": {
"teamId": "4",
"shortName": "BKN",
"fullName": "Brooklyn Nets",
"nickName": "Nets",
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Brooklyn_Nets_newlogo.svg/130pxBrooklyn_Nets_newlogo.svg.png",
"score": {
"points": "110"
}
},
"hTeam": {
"teamId": "2",
"shortName": "BOS",
"fullName": "Boston Celtics",
"nickName": "Celtics",
"logo": "https://upload.wikimedia.org/wikipedia/fr/thumb/6/65/Celtics_de_Boston_logo.svg/1024px-Celtics_de_Boston_logo.svg.png",
"score": {
"points": "121"
}
}
}
]
}
}
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>gameId</td>
<td>integer</td>
<td>false</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
</table>
GET
By gameIdGet details from one game {gameId}
get("https://api-nba-v1.p.rapidapi.com/gameDetails/6642");
{
"api": {
"status": 200,
"message": "GET gameDetails/6642",
"results": 1,
"filters": [
""
],
"game": [
{
"seasonYear": "2019",
"league": "standard",
"gameId": "6642",
"startTimeUTC": "2019-11-28T00:00:00.000Z",
"endTimeUTC": "2019-11-28T02:43:00.000Z",
"arena": "TD Garden",
"city": "Boston",
"country": "USA",
"clock": "",
"gameDuration": "2:15",
"timesTied": "",
"leadChanges": "",
"currentPeriod": "4/4",
"halftime": "0",
"EndOfPeriod": "0",
"seasonStage": "2",
"statusShortGame": "3",
"statusGame": "Finished",
"vTeam": {
"fullName": "Brooklyn Nets",
"teamId": "4",
"nickname": "Nets",
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Brooklyn_Nets_newlogo.svg/130pxBrooklyn_Nets_newlogo.svg.png",
"shortName": "BKN",
"allStar": "0",
"nbaFranchise": "1",
"score": {
"win": "9",
"loss": "9",
"seriesWin": "0",
"seriesLoss": "1",
"linescore": [
"23",
"40",
"23",
"24"
],
"points": "110"
},
"leaders": [
{
"points": "7",
"playerId": "727",
"name": "Jarrett Allen"
},
{
"rebounds": "14",
"playerId": "727",
"name": "Jarrett Allen"
},
{
"assists": "11",
"playerId": "142",
"name": "Spencer Dinwiddie"
},
{
"points": "22",
"playerId": "507",
"name": "Garrett Temple"
},
{
"assists": "4",
"playerId": "1013",
"name": "Theo Pinson"
}
]
},
"hTeam": {
"fullName": "Boston Celtics",
"teamId": "2",
"nickname": "Celtics",
"logo": "https://upload.wikimedia.org/wikipedia/fr/thumb/6/65/Celtics_de_Boston_logo.svg/1024px-Celtics_de_Boston_logo.svg.png",
"shortName": "BOS",
"allStar": "0",
"nbaFranchise": "1",
"score": {
"win": "13",
"loss": "4",
"seriesWin": "1",
"seriesLoss": "0",
"linescore": [
"30",
"27",
"34",
"30"
],
"points": "121"
},
"leaders": [
{
"points": "8",
"playerId": "886",
"name": "Daniel Theis"
},
{
"rebounds": "3",
"playerId": "886",
"name": "Daniel Theis"
},
{
"assists": "4",
"playerId": "538",
"name": "Kemba Walker"
},
{
"rebounds": "10",
"playerId": "75",
"name": "Jaylen Brown"
},
{
"assists": "2",
"playerId": "291",
"name": "Enes Kanter"
},
{
"points": "39",
"playerId": "538",
"name": "Kemba Walker"
},
{
"rebounds": "9",
"playerId": "882",
"name": "Jayson Tatum"
},
{
"assists": "5",
"playerId": "486",
"name": "Marcus Smart"
}
]
},
"officials": [
{
"name": "James Capers"
},
{
"name": "Scott Wall"
},
{
"name": "Jonathan Sterling"
}
]
}
]
}
}
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>gameId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
</table>
GET
By gameIdGet team statistics from one {gameId}
get("https://api-nba-v1.p.rapidapi.com/statistics/games/gameId/6642");
{
"api": {
"status": 200,
"message": "GET statistics/games/gameId/6642",
"results": 2,
"filters": [
"gameId"
],
"statistics": [
{
"gameId": "6642",
"teamId": "4",
"fastBreakPoints": "13",
"pointsInPaint": "38",
"biggestLead": "9",
"secondChancePoints": "10",
"pointsOffTurnovers": "14",
"longestRun": "10",
"points": "110",
"fgm": "40",
"fga": "90",
"fgp": "44.4",
"ftm": "9",
"fta": "19",
"ftp": "47.4",
"tpm": "21",
"tpa": "56",
"tpp": "37.5",
"offReb": "11",
"defReb": "27",
"totReb": "38",
"assists": "32",
"pFouls": "22",
"steals": "5",
"turnovers": "15",
"blocks": "6",
"plusMinus": "-11",
"min": "240:00"
},
{
"gameId": "6642",
"teamId": "2",
"fastBreakPoints": "21",
"pointsInPaint": "46",
"biggestLead": "13",
"secondChancePoints": "25",
"pointsOffTurnovers": "23",
"longestRun": "9",
"points": "121",
"fgm": "43",
"fga": "97",
"fgp": "44.3",
"ftm": "22",
"fta": "24",
"ftp": "91.7",
"tpm": "13",
"tpa": "34",
"tpp": "38.2",
"offReb": "19",
"defReb": "36",
"totReb": "55",
"assists": "23",
"pFouls": "17",
"steals": "10",
"turnovers": "14",
"blocks": "5",
"plusMinus": "11",
"min": "240:00"
}
]
}
}
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>playerId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
<tr>
<td>teamId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
<tr>
<td>league</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>country</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>lastName</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
<tr>
<td>firstname</td>
<td>string</td>
<td>true</td>
<td>Fails if field contains anything other than alpha-numeric characters</td>
</tr>
</table>
GET
By playerIdGet one player from {playerId}
get("https://api-nba-v1.p.rapidapi.com/players/playerId/17");
GET
By teamIdGet all players from one {teamId}
get("https://api-nba-v1.p.rapidapi.com/players/teamId/6");
GET
By leagueGet all players from one {league}
get("https://api-nba-v1.p.rapidapi.com/players/league/standard");
GET
By countryGet all players from one {country}
get("https://api-nba-v1.p.rapidapi.com/players/country/spain");
GET
By lastNameGet all players from one {lastName}
get("https://api-nba-v1.p.rapidapi.com/players/lastName/Abrines");
GET
By firstNameGet all players from one {firstName}
get("https://api-nba-v1.p.rapidapi.com/players/firstName/Alex");
{
"api": {
"status": 200,
"message": "GET players/playerId/44",
"results": 1,
"filters": [
"playerId",
"teamId",
"league",
"country",
"lastName",
"firstName"
],
"players": [
{
"firstName": "Kent",
"lastName": "Bazemore",
"teamId": "29",
"yearsPro": "7",
"collegeName": "Old Dominion",
"country": "USA",
"playerId": "44",
"dateOfBirth": "1989-07-01",
"affiliation": "Old Dominion/USA",
"startNba": "2012",
"heightInMeters": "1.93",
"weightInKilograms": "88.5",
"leagues": {
"standard": {
"jersey": "24",
"active": "1",
"pos": "G-F"
}
}
}
]
}
}
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>gameId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
</table>
GET
By gameIdGet all players statistics from one {gameId}
get("https://api-nba-v1.p.rapidapi.com/statistics/players/gameId/6642");
{
"api": {
"status": 200,
"message": "GET statistics/players/gameId/6642",
"results": 26,
"filters": [
"gameId",
"playerId"
],
"statistics": [
{
"gameId": "6642",
"teamId": "4",
"points": "21",
"pos": "SF",
"min": "26:40",
"fgm": "8",
"fga": "13",
"fgp": "61.5",
"ftm": "0",
"fta": "0",
"ftp": "0.0",
"tpm": "5",
"tpa": "9",
"tpp": "55.6",
"offReb": "1",
"defReb": "4",
"totReb": "5",
"assists": "2",
"pFouls": "4",
"steals": "0",
"turnovers": "0",
"blocks": "2",
"plusMinus": "-7",
"playerId": "221"
},
{
"gameId": "6642",
"teamId": "4",
"points": "12",
"pos": "PF",
"min": "28:31",
"fgm": "4",
"fga": "10",
"fgp": "40.0",
"ftm": "0",
"fta": "0",
"ftp": "0.0",
"tpm": "4",
"tpa": "10",
"tpp": "40.0",
"offReb": "0",
"defReb": "1",
"totReb": "1",
"assists": "1",
"pFouls": "3",
"steals": "0",
"turnovers": "3",
"blocks": "0",
"plusMinus": "-14",
"playerId": "437"
}
]
}
}
<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
<tr>
<td>playerId</td>
<td>integer</td>
<td>true</td>
<td>Fails if field contains anything other than an integer</td>
</tr>
</table>
GET
By playerIdGet all players statistics from one {playerId}
get("https://api-nba-v1.p.rapidapi.com/statistics/players/playerId/175");
{
"api": {
"status": 200,
"message": "GET statistics/players/playerId/175",
"results": 235,
"filters": [
"gameId",
"playerId"
],
"statistics": [
{
"gameId": "1429",
"teamId": "8",
"points": "3",
"pos": "",
"min": "20:30",
"fgm": "1",
"fga": "3",
"fgp": "33.3",
"ftm": "0",
"fta": "2",
"ftp": "0.0",
"tpm": "1",
"tpa": "2",
"tpp": "50.0",
"offReb": "1",
"defReb": "3",
"totReb": "4",
"assists": "1",
"pFouls": "0",
"steals": "0",
"turnovers": "0",
"blocks": "1",
"plusMinus": "-4",
"playerId": "175"
},
{
"gameId": "1434",
"teamId": "8",
"points": "0",
"pos": "",
"min": "16:08",
"fgm": "0",
"fga": "3",
"fgp": "0.0",
"ftm": "0",
"fta": "0",
"ftp": "0.0",
"tpm": "0",
"tpa": "1",
"tpp": "0.0",
"offReb": "2",
"defReb": "1",
"totReb": "3",
"assists": "0",
"pFouls": "1",
"steals": "0",
"turnovers": "0",
"blocks": "1",
"plusMinus": "8",
"playerId": "175"
},
]
}
}