Updated: The API-NBA is now free to use!
Also, check out these complimentary APIs:
—
The NBA season has fully arrived.
Do you have the right basketball API that can stream live stats for your website or app?
RapidAPI has got you covered.
Check out the API-NBA API.
Today, we’ll go over the API-NBA API, its endpoints, pricing, and some related APIs.
NBA API: API-NBA
With the API-NBA API, you can integrate all types of NBA data into your application, including data for:
- NBA leagues
- teams
- players
- games (live and historical sports data)
- game details and scores
- team standings
- statistics
Use this API to stream live game statistical data or perform analysis on various NBA teams or players.
This NBA API is a great alternative to the ESPN API for NBA data and stas.
To get started on how to use the NBA API, let’s take a look at a few endpoints.
Related: NFL APIs
NBA API Endpoints
Here are some of the popular API endpoints for the API-NBA API:
GET /seasons/
This API endpoint provides all NBA seasons it has data for.
Here’s a sample JSON response:
{ "api": { "status": 200, "message": "GET seasons/", "results": 4, "filters": [], "seasons": [ "2015", "2016", "2017", "2018" ] } }
GET /leagues/
The leagues endpoint displays all the available NBA leagues.
{ "api": { "status": 200, "message": "GET leagues/", "results": 6, "filters": [], "leagues": [ "standard", "africa", "sacramento", "vegas", "utah", "orlando" ] } }
GET /teams/city/
This API endpoint provides all the teams for a specific city and provides metadata such as:
- nicknames
- logos
- number of all stars
- conference and divisions
- and more
{ "api": { "status": 200, "message": "GET teams/city/Atlanta", "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": "" }, "utah": { "confName": "Utah", "divName": "" } } } ] } }
GET /games/live/
This endpoint returns all games currently in play in real-time. See a sample response below:
{ "api": { "status": 200, "message": "GET games/live", "results": 4, "filters": [ "seasonYear", "league", "gameId", "teamId", "date", "live" ], "games": [ { "seasonYear": "2018", "league": "standard", "gameId": "0011800069", "seasonStageId": "1", "statusNum": "2", "startTimeUTC": "2018-10-12T23:00:00.000Z", "endTimeUTC": "", "arena": "Amway Center", "city": "Orlando", "country": "USA", "infos": "Preseason", "vTeam": { "teamId": "1610612759", "score": { "points": "4" } }, "hTeam": { "teamId": "1610612753", "score": { "points": "5" } } }, { "seasonYear": "2018", "league": "standard", "gameId": "0011800070", "seasonStageId": "1", "statusNum": "2", "startTimeUTC": "2018-10-12T23:00:00.000Z", "endTimeUTC": "", "arena": "Capital One Arena", "city": "Washington", "country": "USA", "infos": "Preseason", "vTeam": { "teamId": "15018", "score": { "points": "0" } }, "hTeam": { "teamId": "1610612764", "score": { "points": "0" } } }, { "seasonYear": "2018", "league": "standard", "gameId": "0011800071", "seasonStageId": "1", "statusNum": "2", "startTimeUTC": "2018-10-12T23:00:00.000Z", "endTimeUTC": "", "arena": "American Airlines Center", "city": "Dallas", "country": "USA", "infos": "Preseason", "vTeam": { "teamId": "1610612766", "score": { "points": "3" } }, "hTeam": { "teamId": "1610612742", "score": { "points": "5" } } }, { "seasonYear": "2018", "league": "standard", "gameId": "0011800075", "seasonStageId": "1", "statusNum": "2", "startTimeUTC": "2018-10-12T23:00:00.000Z", "endTimeUTC": "", "arena": "Breslin Center", "city": "East Lansing", "country": "USA", "infos": "Preseason", "vTeam": { "teamId": "1610612765", "score": { "points": "10" } }, "hTeam": { "teamId": "1610612739", "score": { "points": "3" } } } ] } }
GET /standings/teamId/
This endpoint returns a given team’s standing for a specific year and season.
{ "api": { "status": 200, "message": "GET standings/standard/2018/teamId/1", "results": 1, "filters": [ "conference", "division", "teamId" ], "standings": [ { "league": "standard", "teamId": "1", "win": "3", "loss": "11", "gamesBehind": "8.5", "lastTenWin": "1", "lastTenLoss": "9", "streak": "5", "seasonYear": "2018", "conference": { "name": "east", "rank": "14", "win": "2", "loss": "7" }, "division": { "name": "southeast", "rank": "5", "win": "1", "loss": "1", "GamesBehind": "4" }, "winPercentage": ".214", "lossPercentage": ".786", "home": { "win": "2", "loss": "4" }, "away": { "win": "1", "loss": "7" }, "winStreak": "0", "tieBreakerPoints": "" } ] } }
NBA API SDKs
The NBA API is available in many SDKs including:
Here are a few sample request snippets:
NBA API Javascript / NodeJS
unirest.get("https://api-nba-v1.p.rapidapi.com/standings/standard/2018/teamId/1") .header("X-Mashape-Key", "SIGN-UP-FOR-KEY") .header("X-Mashape-Host", "api-nba-v1.p.mashape.com") .end(function (result) { console.log(result.status, result.headers, result.body); });
NBA API Python
response = unirest.get("https://api-nba-v1.p.rapidapi.com/seasons/", headers={ "X-Mashape-Key": "SIGN-UP-FOR-KEY", "X-Mashape-Host": "api-nba-v1.p.mashape.com" } )
Related: How to use the API-NBA with Python
NBA API PHP
$response = UnirestRequest::get("https://api-nba-v1.p.rapidapi.com/seasons/", array( "X-Mashape-Key" => "SIGN-UP-FOR-KEY", "X-Mashape-Host" => "api-nba-v1.p.mashape.com" ) );
Learn more about getting started with RapidAPI SDKs here.
How much does the NBA API cost?
The API-NBA API has a freemium model, meaning it’s free up until a certain usage. This NBA API is free up to 25 daily API calls. Following that, it will cost $0.15 per additional call.
With the Basic free plan, you get access to all available endpoints except for players, gameDetails, and statistics.
With the Pro plan ($19/month), you get upgraded access to all API endpoints with a quota of 500 daily API calls ($0.1 for each additional call).
The Ultra tier ($29/month) allows for 1500 daily API calls and includes Fast Support (within a 24-hour response).
At $39/month, you can get access to the Mega plan, which allows for unlimited API calls to all endpoints and also includes Fast Support.
See below for more details:
Objects | ||||
---|---|---|---|---|
Requests | QUOTA 25 / DAILY then $0.15 each | QUOTA 500 / DAILY then $0.1 each | QUOTA 1500 / DAILY then $0.05 each | Unlimited |
Features | ||||
Seasons | ![]() | ![]() | ![]() | ![]() |
Leagues | ![]() | ![]() | ![]() | ![]() |
Teams | ![]() | ![]() | ![]() | ![]() |
Players | ![]() | ![]() | ![]() | ![]() |
Games | ![]() | ![]() | ![]() | ![]() |
GameDetails | ![]() | ![]() | ![]() | ![]() |
Standings | ![]() | ![]() | ![]() | ![]() |
Statistics | ![]() | ![]() | ![]() | ![]() |
Fast Support ![]() | ![]() | ![]() | ![]() | ![]() |
Livescore | ![]() | ![]() | ![]() | ![]() |
Related: Best Sports APIs for Developers
With this NBA API, integrating pro basketball sports data into your app or website will be a slam dunk!
Related NBA APIs:
- API-FOOTBALL
- JsonOdds API
- Live Sports Odds API
- ESPN Sports API
- CBS Sports API
- Yahoo Fantasy Sports API
- Official NBA API (Sportradar)
What other NBA APIs do you know of that provide free live game stats? How do you plan on using the API-NBA API? Let us know in the comments below!
Yes, the Free NBA API is a completely free to use API service. No API Key required and no rate restrictions.
it is not free to use