SportAPINBAGet SportAPI Key

Toronto Raptors

Coach
Darko Rajakovic
Arena
Scotiabank Arena
Conference
Eastern
5-7Record
8thEastern
L3Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
4Scottie BarnesF6-8833.423.57.65.147.515.4
9RJ BarrettF6-61233.421.36.74.246.230.2
2Kawhi LeonardF6-6226.019.57.01.533.328.6
5Immanuel QuickleyG6-21031.017.63.65.640.032.1
14Ja'Kobe WalterG6-41230.311.14.21.938.433.8
30Collin Murray-BoylesF6-71122.910.54.51.747.331.8
77Jamison BattleF6-71219.39.71.50.548.843.3
19Jakob PoeltlC7-01023.98.36.71.361.7–
23Jamal SheadG6-11223.86.82.16.832.924.4
55Alijah MartinG6-21112.36.51.81.065.056.5
22Allen GravesF6-81213.34.62.50.743.529.2
32Trayce Jackson-DavisF6-997.33.12.70.470.6–
8Jaden BradleyG6-394.71.70.60.942.9–
12Kyle AndersonF6-897.61.61.21.646.7–
18Malachi SmithG6-421.50.00.00.00.00.0
9Kevin McCullar Jr.G6-60––––––
12Nate BittleC7-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 Toronto Raptors is 25 and the slug is toronto-raptors. /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/toronto-raptors", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

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