Skip to main content

NBA & WNBA recipes

Basketball lives under sdv.nba and sdv.wnba. Both expose the full ESPN cross-league surface โ€” scoreboard, team roster, the 21-section summary dispatcher, standings, rankings, and more โ€” under espnNba* / espnWnba* method names. Pass { parsed: true } for tidy rows.

Today's scoreboardโ€‹

import sdv from 'sportsdataverse';

const games = await sdv.nba.espnNbaScoreboard({ parsed: true });
console.table(games);

The cell below is the same call, live and inline โ€” edit a param, hit Run โ–ถ, and the response is parsed into tidy rows right here (no copy-paste, no leaving the page). It runs against the deployed site's proxy.

Loading live cellโ€ฆ

Open in playground โ–ถ

A full team rosterโ€‹

team_id 13 is the Lakers. One row per player.

import sdv from 'sportsdataverse';

const roster = await sdv.nba.espnNbaTeamRoster({ team_id: 13, parsed: true });
console.table(roster);
Loading live cellโ€ฆ

Open in playground โ–ถ

Drill into a game (summary dispatcher)โ€‹

The summary endpoint returns many sub-frames. Pull one with section:

import sdv from 'sportsdataverse';

const sb = await sdv.nba.espnNbaScoreboard({});
const id = sb.events[0].id;

const boxscore = await sdv.nba.espnNbaSummary({
event_id: id,
parsed: true,
section: 'boxscore_team',
});
console.table(boxscore);

Open in playground โ–ถ

Frozen output (real summary sub-frame, no network)โ€‹

The table below is real summary-dispatcher output โ€” the leaders sub-frame, rendered at build time from a committed ESPN fixture and frozen into this page (deterministic; CI reproduces it exactly). Regenerate with npm run docs:examples.

sdv.nba.espnNbaSummary({ event_id, parsed: true, section: 'leaders' }) โ€” the leaders sub-frame of the 21-section summary dispatcher.

team_idteam_abbreviationcategory_namecategory_display_nameathlete_idathlete_display_name
19ORLpointsPoints4432573Paolo Banchero
19ORLassistsAssists4432573Paolo Banchero
19ORLreboundsRebounds4566434Franz Wagner
28TORpointsPoints4277883Jordan Nwora
28TORassistsAssists4395724Immanuel Quickley
28TORreboundsRebounds4277883Jordan Nwora

6 rows, 12 cols total โ€” first 6 shown.

WNBA โ€” same surface, different namespaceโ€‹

import sdv from 'sportsdataverse';

const wnba = await sdv.wnba.espnWnbaScoreboard({ parsed: true });
console.table(wnba);

Open in playground โ–ถ

tip

Full method + parameter tables: NBA reference and WNBA reference.