SportAPINBAGet SportAPI Key

San Antonio Spurs

Coach
Mitch Johnson
Arena
Frost Bank Center
Conference
Western
10-2Record
2ndWestern
W10Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
1Victor WembanyamaF7-41230.030.311.72.854.332.4
2Dylan HarperG6-51231.918.05.44.849.735.0
4De'Aaron FoxG6-31229.814.24.36.251.435.1
5Stephon CastleG6-61229.014.05.85.039.231.5
24Devin VassellG6-51030.411.93.83.140.635.6
30Julian ChampagnieF6-71226.210.33.71.445.543.6
3Keldon JohnsonF6-61224.08.05.72.344.614.3
40Harrison BarnesF6-81013.85.50.90.042.137.9
11Carter BryantF6-71110.53.70.70.637.837.0
7Luke KornetC7-11214.93.44.21.046.9–
17Ja'Kobi GillespieG6-122.02.50.00.050.033.3
10Tarris Reed Jr.C6-1085.42.02.80.358.3–
0Jordan McLaughlinG6-077.31.91.11.123.520.0
25David Jones GarciaF6-443.51.00.00.012.50.0
15Maliq BrownF6-911.00.00.01.0––
22Jayden QuaintanceF6-100––––––
23Tobias HarrisF6-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 San Antonio Spurs is 22 and the slug is san-antonio-spurs. /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/san-antonio-spurs", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

roster = session.get(f"{BASE}/teams/22/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/22/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, 12:01 PM ET