Subscribe to LIVE Data Aggregated Statistics

StatsBomb calculates a set of statistics about each match in real-time split by player and team.

Player stats

Get the player statistics for a specific match. Update the match_id value for a StatsBomb live match of interest

subscription PlayerStatsQuery {
  live_player_match_aggregated_stat(where: {match_id: {_eq: 117974}}) {
    stat_name
    match_id
    player_id
    team_id
    value
  }
}

A GraphQL subscription is now listening for all player stats in a match with an id of 117974. Every time an update to a stat occurs the response will refresh.

Reveal answer...

{
  "data": {
    "live_player_match_aggregated_stat": [
      {
        "stat_name": "passes-attempted",
        "match_id": 117974,
        "player_id": 27559,
        "team_id": 212,
        "value": 18
      },
      {
        "stat_name": "pass-success-ratio",
        "match_id": 117974,
        "player_id": 27559,
        "team_id": 212,
        "value": 0.896551724137931
      }
    ]
  }
}

stat_name describes the statistic

value is the sum or ratio for the player for the statistic

In this example player 27559 has completed 18 passes and their pass success ratio is 90% (rounded up).

It's also possible to filter for specific players and stats. For example, if you wanted to monitor the number of goals scored by a player:

Goal Statistics for a Player

subscription GoalsForPlayer {
  live_player_match_aggregated_stat(
      where: {match_id: {_eq: 102855},
              player_id: {_eq: 29724},
              stat_name: {_eq: "goals"}})
  {
    stat_name
    match_id
    player_id
    team_id
    value
  }
}

Reveal answer...

{
  "data": {
    "live_player_match_aggregated_stat": [
      {
        "stat_name": "goals",
        "match_id": 102855,
        "player_id": 29724,
        "team_id": 131,
        "value": 1
      }
    ]
  }
}

Team stats

Update the match_id value for a StatsBomb live match of interest.

subscription TeamStatsQuery {
  live_team_match_aggregated_stat(where: {match_id: {_eq: 102855}}) {
    stat_name
    team_id
    match_id
    value
  }
}

A GraphQL subscription is now listening for all team stats in a match with an id of 102855. Every time an update to a stat occurs the response will refresh.

Reveal answer...

{
  "data": {
    "live_team_match_aggregated_stat": [
      {
        "stat_name": "possession",
        "team_id": 133,
        "match_id": 102855,
        "value": 0.784455958549223
      },
      {
        "stat_name": "possession",
        "team_id": 131,
        "match_id": 102855,
        "value": 0.215544041450777
      }
    ]
  }
}

stat_name describes the statistic

value is the sum or ratio for the team for the statistic

In this example team 133 has had 78% possession and team 131 has had 22% possession.

Filtering on statistics

The value of statistics can be used to filter the results. For example, to track the total number of goals scored for a team

subscription GoalsPerTeam {
  live_team_match_aggregated_stat(
    where: {match_id: {_eq: 117972},
            stat_name: {_eq: "goals"}})
  {
    stat_name
    team_id
    match_id
    value
  }
}

Reveal answer...

{
  "data": {
    "live_team_match_aggregated_stat": [
      {
        "stat_name": "goals",
        "team_id": 246,
        "match_id": 117972,
        "value": 2
      },
      {
        "stat_name": "goals",
        "team_id": 750,
        "match_id": 117972,
        "value": 2
      }
    ]
  }
}

results matching ""

    No results matching ""