Skip to main content
Once connected to the Sports WebSocket, clients receive JSON messages whenever a sports event updates. Messages are broadcast to all connected clients automatically.

sport_result Message

Emitted when:
  • A match goes live
  • The score changes
  • The period changes (e.g., halftime, overtime)
  • A match ends
  • Possession changes (NFL and CFB only)

Structure

gameId
number
Unique identifier for the game
leagueAbbreviation
string
League identifier (e.g., "nfl", "nba", "cs2")
homeTeam
string
Home team name or abbreviation
awayTeam
string
Away team name or abbreviation
status
string
Game status (e.g., "InProgress", "finished")
live
boolean
true if the match is currently in progress
ended
boolean
true if the match has concluded
score
string
Current score (format varies by sport)
period
string
Current period (e.g., "Q4", "2H", "2/3")
elapsed
string
Time elapsed in current period (e.g., "05:09")
finishedTimestamp
string
Timestamp when the match ended (only present when ended: true)
turn
string
Team abbreviation with possession (NFL/CFB only)
The turn field is only present for NFL and CFB games and indicates which team currently has the ball.

Example Messages

NFL (in progress):
{
  "gameId": 19439,
  "leagueAbbreviation": "nfl",
  "homeTeam": "LAC",
  "awayTeam": "BUF",
  "status": "InProgress",
  "score": "3-16",
  "period": "Q4",
  "elapsed": "5:18",
  "live": true,
  "ended": false,
  "turn": "lac"
}
Esports - CS2 (finished):
{
  "gameId": 1317359,
  "leagueAbbreviation": "cs2",
  "homeTeam": "ARCRED",
  "awayTeam": "The glecs",
  "status": "finished",
  "score": "000-000|2-0|Bo3",
  "period": "2/3",
  "live": false,
  "ended": true
}

Slug Format

The slug field follows a consistent naming convention:
{league}-{team1}-{team2}-{date}
Examples:
  • nfl-buf-kc-2025-01-26 — NFL: Buffalo Bills vs Kansas City Chiefs
  • nba-lal-bos-2025-02-15 — NBA: LA Lakers vs Boston Celtics
  • mlb-nyy-bos-2025-04-01 — MLB: NY Yankees vs Boston Red Sox

Period Values

PeriodDescription
1HFirst half
2HSecond half
1Q, 2Q, 3Q, 4QQuarters (NFL, NBA)
HTHalftime
FTFull time (match ended in regulation)
FT OTFull time with overtime
FT NRFull time, no result (draw or canceled)
End 1, End 2, etc.End of inning (MLB)
1/3, 2/3, 3/3Map number in Bo3 series (Esports)
1/5, 2/5, etc.Map number in Bo5 series (Esports)

Handling Updates

When processing messages, use the gameId field as the unique identifier to update your local state:
// Update or insert based on gameId
setSportsData(prev => {
  const existing = prev.find(item => item.gameId === data.gameId);
  if (existing) {
    return prev.map(item => 
      item.gameId === data.gameId ? data : item
    );
  }
  return [...prev, data];
});