SportAPINBAGet SportAPI Key

Dallas Mavericks

Coach
Dusty May
Arena
American Airlines Center
Conference
Western
7-5Record
10thWestern
L1Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
32Cooper FlaggF6-91133.524.66.96.549.530.0
11Kyrie IrvingG6-21030.221.63.24.347.939.5
25P.J. WashingtonF6-71232.314.37.31.141.835.1
3Naji MarshallF6-6924.611.32.84.447.128.6
21Daniel GaffordF6-101221.69.15.31.970.5100.0
34Santi AldamaF7-0414.38.34.00.846.230.8
10Zaccharie RisacherF6-81224.38.35.11.542.629.5
1Walter Clayton Jr.G6-41117.17.03.03.542.637.1
14Morez Johnson Jr.F6-91116.76.94.81.248.320.0
8Marcus SasserG6-11015.75.61.11.743.832.1
0Max ChristieG6-51118.65.32.91.233.327.3
55Sergio de LarreaF6-7411.85.32.01.350.060.0
16Caleb MartinF6-5818.84.02.31.846.246.2
9Jett HowardG6-862.82.50.20.045.537.5
30Moussa CisseC6-1183.81.50.80.166.7–
33Tobi LawalF6-874.01.31.00.344.425.0
2Dereck Lively IIC7-10––––––
13Tarik BiberovicF6-70––––––

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 Dallas Mavericks is 24 and the slug is dallas-mavericks. /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/dallas-mavericks", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

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