SweatHost
SDK Reference

Match Statistics API

Complete reference for CS2 match stats — endpoint, SDK, response shape, and all fields

Overview

The Match Statistics API returns pre-aggregated analytics for a single CS2 map (match): match metadata, round-level overview, per-player stats (including weapon and utility breakdowns), weapon stats by weapon and category, utility usage, team totals, top performers, and optional recent kills and demos.

Use this when you need full analytics (weapon categories, top weapons, team stats, top performers). For basic match details and player lists only, use matches.get() instead.

Scope

All stats are organization-scoped. You only receive data for maps on servers owned by your organization. The mapId is the unique ID of the map (same as the match/map resource ID).


HTTP API

Endpoint

MethodPathDescription
GET/v1/cs2/matches/:mapId/statsGet comprehensive statistics for a single map

Path parameters

ParameterTypeRequiredDescription
mapIdstringYesUnique ID of the map (match). Same as the id from list or get.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <your-api-key>
Content-TypeNoResponse is JSON.

Query parameters

None. Stats are returned in a single response.

Example request (cURL)

curl -X GET "https://api.sweathost.com/v1/cs2/matches/MAP_UUID_123/stats" \
  -H "Authorization: Bearer YOUR_API_KEY"

SDK

getStats(matchId, options?)

Fetches full match statistics for the given map ID.

Parameters

ParameterTypeRequiredDescription
matchIdstringYesThe map (match) ID — same as mapId in the HTTP path.
optionsRequestOptionsNoOptional request config (e.g. custom headers, timeout).

Return type

Promise<MatchStats>

Example

import { createClient } from '@sweathost/sdk';

const client = createClient({ apiKey: process.env.SWEATHOST_API_KEY! });

const stats = await client.matches.getStats('map-uuid-123');

console.log(stats.match.map);           // e.g. "de_dust2"
console.log(stats.overview.totalKills); // number
console.log(stats.topPerformers.topKiller.name);

Response structure

The response is a single JSON object of type MatchStats with the following top-level keys.

KeyTypeDescription
matchobjectBasic match (map) metadata.
overviewobjectMap-wide totals (kills, deaths, rounds, damage, headshots, averages).
playersCs2PlayerWithStats[]All players with extended weapon/utility stats.
weaponStatsobjectAggregated weapon stats by weapon, by category, and top weapons.
utilityStatsobjectAggregated utility usage by type and total thrown.
teamStatsobjectPer-team totals and averages (team1, team2).
topPerformersobjectTop killer, ADR, KD, HS%, and MVPs.
recentKillsarray(If returned) Last N kill events.
demosarray(If returned) Demo file metadata.

match

Basic information about the map (match).

FieldTypeDescription
idstringUnique map ID.
matchIdstring | nullLegacy/external match reference.
seriesIdstring(If present) Parent series ID.
serverIdstring(If present) Server ID.
serverNamestring(If present) Server display name.
mapstringMap name (e.g. de_dust2).
gameModestringGame mode.
team1Namestring | nullTeam 1 name.
team2Namestring | nullTeam 2 name.
team1ScorenumberTeam 1 round score.
team2ScorenumberTeam 2 round score.
statusstringe.g. finished, live.
startedAtstringISO 8601 start time.
finishedAtstring | nullISO 8601 end time.
durationnumber | nullDuration in seconds.

overview

Map-wide aggregate numbers.

FieldTypeDescription
totalKillsnumberTotal kills in the map.
totalDeathsnumberTotal deaths.
totalAssistsnumberTotal assists.
totalRoundsnumberTotal rounds played.
totalDamagenumberSum of damage dealt by all players.
totalHeadshotsnumberTotal headshot kills.
averageKDnumberAverage K/D ratio across players.

players

Array of players with full stats for this map. Each item is Cs2PlayerWithStats: base player stats plus optional weaponStats and utilityStats arrays.

Base player stats (Cs2PlayerStats)

FieldTypeDescription
idstringPlayer record ID.
matchIdstringMap ID.
steamIdstringSteam ID.
namestringIn-game name.
teamnumberTeam number (e.g. 2 = T, 3 = CT).
killsnumberKills.
deathsnumberDeaths.
assistsnumberAssists.
headshotsnumberHeadshot kills.
mvpsnumberMVPs.
scorenumberScore.
damageDealtnumber | nullTotal damage dealt.
utilityDamagenumber | nullDamage from utility.
flashAssistsnumber | nullFlash assists.
firstKillsnumber | nullFirst kills.
firstDeathsnumber | nullFirst deaths.
bombPlantsnumber | nullBomb plants.
bombDefusesnumber | nullBomb defuses.
clutchWinsnumber | nullClutch wins.
entryKillsnumber | nullEntry kills.
tradeKillsnumber | nullTrade kills.
bulletsFirednumber | nullBullets fired.
bulletsHitnumber | nullBullets hit.
accuracyPercentnumber | nullAccuracy %.
hsPercentnumber | nullHeadshot %.
kdRationumber | nullK/D ratio.
adrnumber | nullAverage damage per round.
kastPercentnumber | nullKAST %.
impactRatingnumber | nullImpact rating.
roundsPlayednumber | nullRounds played.
roundsWonnumber | nullRounds won.
roundsLostnumber | nullRounds lost.

Per-player weapon stats (Cs2PlayerWeaponStats[])

Each element in player.weaponStats:

FieldTypeDescription
idstringRecord ID.
playerIdstringPlayer record ID.
weaponNamestringWeapon name (e.g. weapon_ak47).
killsnumberKills with this weapon.
headshotsnumberHeadshots with this weapon.
damagenumberDamage dealt.
shotsFirednumberShots fired.
shotsHitnumberShots hit.
accuracyPercentnumber | nullAccuracy %.

Per-player utility stats (Cs2PlayerUtilityStats[])

Each element in player.utilityStats:

FieldTypeDescription
idstringRecord ID.
playerIdstringPlayer record ID.
utilityTypestringe.g. flashbang, he, smoke, molotov.
thrownnumberNumber thrown.
enemiesFlashednumber | nullEnemies flashed.
damageDealtnumber | nullDamage from utility.
successfulSmokesnumber | nullSuccessful smokes.

weaponStats

Aggregated weapon data for the whole map.

KeyTypeDescription
byWeaponWeaponStat[]All weapons, sorted by kills (desc).
byCategoryWeaponCategoryStat[]Kills/headshots grouped by category.
topWeaponsWeaponStat[]Top 5 weapons by kills.

WeaponStat (byWeapon / topWeapons)

FieldTypeDescription
weaponstringWeapon name.
killsnumberTotal kills.
headshotsnumberTotal headshots.
damagenumberTotal damage.
hsRatenumberHeadshot rate (0–100).

WeaponCategoryStat (byCategory)

Categories: Rifle, Sniper, SMG, Pistol, Heavy, Other.

FieldTypeDescription
categorystringCategory name.
killsnumberKills in this category.
headshotsnumberHeadshots in this category.

utilityStats

Aggregated utility usage for the map.

KeyTypeDescription
byTypeUtilityStat[]Per utility type.
totalnumberTotal utility items thrown.

UtilityStat (byType)

FieldTypeDescription
typestringe.g. flashbang, he, smoke, molotov.
thrownnumberCount thrown.
enemiesFlashednumber(If applicable) Enemies flashed.
damageDealtnumber(If applicable) Damage.
successfulSmokesnumber(If applicable) Successful smokes.
effectivenessnumber(If applicable) Effectiveness metric.

teamStats

Per-team totals and averages. team1 usually corresponds to the first team (e.g. T side in first half), team2 to the second (e.g. CT).

team1 / team2

FieldTypeDescription
namestringTeam name.
scorenumberRound score.
mapsWonnumber(If present) Maps won in series.
totalKillsnumberTeam total kills.
totalDeathsnumberTeam total deaths.
totalAssistsnumberTeam total assists.
totalDamagenumberTeam total damage.
averageKDnumberAverage K/D of players.
averageADRnumberAverage ADR.

topPerformers

One player per category (full Cs2PlayerWithStats object).

KeyTypeDescription
topKillerCs2PlayerWithStatsMost kills.
topADRCs2PlayerWithStatsHighest ADR.
topKDCs2PlayerWithStatsHighest K/D.
topHSCs2PlayerWithStatsHighest headshot %.
mostMVPsCs2PlayerWithStatsMost MVPs.

(Some responses may expose topDamage instead of or in addition to topADR; same shape.)


recentKills (optional)

When present, an array of the most recent kill events (e.g. last 20). Each item typically includes killer, victim, weapon, headshot, timestamp, round.


demos (optional)

When present, an array of demo file metadata:

FieldTypeDescription
idstringDemo ID.
fileNamestringFile name.
fileSizestringSize (e.g. bigint as string).
downloadUrlstring | nullDownload URL if available.
recordedAtstringISO 8601.
expiresAtstring | nullURL expiry if applicable.

TypeScript interfaces

For use in your app or SDK typings:

