Skip to content

Sport events

A SportEvent is a match reported by one bookmaker. All variants share a common base; sport-specific fields appear after narrowing on sport.

These appear on every SportEvent, regardless of sport:

FieldTypeNotes
idSportEventIdFormat vmid:<bookmaker>:<external_id>.
kind'se:basketball_match' | 'se:football_match' | 'se:tennis_match'Discriminator.
sport'basketball' | 'football' | 'tennis'Computed from kind.
bookmakerBookmakerComputed from id.
competitionCompetitionFormat comp:<sport>.<league>. See examples below.
sportRegionstring | undefinedFree-form region (e.g. 'USA'). Optional.
startDateDateTime | undefinedLuxon DateTime. Optional.
matchUrlstring | undefinedDeep link to the bookmaker’s page. Optional.
namestringComputed display name.
marketsReadonlyMap<MarketId, Market>All markets on this event.

Methods: getMarket(id), getSelection(id).

event.sport === 'basketball'  ·  event.kind === 'se:basketball_match'

FieldTypeNotes
homeTeamstringFull team name (e.g. "Los Angeles Lakers").
awayTeamstring

name returns "<homeTeam> vs <awayTeam>".

if (event.sport === 'basketball') {
console.log(`${event.homeTeam} hosts ${event.awayTeam}`)
}

event.sport === 'football'  ·  event.kind === 'se:football_match'

FieldTypeNotes
homeTeamstring
awayTeamstring

name returns "<homeTeam> vs <awayTeam>".

event.sport === 'tennis'  ·  event.kind === 'se:tennis_match'

FieldTypeNotes
competitor1stringFull player name (e.g. "Carlos Alcaraz").
competitor2string

name returns "<competitor1> vs <competitor2>". There is no inherent home/away in tennis — competitor1 / competitor2 reflect the bookmaker’s listed order.

competition is a stable code, lowercase, formatted comp:<sport>.<league>. Examples you will see today:

CodeDescription
comp:basketball.nbaNBA
comp:basketball.euroleagueEuroLeague
comp:football.premier_leagueEnglish Premier League
comp:football.la_ligaLa Liga
comp:football.champions_leagueUEFA Champions League
comp:tennis.atp_us_openUS Open (ATP)
comp:tennis.wta_us_openUS Open (WTA)

The set of competitions in production grows as we extend coverage. The format is stable; new codes follow the same scheme.

A SportEventId looks like vmid:<bookmaker>:<external_id>. The <external_id> portion is whatever the bookmaker assigns — opaque, but stable for the duration of the match. Examples:

BookmakerExample id
ps3838vmid:ps3838:1610547234

Don’t try to parse external_id — its shape varies per bookmaker. If you need the bookmaker, read event.bookmaker (computed).

Some bookmakers reliably populate startDate and matchUrl; others occasionally omit them. Always handle the undefined case in user-facing code — the type system enforces it.

if (event.startDate) {
const minutesUntilStart = event.startDate.diffNow('minutes').minutes
}