v1.0.0
A simple wrapper for the CSGO API from TNR.
Repository
Current version released
6 years ago
Versions
CSGO Stats
A simple wrapper for the CSGO API from TNR.
Getting started
- Create an app on tracker.gg
- Fill in all the required information.
- Copy the api key.
You can now follow the example below.
Example
import { Stats, Player, Playtime } from 'https://deno.land/x/csgo_stats@v1.0.0/mod.ts';
const stats: Stats = new Stats({
apiKey: 'api-key'
});
const player: Player | null = await stats.fetchPlayer('some-player-id');
if (player == null) {
console.log('No data found');
} else {
console.log(player.kills);
console.log(player.deaths);
// Etc.
const playtime: Playtime = player.getPlayedTime();
console.log(playtime.getDays(), playtime.getHours(), playtime.getMinutes(), playtime.getSeconds());
}