interface MatchStats {
  match: {
    id: string;
    matchId?: string | null;
    seriesId?: string;
    serverId?: string;
    serverName?: string;
    map: string;
    gameMode: string;
    team1Name?: string | null;
    team2Name?: string | null;
    team1Score: number;
    team2Score: number;
    status: string;
    startedAt: string;
    finishedAt?: string | null;
    duration?: number | null;
  };
  overview: {
    totalKills: number;
    totalDeaths: number;
    totalAssists: number;
    totalRounds: number;
    totalDamage: number;
    totalHeadshots: number;
    averageKD: number;
  };
  players: Cs2PlayerWithStats[];
  weaponStats: {
    byWeapon: Array<{ weapon: string; kills: number; headshots: number; damage: number; hsRate: number }>;
    byCategory?: Array<{ category: string; kills: number; headshots: number }>;
    topWeapons: Array<{ weapon: string; kills: number; headshots: number; damage: number; hsRate: number }>;
  };
  utilityStats: {
    byType: Array<{
      type: string;
      thrown: number;
      enemiesFlashed?: number;
      damageDealt?: number;
      successfulSmokes?: number;
      effectiveness?: number;
    }>;
    total: number;
  };
  teamStats: {
    team1: { name: string; score: number; totalKills: number; totalDeaths: number; totalAssists: number; totalDamage: number; averageKD: number; averageADR: number };
    team2: { name: string; score: number; totalKills: number; totalDeaths: number; totalAssists: number; totalDamage: number; averageKD: number; averageADR: number };
  };
  topPerformers: {
    topKiller: Cs2PlayerWithStats;
    topADR: Cs2PlayerWithStats;
    topKD: Cs2PlayerWithStats;
    topHS: Cs2PlayerWithStats;
    mostMVPs: Cs2PlayerWithStats;
  };
  recentKills?: unknown[];
  demos?: Array<{ id: string; fileName: string; fileSize: string; downloadUrl?: string | null; recordedAt: string; expiresAt?: string | null }>;
}

Full player and weapon/utility types are in @sweathost/shared-types: Cs2PlayerWithStats, Cs2PlayerWeaponStats, Cs2PlayerUtilityStats.


Examples

SDK: Overview and top performers

const stats = await client.matches.getStats('map-uuid-123');

console.log(`${stats.match.team1Name} ${stats.match.team1Score} - ${stats.match.team2Score} ${stats.match.team2Name}`);
console.log(`Map: ${stats.match.map} | Rounds: ${stats.overview.totalRounds}`);
console.log(`Kills: ${stats.overview.totalKills} | Headshots: ${stats.overview.totalHeadshots}`);

const top = stats.topPerformers;
console.log(`Top killer: ${top.topKiller.name} (${top.topKiller.kills}K)`);
console.log(`Top ADR: ${top.topADR.name} (${top.topADR.adr ?? 0})`);
console.log(`Top HS%: ${top.topHS.name} (${top.topHS.hsPercent ?? 0}%)`);

SDK: Weapon and utility breakdown

const stats = await client.matches.getStats('map-uuid-123');

// By category (Rifle, Sniper, SMG, Pistol, Heavy, Other)
stats.weaponStats.byCategory?.forEach(cat => {
  console.log(`${cat.category}: ${cat.kills} kills, ${cat.headshots} HS`);
});

// Top 5 weapons
stats.weaponStats.topWeapons.forEach((w, i) => {
  console.log(`${i + 1}. ${w.weapon}: ${w.kills} kills, ${w.hsRate.toFixed(1)}% HS`);
});

// Utility
console.log(`Total utility thrown: ${stats.utilityStats.total}`);
stats.utilityStats.byType.forEach(u => {
  const pct = stats.utilityStats.total ? (u.thrown / stats.utilityStats.total * 100).toFixed(1) : '0';
  console.log(`  ${u.type}: ${u.thrown} (${pct}%)`);
});

SDK: Team comparison

const stats = await client.matches.getStats('map-uuid-123');
const t1 = stats.teamStats.team1;
const t2 = stats.teamStats.team2;

console.log(`${t1.name}: ${t1.totalKills}K / ${t1.totalDeaths}D, ${t1.totalDamage} dmg, avg KD ${t1.averageKD.toFixed(2)}`);
console.log(`${t2.name}: ${t2.totalKills}K / ${t2.totalDeaths}D, ${t2.totalDamage} dmg, avg KD ${t2.averageKD.toFixed(2)}`);

SDK: Per-player weapon stats

const stats = await client.matches.getStats('map-uuid-123');

for (const p of stats.players) {
  console.log(`\n${p.name} (${p.kills}/${p.deaths}/${p.assists})`);
  const weapons = (p.weaponStats ?? []).slice().sort((a, b) => b.kills - a.kills).slice(0, 5);
  weapons.forEach(w => console.log(`  ${w.weaponName}: ${w.kills}K, ${w.headshots} HS`));
}

Errors

HTTPCodeDescription
401UNAUTHORIZEDInvalid or missing API key.
403FORBIDDENMap belongs to another organization or scope missing.
404NOT_FOUNDMap ID not found.

Ensure your API key has the servers:read scope for CS2 match stats.

On this page