Events

Live game counts per league

Changed on

Public cheap live-per-league read for the HQ sport screen. Source is persisted GameEvent rows (status live), never the vendor fan-out; demo fixtures excluded. A row counts only when startTime is within the last 6 hours (LIVE_STALE_AFTER_MS); older kickoffs and a null startTime are excluded so a finished or vendor-stuck game cannot light the LIVE pill (#909). League resolves via homeTeam.leagueId ?? awayTeam.leagueId; leagueId values are League.id (cuid) matching GET /api/leagues. Default shape { leagues: [{ leagueId, live }], games: null }; ?include=games adds per-game rows { id, leagueId, homeTeamId, awayTeamId } with ids only (no scores/clocks). Cache: CDN s-maxage=30, stale-while-revalidate=60, stale-if-error=300. (#898)

get/api/events/live

Request

  • Base URL
    https://app.d-sports.org
  • Auth
    none required

Query parameters

sport'basketball' | 'soccer' | 'football' | 'hockey' | 'baseball'

Sport filter for the persisted rows. Unknown sport is a 400.

include'games'

include=games adds per-game rows; any other value is a 400.

Response

{ success, data: { leagues, games } }

Changes