https://github.com/onlyf0ur/csgo-stats
A simple wrapper for the CSGO API from TNR.
https://github.com/onlyf0ur/csgo-stats
csgo deno deno-module denoland wrapper
Last synced: 22 days ago
JSON representation
A simple wrapper for the CSGO API from TNR.
- Host: GitHub
- URL: https://github.com/onlyf0ur/csgo-stats
- Owner: OnlyF0uR
- License: mit
- Created: 2020-11-03T08:02:24.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-03T09:07:43.000Z (almost 5 years ago)
- Last Synced: 2025-01-31T03:01:55.046Z (over 1 year ago)
- Topics: csgo, deno, deno-module, denoland, wrapper
- Language: TypeScript
- Homepage: https://deno.land/x/csgo_stats
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSGO Stats
A simple wrapper for the CSGO API from TNR.
### Getting started
1. Create an app on [tracker.gg](https://tracker.gg/developers/docs/getting-started)
2. Fill in all the required information.
3. Copy the api key.
You can now follow the example below.
### Example
```ts
import { Stats, Player, Playtime } from 'https://deno.land/x/csgo_stats@v1.1.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());
}
```