Aggregate Stats
Overview
The aggregateStats GraphQL query provides aggregated statistical insights from various events. Below, you'll find a field catalog detailing available fields, followed by query examples demonstrating their usage.
Field Catalog
Each field listed here can be used in Aggregate Stats queries.
Metadata Fields
Metadata fields are available for all events.
Field Name | Description | Usages |
---|---|---|
match.metadata[match_series_id] | ID of the MatchSeries | Term Filter |
match.metadata[tournament_id] | ID of the Tournament | Term Filter |
match.metadata[season_id] | ID of the Season | Term Filter |
match.metadata[competition_id] | ID of the Competition | Term Filter |
match.metadata[circuit_id] | ID of the Circuit | Term Filter |
player.metadata[player_id] | ID of the Player | Term Filter, Term Bucket |
team.metadata[team_id] | ID of the Team | Term Filter, Term Bucket |
match.metadata[match_id] | ID of the Match | Term Filter |
Common Fields
These fields are accessible across all events.
Field Name | Description | Usages |
---|---|---|
event.type | Type of event | Term Filter |
event.timestamp | UTC timestamp of the event occurrence | Range Filter |
game.map.name | In-game map name (e.g., "de_dust2") | Term Filter, Term Bucket |
game.round.id | Unique round identifier | Term Bucket |
game.round.occurrence | Event occurrence count within the round | Term Filter, Range Filter |
game.round.result[WIN] | Count of rounds won | Count |
game.round.result[LOSS] | Count of rounds lost | Count |
team.role | Same as field "name" on GameRole | Term Filter, Term Bucket |
Event-Specific Fields
These fields apply to specific event types.
Field Name | Description | Usages | Available Events |
---|---|---|---|
item.name | In-game item name (e.g., "m4a1") | Term Filter, Term Bucket | GameEventPlayerItemPurchase, GameEventPlayerItemThrow, GameEventPlayerAttack, GameEventPlayerKill |
item.type | see GameItemType | Term Filter, Term Bucket | GameEventPlayerItemPurchase, GameEventPlayerItemThrow, GameEventPlayerAttack, GameEventPlayerKill |
event.player_situation[CLUTCH] | 1vsX clutch situations count | Count | GameEventPlayerSituation |
event.player_situation.clutch.opponents_alive | Opponents alive in 1vsX clutch | Term Filter, Term Bucket | GameEventPlayerSituation |
event.game_result | Relates to GameEventGameResult | Count | GameEventGameResult |
event.game_result[WIN] | Total maps won | Count | GameEventGameResult |
event.game_result[LOSS] | Total maps lost | Count | GameEventGameResult |
event.game_score | Relates to GameEventGameScore | Count | GameEventGameScore |
event.player_assist | Relates to GameEventPlayerAssist | Count | GameEventPlayerAssist |
event.player_attack.classification[REGULAR].damage.health | Health damage dealt (excluding team damage) | Sum | GameEventPlayerAttack |
event.player_death | Relates to GameEventPlayerDeath | Count | GameEventPlayerDeath |
event.player_kill.classification | see GameKillClassification | Term Filter | GameEventPlayerKill |
event.player_kill.classification[REGULAR] | Kills against opponents (excluding team kills) | Count | GameEventPlayerKill |
event.player_purchase | Relates to GameEventPlayerItemPurchase | Count | GameEventPlayerItemPurchase |
Query Examples
Clutch 1vsX Wins/Totals
{
aggregateStats {
data {
players: termBucket(fields: ["player.metadata[player_id]", "event.player_situation.clutch.opponents_alive"]) {
playerId: term(field: "player.metadata[player_id]")
numOpponentsAlive: term(field: "event.player_situation.clutch.opponents_alive")
wins: count(field: "game.round.result[WIN]")
total: count
}
}
}
}
Fetch data accuracy and timestamp of the latest update of the given request
{
aggregateStats {
meta {
dataAccuracy
lastUpdatedAt
}
data {
# ...
}
}
}
Sort term bucket by highest map win percentage
{
aggregateStats {
data {
players: termBucket(fields: ["player.metadata[player_id]"], sort: [{field: "_mapWinRate", order: ORDER_DESC }]) {
playerId: term(field: "player.metadata[player_id]")
mapTotal: count(field: "event.game_result")
mapWins: count(field: "event.game_result[WIN]")
mapWinRate: rate(fields: ["_mapWins", "_mapTotal"])
}
}
}
}
First Kills/Deaths Round Win%
{
aggregateStats {
data {
players: termBucket(fields: ["player.metadata[player_id]"]) {
entry: filter(filters: [ { field: "game.round.occurrence", filter: { term: { values: ["1"] }} } ]) {
kills: filter(filters: [ { field: "event.player_kill.classification", filter: { term: { values: ["REGULAR"] }} } ]) {
roundTotal: count()
roundWins: count(field: "game.round.result[WIN]")
}
deaths: filter(filters: [ { field: "event.type", filter: { term: { values: ["PLAYER_DEATH"] }} } ]) {
roundTotal: count()
roundWins: count(field: "game.round.result[WIN]")
}
}
}
}
}
}
Average damage/kills per round
{
aggregateStats {
data {
players: termBucket(fields: ["player.metadata[player_id]"]) {
roundsTotal: count(field: "event.game_action[ROUND_ENDED]")
damageTotal: sum(field: "event.player_attack.classification[REGULAR].damage.health")
killsTotal: count(field: "event.player_kill.classification[REGULAR]")
avgRoundDamage: rate(fields: ["_damageTotal", "_roundsTotal"])
avgRoundKills: rate(fields: ["_killsTotal", "_roundsTotal"])
}
}
}
}
Filter results by Player IDs
{
aggregateStats(filters: [
{ term: { field: "player.metadata[player_id]", values: ["4357ee21-8021-415f-b7c8-d75123de6647", "4357ee21-8021-415f-b7c8-d75124e6657"] }}
]) {
# ...
}
}
Filter results by Team IDs
{
aggregateStats(filters: [
{ term: { field: "team.metadata[team_id]", values: ["2c3fda30-e913-4938-89de-5e28c2ff26c2", "b55a8d10-223b-11ee-be56-0242ac120002"] }}
]) {
# ...
}
}
Filter results by time period
{
aggregateStats(filters: [
{ range: { field: "event.timestamp", gte: "2022-01-01T01:02:03.004Z", lte: "2022-02-02T01:02:03.004Z" }}
]) {
# ...
}
}