Quickstart
sportsdataverse is a single package that wraps ESPN plus a set of native
provider APIs (MLB Stats API, NHL api-web, The Odds API, CBS, Fox, Yahoo,
247Sports). Every method takes a single options object and returns a Promise.
// ESM-only — import the default export (there is no CommonJS `require`):
import sdv from 'sportsdataverse';
The one pattern to learn: pass { parsed: true } to get tidy rows instead
of the raw upstream JSON. Without it you get the provider's exact payload; with
it you get an array of flat row objects ready for a table or a DataFrame.
Your first call — raw vs parsed
Every endpoint accepts the same { parsed } switch. Here is the NBA scoreboard
both ways:
import sdv from 'sportsdataverse';
// Raw ESPN payload (nested events[] etc.)
const raw = await sdv.nba.espnNbaScoreboard({});
console.log(raw.events.length);
import sdv from 'sportsdataverse';
// Tidy: one flat row per game.
const rows = await sdv.nba.espnNbaScoreboard({ parsed: true });
console.table(rows.slice(0, 5));
The same { parsed: true } flag works on every method across every league
and provider. See the per-area pages in this section, or the
ESPN reference for the full method list.
A two-step workflow
Most real work is "get a list, then drill into one item". Here we take a game id off the scoreboard and pull just the team-boxscore sub-frame from the summary dispatcher:
import sdv from 'sportsdataverse';
const sb = await sdv.nba.espnNbaScoreboard({});
const eventId = sb.events[0].id;
const teamBox = await sdv.nba.espnNbaSummary({
event_id: eventId,
parsed: true,
section: 'boxscore_team',
});
console.table(teamBox);
The summary endpoint returns 21 sub-frames (boxscore_team, boxscore_player,
plays, leaders, …); pass section to pick one, or omit it to get the whole
dict.
Run it live
The cell below runs the published npm package end to end — scoreboard, then a summary drill-down — right in your browser:
const sdv = (await import('sportsdataverse')).default;
// 1) today's NBA slate
const sb = await sdv.nba.espnNbaScoreboard({});
const id = sb.events[0].id;
// 2) the team boxscore for the first game, tidied
const teamBox = await sdv.nba.espnNbaSummary({
event_id: id,
parsed: true,
section: 'boxscore_team',
});
teamBox;
RunKit cells install sportsdataverse from npm, so the v3 method names above
(espnNbaScoreboard, provider namespaces, the parsed/section options) light
up once v3 is published. Until then the embed may resolve v2, whose surface
differs. Copy any snippet into Node to run it against your installed version.
Real parsed output (frozen at build)
The tables below are real parser output, rendered at build time from
committed ESPN fixtures and frozen into this page. They are deterministic
(fixture-driven, no network) so CI reproduces them exactly — the same injector
could instead run live and refresh against today's data. Regenerate with
npm run docs:examples.
sdv.nba.espnNbaScoreboard({ parsed: true }) — one row per game.
| game_id | uid | date | name | short_name | season_year |
|---|---|---|---|---|---|
| 401704871 | s:40 | 2024-12-01T20:30Z | Orlando Magic at Brooklyn Nets | ORL @ BKN | 2025 |
| 401704872 | s:40 | 2024-12-01T20:30Z | Indiana Pacers at Memphis Grizzlies | IND @ MEM | 2025 |
| 401704873 | s:40 | 2024-12-01T23:00Z | Boston Celtics at Cleveland Cavaliers | BOS @ CLE | 2025 |
| 401704874 | s:40 | 2024-12-01T23:00Z | New Orleans Pelicans at New York Knicks | NO @ NY | 2025 |
| 401704875 | s:40 | 2024-12-01T23:00Z | Miami Heat at Toronto Raptors | MIA @ TOR | 2025 |
| 401704876 | s:40 | 2024-12-02T00:00Z | Oklahoma City Thunder at Houston Rockets | OKC @ HOU | 2025 |
| 401704877 | s:40 | 2024-12-02T01:00Z | Los Angeles Lakers at Utah Jazz | LAL @ UTAH | 2025 |
| 401704878 | s:40 | 2024-12-02T02:00Z | Dallas Mavericks at Portland Trail Bl… | DAL @ POR | 2025 |
10 rows total — first 8 shown, 50 cols total — first 6 shown.
sdv.nba.espnNbaStandings({ parsed: true }) — one row per team.
| group_name | group_abbreviation | team_id | team_name | team_abbreviation | team_display_name |
|---|---|---|---|---|---|
| Eastern Conference | East | 19 | Magic | ORL | Orlando Magic |
| Eastern Conference | East | 15 | Bucks | MIL | Milwaukee Bucks |
| Eastern Conference | East | 14 | Heat | MIA | Miami Heat |
| Eastern Conference | East | 20 | 76ers | PHI | Philadelphia 76ers |
| Eastern Conference | East | 11 | Pacers | IND | Indiana Pacers |
| Eastern Conference | East | 5 | Cavaliers | CLE | Cleveland Cavaliers |
| Eastern Conference | East | 18 | Knicks | NY | New York Knicks |
| Eastern Conference | East | 1 | Hawks | ATL | Atlanta Hawks |
30 rows total — first 8 shown, 31 cols total — first 6 shown.
sdv.nba.espnNbaTeamRoster({ team_id: 13, parsed: true }) — one row per player.
| id | uid | guid | alternate_ids_sdr | first_name | last_name |
|---|---|---|---|---|---|
| 4278129 | s:40 | 9af41ea8-a24c-025f-a63f-8263fbf0ca66 | 4278129 | Deandre | Ayton |
| 3945274 | s:40 | 583794eb-0f38-9bbd-3e25-9dd33b7f83b8 | 3945274 | Luka | Doncic |
| 4066648 | s:40 | 40c1bcf6-675b-f217-f97c-1d628073f927 | 4066648 | Rui | Hachimura |
| 4397077 | s:40 | 4cd92ac1-73ce-653d-c3b1-9c68e9c7a4d0 | 4397077 | Jaxson | Hayes |
| 4683774 | s:40 | 456f71fd-2ce5-3f50-8d0d-f30c0159789d | 4683774 | Bronny | James |
| 1966 | s:40 | 1f6592b3-ff53-d321-8dc5-6038d48c1786 | 2126588 | LeBron | James |
| 3913174 | s:40 | 668a6a14-4003-d79c-c252-0ece0a960d36 | 3913174 | Luke | Kennard |
| 2960236 | s:40 | d06ad722-26ff-5865-1433-061e2e6fbb32 | 2960236 | Maxi | Kleber |
17 rows total — first 8 shown, 68 cols total — first 6 shown.