SportAPINBAGet SportAPI Key

Oklahoma City Thunder

Coach
Mark Daigneault
Arena
Paycom Center
Conference
Western
8-4Record
7thWestern
L2Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
2Shai Gilgeous-AlexanderG6-61232.829.74.44.545.333.8
25Ajay MitchellG6-41127.318.53.63.352.326.5
8Jalen WilliamsG6-5331.713.74.73.338.533.3
3Jared McCainG6-31226.112.73.51.940.431.1
7Chet HolmgrenC7-1330.012.09.31.340.733.3
15Aday MaraC7-31221.38.56.31.460.3100.0
55Isaiah HartensteinC7-01225.08.010.13.749.40.0
14Bennett StirtzG6-41218.67.91.11.345.745.5
9Alex CarusoG6-5919.77.64.62.950.050.0
34Kenrich WilliamsG6-71219.16.83.51.243.847.2
22Cason WallaceG6-3316.36.32.31.340.030.0
18Nique CliffordG6-5218.04.53.51.044.425.0
16Micah PeavyG6-7816.93.33.40.131.328.6
6Jaylin WilliamsF6-9718.42.94.11.620.020.8
21Josh DixG6-5714.72.31.10.433.316.7
23Brooks BarnhizerF6-685.51.31.10.642.90.0
77Dalen TerryG6-625.51.03.00.533.30.0
44Nikola TopicG6-60––––––
12Thomas SorberC6-90––––––

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 Oklahoma City Thunder is 15 and the slug is oklahoma-city-thunder. /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/oklahoma-city-thunder", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

roster = session.get(f"{BASE}/teams/15/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/15/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:57 AM ET