Skip to main content

Soccer recipes

Soccer lives under sdv.soccer and exposes the ESPN cross-league surface under espnSoccer* method names. Unlike the single-league namespaces, every soccer call takes a league slug that selects the competition — ESPN serves dozens of them through one set of endpoints.

Competitionleague slug
English Premier Leagueeng.1
La Liga (Spain)esp.1
Serie A (Italy)ita.1
Bundesliga (Germany)ger.1
Ligue 1 (France)fra.1
MLS (USA)usa.1
Liga MX (Mexico)mex.1
UEFA Champions Leagueuefa.champions
NWSLusa.nwsl

Pass { parsed: true } for tidy rows, or omit it for the raw ESPN payload.

Scoreboard for a competition​

Raw first, then the same fixtures tidied:

import sdv from 'sportsdataverse';

const raw = await sdv.soccer.espnSoccerScoreboard({ league: 'eng.1' });
const fixtures = await sdv.soccer.espnSoccerScoreboard({ league: 'eng.1', parsed: true });
console.table(fixtures);

Live and inline — the league field is the competition slug; change it to esp.1, ger.1, uefa.champions, … and re-run:

Loading live cell…

Open in playground â–¶

League table (standings)​

Swap the league slug to follow any competition — here, La Liga:

import sdv from 'sportsdataverse';

const table = await sdv.soccer.espnSoccerStandings({ league: 'esp.1', parsed: true });
console.table(table);
Loading live cell…

Open in playground â–¶

Every club, then a roster​

espnSoccerTeamsSite lists the clubs in a competition (grab an id); espnSoccerTeamRoster returns one row per player.

import sdv from 'sportsdataverse';

const clubs = await sdv.soccer.espnSoccerTeamsSite({ league: 'ger.1', parsed: true });
console.table(clubs);

// team_id 132 is Bayern Munich
const roster = await sdv.soccer.espnSoccerTeamRoster({
league: 'ger.1',
team_id: 132,
parsed: true,
});
console.table(roster);

Open in playground â–¶

tip

Full method + parameter tables: Soccer reference. Per-competition reference pages (EPL, La Liga, Bundesliga, MLS, NWSL, UCL…) each pin a default league slug — see the EPL reference for an example.