SportAPINBAGet SportAPI Key

Cleveland Cavaliers

Coach
Kenny Atkinson
Arena
Rocket Arena
Conference
Eastern
6-6Record
6thEastern
W1Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
45Donovan MitchellG6-21232.822.85.05.548.537.6
4Evan MobleyC6-111231.916.97.23.655.547.9
1James HardenG6-51232.616.94.55.639.539.3
15Meleek ThomasG6-3922.813.12.81.247.948.0
31Jarrett AllenC6-91025.212.98.31.464.175.0
8Peyton WatsonG6-81027.811.04.62.738.023.8
3Thomas BryantC6-9612.28.72.20.250.044.4
33Mario HezonjaF6-81219.07.85.41.542.228.6
5Sam MerrillG6-4923.07.73.41.938.632.6
20Jaylon TysonG6-6621.27.03.02.538.622.2
24Tyrese ProctorG6-41117.26.82.82.149.148.3
12Riley MinixF6-7310.33.32.70.036.425.0
21Tristan EnarunaF6-8310.02.31.70.330.00.0
9Craig Porter Jr.G6-199.91.61.71.354.525.0
15Norchad OmierC6-726.50.02.51.00.00.0
88Ernest Udeh Jr.C6-90––––––
33Nae'Qwan TomlinF6-80––––––

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 Cleveland Cavaliers is 26 and the slug is cleveland-cavaliers. /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/cleveland-cavaliers", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

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