SportAPINBAGet SportAPI Key

Season 2026-27

NBA scores and schedule

Today's games with live scores and the schedule for the next seven days. Tip-off times are US Eastern time.

Updated Nov 13, 12:35 PM ET

How to get NBA scores and the schedule from the API with Python

Create a free account, confirm your e-mail address and copy your API key from the dashboard. Send it in the X-API-Key header. You need Python 3 and the requests package (pip install requests). Games are at /api/basketball/games/date/{date}, one day per request. Add league=nba to get only NBA games and tz=America/New_York so that the day is the US Eastern day, like on this page. Without tz the day is UTC, and evening games on the West Coast fall on the next day.

scores.py
import requests
from datetime import date, datetime, timedelta
from zoneinfo import ZoneInfo

API_KEY = "YOUR_API_KEY"
ET = ZoneInfo("America/New_York")

session = requests.Session()
session.headers["X-API-Key"] = API_KEY

day = date.today()
for _ in range(7):
    answer = session.get(
        f"https://sportapi.ai/api/basketball/games/date/{day}",
        params={"tz": "America/New_York", "league": "nba"},
        timeout=20,
    ).json()
    for g in answer["data"]:
        tip = datetime.fromisoformat(g["start"].replace("Z", "+00:00")).astimezone(ET)
        if g["status"] == "NS":
            middle = tip.strftime("%I:%M %p ET")
        else:
            middle = f'{g["away"]["score"]}-{g["home"]["score"]} {g["status"]}'
        print(day, g["away"]["abbreviation"], "@", g["home"]["abbreviation"], middle)
    day += timedelta(days=1)

Each game in the answer has the score by quarter, the status and, during a game, the clock:

Response, shortened
{
  "success": true,
  "date": "2026-11-13",
  "tz": "America/New_York",
  "data": [
    {
      "id": 1643,
      "league": {
        "id": 1,
        "name": "NBA",
        "slug": "nba"
      },
      "season": "2026-27",
      "stage": "regular",
      "start": "2026-11-14T00:00:00Z",
      "status": "NS",
      "live": false,
      "period": null,
      "clock": null,
      "home": {
        "id": 28,
        "name": "Indiana Pacers",
        "slug": "indiana-pacers",
        "abbreviation": "IND",
        "score": null,
        "periods": []
      },
      "away": {
        "id": 1,
        "name": "New York Knicks",
        "slug": "new-york-knicks",
        "abbreviation": "NY",
        "score": null,
        "periods": []
      },
      "venue": "Gainbridge Fieldhouse"
    }
  ]
}

start is UTC. status is NS before tip-off, Q1 to Q4, HT or OT during a game, and FT or AOT (after overtime) at the end. live is true while a game is on. For only the games in progress, use /api/basketball/games/live?league=nba.

Keep your API key on the server, never in JavaScript that runs in the browser. Save each answer for a few minutes too, so that page views don't use up your daily limit. This site does both: a script saves the API answers to files, and the pages are built from those files.

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.