Skip to main content
Version: 2024-10-11

Aggregate Stats

Field Catalog

This table is describing each field that can be used inside the Aggregate Stats query. In the next section you can see some examples about how to use the aggregate stats query.

Metadata fields

The following metadata fields are available for all events

Field NameDescriptionUsages
match.metadata[match_series_id]ID of the match series (relates to the key of match from ProDB 1.0)Term Filter
match.metadata[tournament_id]ID from TournamentTerm Filter
match.metadata[season_id]ID of the season (relates to the key of season from ProDB 1.0)Term Filter
match.metadata[competition_id]ID of the competition (relates to the key of competition from ProDB 1.0)Term Filter
match.metadata[circuit_id]ID from CircuitTerm Filter
player.metadata[player_id]ID from PlayerTerm Filter, Term Bucket
team.metadata[team_id]ID from TeamTerm Filter, Term Bucket
match.metadata[match_id]ID of the match (relates to the key of tournament_round from ProDB 1.0)Term Filter

Common fields

The following fields are available for all events

Field NameDescriptionUsages
event.typeReturns the type of the current eventTerm Filter
event.timestampUTC timestamp when the given event have been happenedRange Filter
game.map.nameThe ingame name of the map (e.g. "de_dust2")Term Filter, Term Bucket
game.round.idReturns an unique identifier of the current roundTerm Bucket
game.round.occurrenceReturns the number of occurrence of the current event in the current roundTerm Filter, Range Filter
game.round.result[WIN]Counts when the current round have been wonCount
game.round.result[LOSS]Counts when the current round have been lostCount
team.roleThe ingame role of the team (for CSGO: CT or TERRORIST)Term Filter, Term Bucket

Event fields

The following fields are available for some specific events

Field NameDescriptionUsagesAvailable on following events
item.nameIngame name of the item, that relates to the event (e.g. "m4a1")Term Filter, Term BucketPlayerPurchase, PlayerThrow, PlayerAttack, PlayerKill
item.typeType of the ingame item, see ItemTypeTerm Filter, Term BucketPlayerPurchase, PlayerThrow, PlayerAttack, PlayerKill
event.player_situation[CLUTCH]Counts total number of 1vsX clutch situationCountPlayerSituation
event.player_situation.clutch.opponents_aliveNumber of opponents alive in a 1vsX clutch situationTerm Filter, Term BucketPlayerSituation
event.game_resultCounts total number of played mapsCountGameResult
event.game_result[WIN]Counts total number of won mapsCountGameResult
event.game_result[LOSS]Counts total number of lost mapsCountGameResult
event.game_scoreCounts when the player/team have made a scoreCountGameScore
event.player_assistCounts all kinds of assistsCountPlayerAssist
event.player_attack.classification[REGULAR].damage.healthReturns the damage of health against opponent player (no team attack)SumPlayerAttack
event.player_deathCounts all kinds of deathsCountPlayerDeath
event.player_kill.classificationReturns the classification of the current kill eventTerm FilterPlayerKill
event.player_kill.classification[REGULAR]Counts kills against opponent players (no team kills)CountPlayerKill
event.player_purchaseCounts all kinds of item purchasesCountPlayerPurchase

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 {
dataAccurcy
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]"]) {
rounds: termBucket(fields: ["game.round.id"], hidden: true) {
damage: sum(field: "event.player_attack.classification[REGULAR].damage.health")
kills: count(field: "event.player_kill.classification[REGULAR]")
}
avgRoundDamage: avg(field: "_rounds.damage")
avgRoundKills: avg(field: "_rounds.kills")
}
}
}
}

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" }}
]) {
....
}
}