1.1.1 • Published 7 years ago

csgostatsnode v1.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

npm version Downloads GitHub issues

CSGO NodeJS wrapper

A nodeJS lib to provide CSGO Player stats.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installing

Run the following command in npm

npm install --save csgostatsnode

Example/Deployment

Require in the module as follows

const csgoStats = require('csgoStatsNode');
const cStats = new csgoStats({"apikey":"<Put your Steam API key here >"});

Here is an example of getting a players K/D

csStats.whatIsMyKD('76561198138999275', function(data){
  console.log("Your K/D is: " + data);
})

Here is another example of getting a players Steam ID from their vanity URL

csStats.getMySteamID('xserv', function(data){
  console.log("Your Steam ID is: " + data);
});

Options

when creating a new instance of the class eg:

const cStat = new csgoStats();

You must pass through your Steam API key

  • apikey - This is the key you will get for signing up for a to the Steam API (Its free to get it)

You can obtain one at https://steamcommunity.com/dev

you can pass through options such as:

  • quiet - This will suppress any console.log() messages that the class makes. This can be set to 1 to suppress the messages.
  • vanity - This allows just vanity URL's to be used instead of Steam ID's. To use this set vanity to true.

to set the options all you have to do is put a JSON object when creating the class instance

const cStat = new csgoStats({"quiet":"1", "vanity":"true", "apikey":"<Put your Steam API key here >"});

Available Commands

All of these functions take the Steam ID or Vanity URL if the option is set with the exception of getMySteamID which only takes a Vanity URL

  • getStats - This by its-self will return all CS:GO related data eg: Kills with each weapon, MVP medals and Achievements.
  • getProfile - Gets all data relating to a players profile eg: Profile name, Profile Image, Last Logon Time, Game ID (If the player is playing a game).
  • getProfilePic - Uses the Data from getProfile and pulls your full size (184x184) profile image URL.
  • whatIsMyKD - Basic function that calculates your CS:GO K/D to 2 dp (decimal Point).
  • getMySteamID - Using a players vanity URL this functions will return the Steam ID.
  • getMyBans - Get all bans from Steam eg: VAC Bans, Community Bans and Economy Bans.
  • isVac - A simple function that takes the data from getMyBans and checks if the VACBanned key is true or false.

Built With

  • Needle - A HTTP client for NodeJS

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago