Skip to main content

NFL recipes

Pro football lives under sdv.nfl, which spans two surfaces: the ESPN wrappers (espnNfl*) โ€” scoreboard, rosters, standings, and the summary dispatcher (for football the summary additionally unrolls drives into a long-form play frame) โ€” and the native NFL.com "Shield" API (nflApi*, host api.nfl.com) for standings, rosters, weekly game details, and more. Pass { parsed: true } for tidy rows.

Scoreboardโ€‹

import sdv from 'sportsdataverse';

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

Run it inline โ€” edit a param and hit Run โ–ถ for live, parsed rows:

Loading live cellโ€ฆ

Open in playground โ–ถ

Team rosterโ€‹

team_id 12 is the Chiefs.

import sdv from 'sportsdataverse';

const roster = await sdv.nfl.espnNflTeamRoster({ team_id: 12, parsed: true });
console.table(roster);

Open in playground โ–ถ

Box score from a game idโ€‹

import sdv from 'sportsdataverse';

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

const teamBox = await sdv.nfl.espnNflSummary({
event_id: id,
parsed: true,
section: 'boxscore_team',
});
console.table(teamBox);

Open in playground โ–ถ

Standings from the NFL.com Shield API (native)โ€‹

api.nfl.com is NFL.com's own data API. A bearer token is minted automatically before each call โ€” no credentials required. Scope with season, season_type (REG / POST / PRE), and week.

import sdv from 'sportsdataverse';

const standings = await sdv.nfl.nflApiStandings({
season: 2024,
season_type: 'REG',
week: 1,
parsed: true,
});
console.table(standings);

The same call, live and inline โ€” a native api.nfl.com request, parsed to one row per team. season_type is a dropdown (REG / POST / PRE):

Loading live cellโ€ฆ

Open in playground โ–ถ

Frozen output (real parser rows, no network)โ€‹

The table below is real parse_nfl_standings output, rendered at build time from a committed sample fixture and frozen into this page (deterministic โ€” CI reproduces it exactly). Regenerate with npm run docs:examples.

sdv.nfl.nflApiStandings({ season: 2024, parsed: true }) โ€” the native NFL.com Shield standings, one row per team (sample fixture).

team_abbreviationteam_full_nameconferencedivisionwinslosses
KCKansas City ChiefsAFCAFC West152
BUFBuffalo BillsAFCAFC East134
DETDetroit LionsNFCNFC North152
PHIPhiladelphia EaglesNFCNFC East143

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

Rosters & weekly game details (native)โ€‹

import sdv from 'sportsdataverse';

// every active roster for a season
const rosters = await sdv.nfl.nflApiRosters({ season: 2024, parsed: true });
console.table(rosters.slice(0, 10));

// rich weekly game details (drive chart, scoring, standings)
const details = await sdv.nfl.nflApiWeeklyGameDetails({
season: 2024,
season_type: 'REG',
week: 1,
parsed: true,
});
console.table(details);

Open rosters in playground โ–ถ

tip

Full method + parameter tables: NFL reference (covers both the ESPN and NFL.com Shield families).