SportAPINBAGet SportAPI Key

New York Knicks

Coach
Mike Brown
Arena
Madison Square Garden
Conference
Eastern
6-5Record
5thEastern
L1Streak

Roster

No.PlayerPosHtGPMinPtsRebAstFG%3P%
11Jalen BrunsonG6-21133.526.03.15.243.036.7
32Karl-Anthony TownsC7-01131.320.913.53.555.039.6
8OG AnunobyF6-71132.816.55.42.438.833.3
44Landry ShametG6-51125.89.61.62.146.242.1
3Josh HartG6-5831.08.36.93.838.531.7
2Miles McBrideG6-21118.97.91.51.244.844.2
00Jordan ClarksonG6-5910.46.01.80.651.160.0
25Mikal BridgesG6-61124.45.93.22.132.926.5
0Andre DrummondC6-111113.54.38.11.441.70.0
99Dalton KnechtF6-639.74.32.30.362.550.0
13Tyler KolekG6-2912.83.41.84.942.931.3
4Pacome DadietF6-944.03.00.80.055.625.0
51Mohamed DiawaraF6-9611.82.82.21.731.614.3
5Jose AlvaradoG6-0510.22.01.21.626.725.0
35James WisemanC6-1155.01.62.40.040.0–
14Jaden AkinsG6-421.00.00.00.0––
55Tyler NickelF6-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 New York Knicks is 1 and the slug is new-york-knicks. /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/new-york-knicks", timeout=20).json()["data"]
print(team["name"], "- coach", team["coach_name"])

roster = session.get(f"{BASE}/teams/1/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/1/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