STATS REALTIME

The STATS_REALTIME channel delivers only the statistics that have changed, in real-time.

Availability

Plan
Available

BASIC

No

PRO

No

ULTRA

No

MEGA

Yes

Update Frequency

Updates are sent immediately when statistics change (real-time).

Events

Event
Description

stats_update_realtime

Changed statistics only


stats_update_realtime

Delivers only the statistics that have changed since the last update.

Message

{
  "type": "stats_update_realtime",
  "channel": "STATS_REALTIME",
  "matchId": "12345",
  "leagueId": "67890",
  "ts": 1705314600000,
  "data": {
    "changedStats": [
      {
        "stat": "possession",
        "value": "56;44"
      },
      {
        "stat": "corners",
        "value": "5;2"
      },
      {
        "stat": "shotsOnTarget",
        "value": "5;2"
      }
    ]
  }
}

Data Fields

Field
Type
Description

changedStats

array

Array of changed statistics

changedStats[].stat

string

Statistic name

changedStats[].value

string

New value in "teamA;teamB" format

Available Statistics

Stat Name
Description

timer

Current match minute

extraTimer

Extra time minutes

status

Match status

score

Current score

score1h

First half score

score2h

Second half score

possession

Ball possession %

attacks

Total attacks

dangerousAttacks

Dangerous attacks

shotsOnTarget

Shots on target

shotsOffTarget

Shots off target

totalShots

Total shots

shotsBlocked

Blocked shots

corners

Total corners

corners1h

First half corners

fouls

Fouls committed

yellowCards

Yellow cards

redCards

Red cards

yellowToRed

Second yellow cards

substitutions

Substitutions

throwIns

Throw-ins

injuries

Injuries

penalties

Penalties awarded

offsides

Offsides

xg

Expected goals


Subscription Examples

Subscribe to all real-time stats updates

Subscribe to a specific match

Subscribe to a league


Example: Maintaining Local State

Example: Detecting Specific Changes


Comparison: STATS vs STATS_REALTIME

Feature
STATS
STATS_REALTIME

Update frequency

30-60 seconds

Real-time

Data sent

Full snapshot

Delta only

Bandwidth usage

Higher

Lower

State management

Not required

Required

Plan availability

ULTRA, MEGA

MEGA only

Best Practices

  1. Maintain local state: Keep a local copy of statistics and apply deltas

  2. Handle reconnections: On reconnect, subscribe to STATS first for a full snapshot, then switch to STATS_REALTIME

  3. Combine channels: Use STATS for initial state and STATS_REALTIME for updates

  4. Handle missing matches: Initialize stats when you receive the first update for a match

Notes

  • Only changed statistics are included in each message

  • An empty changedStats array means no changes (rare, but possible)

  • For a complete snapshot, use the STATS channel

  • This channel requires client-side state management

Last updated