SportAPINBAGet SportAPI Key

Houston Rockets

Coach
Ime Udoka
Arena
Toyota Center (Houston)
Conference
Western
9-3Record
4thWestern
W2Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
28Alperen SengunC6-111035.021.19.47.951.947.6
7Kevin DurantF6-111234.320.96.13.749.434.8
10Jabari Smith Jr.F6-111234.916.86.62.249.042.1
1Amen ThompsonG6-71233.015.36.73.151.820.0
5Fred VanVleetG6-01030.113.73.15.643.038.7
15Reed SheppardG6-2920.110.11.72.639.333.3
17Tari EasonF6-81223.89.35.71.340.623.3
36Marcus SmartG6-3921.38.32.62.043.940.0
31Bogdan BogdanovicG6-51211.44.81.20.850.048.0
12Steven AdamsC6-1119.04.02.01.0100.0–
30Clint CapelaC6-10614.23.25.21.564.3–
9Oscar TshiebweC6-876.02.41.70.488.9–
27Isaiah CrawfordF6-684.11.80.10.055.650.0
2Bruce ThorntonG6-082.91.50.10.055.650.0
8Jae'Sean TateF6-472.40.00.70.10.00.0
3Julian PhillipsF6-60––––––
25Quadir CopelandG6-60––––––

Per-game averages in the NBA regular season so far. Players without a game have dashes.

Get this team's data from the API

The team ID of the Houston Rockets is 18 and the slug is houston-rockets. /api/basketball/teams/slug/{slug} returns the coach, the arena, the standing and the latest and next games. The roster is at /api/basketball/teams/{id}/roster and every game of the team at /api/basketball/teams/{id}/games, newest first. The averages in the roster table on this page come from each player's profile at /api/basketball/players/slug/{slug}.

team.py
import requests

API_KEY = "YOUR_API_KEY"
session = requests.Session()
session.headers["X-API-Key"] = API_KEY
BASE = "https://sportapi.ai/api/basketball"

team = session.get(f"{BASE}/teams/slug/houston-rockets", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

roster = session.get(f"{BASE}/teams/18/roster", timeout=20).json()["data"]
for p in roster:
    print(p["jersey"], p["name"], p["position"], p["height_cm"], "cm")

games = session.get(f"{BASE}/teams/18/games", params={"league": "nba", "limit": 5}, timeout=20).json()["data"]
for g in games:
    print(g["start"], g["away"]["abbreviation"], "@", g["home"]["abbreviation"], g["status"])

The API documentation lists every basketball endpoint. The same key works for the NBA, WNBA, EuroLeague, NCAA and the other leagues, and for football too.

Updated Nov 13, 11:45 AM ET