https://storage.coh3stats.com/leaderboards/{unixTimeStamp}/{unixTimeStamp}_{mode}_{faction}.json
// Available modes: 1v1, 2v2, 3v3, 4v4
// Available factions: american, british, german, dak
// UnixTimeStamp: See explanation below how to calculate it
// Example:
https://storage.coh3stats.com/leaderboards/1683676800/1683676800_2v2_american.json
If you plan to utilize the data, kindly acknowledge the data source. Additionally, consider sharing your project with us on our Discord. We would love to help you with your project.Type definitions for the data:// Leaderboard json object definition:
{ "leaderboards": Array<RawLeaderboardStat>; }
type RawLeaderboardStat = {
statgroup_id: number;
leaderboard_id: number;
wins: number;
losses: number;
streak: number;
disputes?: number;
drops?: number;
rank: number;
ranktotal?: number;
regionrank?: number;
regionranktotal?: number;
ranklevel: number;
rating: number;
lastmatchdate: number;
members: Array<RawPlayerProfile>;
};
type RawPlayerProfile = {
profile_id: number;
name: string;
alias: string;
personal_statgroup_id?: number;
xp?: number;
level: number;
leaderboardregion_id?: number;
country: string;
};
Optional fields are marked with "?". And will most likely be not present as they are not deemed important. However they are on the Relic API in case you need them. Reach out to us if you need any clarification.https://storage.coh3stats.com/matches/matches-{unixTimeStamp}.json
// UnixTimeStamp: See explanation below how to calculate it
// Example:
https://storage.coh3stats.com/matches/matches-1688169600.json
Type definitions for the data:// Match data json object definition:
{ "matches": Array<ProcessedMatch>; }
interface ProcessedMatch {
id: number;
creator_profile_id: number;
mapname: string;
maxplayers: number;
matchtype_id: number;
description: string;
platform: string;
startgametime: number;
completiontime: number;
matchhistoryreportresults: Array<PlayerReport>;
matchhistoryitems: Array<ProcessedMatchHistoryItem>; // we are filtering out some items - those are cosmetic items
profile_ids: Array<number>;
}
interface PlayerReport {
profile_id: number;
resulttype: number;
teamid: number;
race_id: number;
counters: string;
profile: ProcessedProfile;
matchhistorymember: ProcessedMatchHistoryMember;
}
interface ProcessedProfile {
name: string;
alias: string;
personal_statgroup_id: number;
xp: number;
level: number;
leaderboardregion_id: number;
country: string;
}
interface ProcessedMatchHistoryMember {
statgroup_id: number;
wins: number;
losses: number;
streak: number;
arbitration: number;
outcome: number;
oldrating: number;
newrating: number;
reporttype: number;
}
interface ProcessedMatchHistoryItem {
profile_id: number;
itemdefinition_id: number;
itemlocation_id: number;
}
// Check https://github.com/cohstats/coh3-stats/blob/master/src/coh3/coh3-raw-data.ts for additional details
const date = new Date(); const timeStamp = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0) / 1000;