NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server →

NBA API

A basketball API for the NBA: get the schedule, live scores with the quarter and game clock on paid plans, final scores by quarter, standings with playoff seeds, and every team's roster, from the preseason through the play-in and the Finals. The free plan covers the current season's schedule, final scores, standings and rosters.

The NBA is served by the Basketball API with league=nba. The same API key works for every sports API.

NBA data at a glance

Season valueseason=2026 is the 2026-27 season
Season typespreseason, regular, cup_final (the NBA Cup championship, which does not count in the standings), play_in and postseason
Game daydate is the US Eastern date, so West Coast night games keep their US date
ScoringPoints by quarter in period_scores, with each overtime period
Live gamesOn paid plans: score, quarter, game clock and halftime or end_of_period breaks
RostersCurrent roster with position, jersey number, height, weight, birth date, college and experience
Former teamsThe New Jersey Nets appear in past seasons with their own team id; past games show the New Orleans Hornets and Charlotte Bobcats names

NBA standings fields

wins, losses, win_pct, games_behind (division leader), points_for, points_against, streak, last_10, home, road, division and conference records, and the playoff seed in conference_rank.

4 endpoints

https://api.api-ninjas.com/v1/basketballgames

Returns schedules, live scores and final scores. Ask for one day, a team's season or one game; with only league you get today's games. Paid plans see games in progress with the score, period and clock updated throughout the game; the free plan sees their status and the final score once they end. The free plan covers the current season. Developer plans add the three previous seasons, and the Business tier and above gets the full season archive.

Full parameter and response reference: /v1/basketballgames.

Live Demo

Live demo · no API key required
Query parameters
league
date
team
season
season_type
status
game_id
limit
offset

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/basketballgames?league=nba
Sample response
[
{
"game_id": "nba-20261022-cle-phi",
"league": "nba",
"sport": "basketball",
"season": 2026,
"season_label": "2026-27",
"season_type": "regular",
"date": "2026-10-22",
"start_time": "2026-10-22T23:00:00Z",
"status": "final",
"status_detail": null,
"period": 4,
"clock": null,
"home_team": {
"team_id": "nba-phi",
"name": "Philadelphia 76ers",
"abbreviation": "PHI"
},
"away_team": {
"team_id": "nba-cle",
"name": "Cleveland Cavaliers",
"abbreviation": "CLE"
},
"home_score": 114,
"away_score": 106,
"period_scores": {
"home": [
18,
27,
37,
32
],
"away": [
35,
34,
21,
16
]
},
"decided_in": "regulation",
"winner": "nba-phi",
"venue": {
"name": "Xfinity Mobile Arena",
"city": "Philadelphia",
"state": "PA",
"country": "US"
},
"neutral_site": false,
"original_date": null,
"updated_at": "2026-10-23T03:14:02Z"
}
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/basketballgames?league=nba" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/basketballstandings

Returns the league table for a season, ordered by league rank, or by conference or division rank when you filter; college tables come conference by conference. For college, poll returns a weekly poll instead: the AP Top 25 or the Coaches Poll. Tables update throughout the season, shortly after each game ends. The free plan covers the current season. Developer plans add the three previous seasons, and the Business tier and above gets the full season archive.

Full parameter and response reference: /v1/basketballstandings.

Live Demo

Live demo · no API key required
Query parameters
league
season
conference
division
poll
week

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/basketballstandings?league=nba
Sample response
[
{
"league": "nba",
"sport": "basketball",
"season": 2026,
"season_label": "2026-27",
"team": {
"team_id": "nba-okc",
"name": "Oklahoma City Thunder",
"abbreviation": "OKC"
},
"conference": "Western",
"division": "Northwest",
"games_played": 4,
"wins": 4,
"losses": 0,
"win_pct": 1,
"games_behind": 0,
"points_for": 445,
"points_against": 403,
"point_differential": 42,
"streak": "W4",
"home_record": "3-0",
"away_record": "1-0",
"division_record": "1-0",
"conference_record": "4-0",
"last_10": "4-0",
"league_rank": 1,
"conference_rank": 2,
"division_rank": 1,
"final": false
}
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/basketballstandings?league=nba" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/basketballteams

Lists teams with their league, conference, division and home venue. Available on every plan.

Full parameter and response reference: /v1/basketballteams.

Live Demo

Live demo · no API key required
Query parameters
league
team
conference
division
active

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/basketballteams?league=nba
Sample response
[
{
"team_id": "nba-bos",
"league": "nba",
"sport": "basketball",
"abbreviation": "BOS",
"name": "Boston Celtics",
"nickname": "Celtics",
"city": "Boston",
"conference": "Eastern",
"division": "Atlantic",
"venue": {
"name": "TD Garden",
"city": "Boston",
"state": "MA",
"country": "US"
},
"active": true
}
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/basketballteams?league=nba" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/basketballplayers

Returns current rosters and player profiles, by team or by name. Rosters refresh every day. Available on every plan.

Full parameter and response reference: /v1/basketballplayers.

Live Demo

Live demo · no API key required
Query parameters
league
team
name
player_id
position
limit
offset

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/basketballplayers?league=nba&team=BOS
Sample response
[
{
"player_id": "nba-p-8f12176c56",
"league": "nba",
"team": {
"team_id": "nba-bos",
"name": "Boston Celtics",
"abbreviation": "BOS"
},
"name": "Jayson Tatum",
"first_name": "Jayson",
"last_name": "Tatum",
"position": "F",
"jersey_number": "0",
"height_in": 80,
"height_cm": 203,
"weight_lb": 224,
"weight_kg": 102,
"birth_date": "1998-03-03",
"birth_place": {
"city": "Saint Louis",
"state": "MO",
"country": "US"
},
"roster_status": "active",
"college": "Duke",
"experience_years": 10
}
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/basketballplayers?league=nba&team=BOS" \ -H "X-Api-Key: YOUR_API_KEY"

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the NBA API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • The NBA does not publish a supported public API for developers. The API Ninjas Basketball API provides NBA schedules, live and final scores, standings and rosters with league=nba. API Ninjas is not affiliated with or endorsed by the NBA.
  • Call /v1/basketballgames?league=nba. Without a date it returns today's games in US Eastern time. On paid plans games in progress include the score, quarter and game clock.
  • Yes. Play-in games have season_type=play_in and playoff games season_type=postseason, in the same season as the regular season.
  • The playoff seed in the conference, with the league's tiebreakers applied. games_behind is measured from the division leader.

API Ninjas is not affiliated with or endorsed by the NFL, the NBA, the NHL, the NCAA or any other league, conference, competition, school or team. League, competition and team names are trademarks of their owners and are used only to identify them.