SportAPINBAGet SportAPI Key

Miami Heat

Coach
Erik Spoelstra
Arena
Kaseya Center
Conference
Eastern
5-6Record
7thEastern
W2Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
7Giannis AntetokounmpoF6-111132.727.712.65.256.922.2
13Bam AdebayoC6-91133.217.88.43.350.717.1
2Davion MitchellG6-01135.716.52.08.549.340.3
11Klay ThompsonG6-51124.714.41.51.942.940.8
9Pelle LarssonG6-51129.511.43.53.546.846.9
22Andrew WigginsF6-71125.78.72.71.542.733.3
95Bobby PortisF6-91120.46.85.81.736.431.8
10Tim Hardaway Jr.G6-51014.74.61.40.627.523.7
4Ryan ConwellG6-3912.44.21.21.234.334.6
12Dru SmithG6-268.52.50.81.344.450.0
5Nikola JovicF6-10810.62.12.40.930.010.0
8Nick RichardsC6-1152.01.40.40.2100.0100.0
15Myron GardnerF6-563.31.31.00.350.00.0
0Simone FontecchioF6-754.01.20.20.020.012.5
16Keshad JohnsonF6-60––––––
24Tre DonaldsonG6-20––––––
50Vladislav GoldinC7-00––––––

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 Miami Heat is 9 and the slug is miami-heat. /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/miami-heat", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

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