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 Name | Description | Usages |
---|---|---|
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 Tournament | Term 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 Circuit | Term Filter |
player.metadata[player_id] | ID from Player | Term Filter, Term Bucket |
team.metadata[team_id] | ID from Team | Term 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 Name | Description | Usages |
---|---|---|
event.type | Returns the type of the current event | Term Filter |
event.timestamp | UTC timestamp when the given event have been happened | Range Filter |
game.map.name | The ingame name of the map (e.g. "de_dust2") | Term Filter, Term Bucket |
game.round.id | Returns an unique identifier of the current round | Term Bucket |
game.round.occurrence | Returns the number of occurrence of the current event in the current round | Term Filter, Range Filter |
game.round.result[WIN] | Counts when the current round have been won | Count |
game.round.result[LOSS] | Counts when the current round have been lost | Count |
team.role | The 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 Name | Description | Usages | Available on following events |
---|---|---|---|
item.name | Ingame name of the item, that relates to the event (e.g. "m4a1") | Term Filter, Term Bucket | PlayerPurchase, PlayerThrow, PlayerAttack, PlayerKill |
item.type | Type of the ingame item, see ItemType | Term Filter, Term Bucket | PlayerPurchase, PlayerThrow, PlayerAttack, PlayerKill |
event.player_situation[CLUTCH] | Counts total number of 1vsX clutch situation | Count | PlayerSituation |
event.player_situation.clutch.opponents_alive | Number of opponents alive in a 1vsX clutch situation | Term Filter, Term Bucket | PlayerSituation |
event.game_result | Counts total number of played maps | Count | GameResult |
event.game_result[WIN] | Counts total number of won maps | Count | GameResult |
event.game_result[LOSS] | Counts total number of lost maps | Count | GameResult |
event.game_score | Counts when the player/team have made a score | Count | GameScore |
event.player_assist | Counts all kinds of assists | Count | PlayerAssist |
event.player_attack.classification[REGULAR].damage.health | Returns the damage of health against opponent player (no team attack) | Sum | PlayerAttack |
event.player_death | Counts all kinds of deaths | Count | PlayerDeath |
event.player_kill.classification | Returns the classification of the current kill event | Term Filter | PlayerKill |
event.player_kill.classification[REGULAR] | Counts kills against opponent players (no team kills) | Count | PlayerKill |
event.player_purchase | Counts all kinds of item purchases | Count | PlayerPurchase |
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" }}
]) {
....
}
}