How To Get Float Values of CS:GO Items

Here's How to Check Float Values of CS:GO Items Easily with Node.

Posted by daksh on April 4, 2017

[ Float Values ]: Counter Strike: Global Offensive is a competitive game, It has a great trading system set up by Steam and To compare items from each other. Steam has got out the float-value-system which differentiate the wear value of the same item with different wears. There's a problem for developers, It's kinda hard to get the float-values from steam and other APIs and that makes it even harder. Today, I'm going to help you find that value with Node.

Prerequisites for Following this Guide:

  1. Beginner Level of Programming Experience with Node.js
  2. Node.js Installed on your Machine.
  3. Some Node Modules like steam-user, steam-totp, csgo-floats.
  4. A Bot Account which has CS:GO (game).

Let's Start Finding Float Values:

First We’ll create the ‘package.json’ file, which allows us to save our modules and then we’ll install modules.

 npm init --yes
 npm install csgo-floats steam-totp steam-user --save

 Now, We'll create the main file requiring our modules.

 var steamUser = require('steam-user');
 var steamTotp = require('steam-totp');
 var csgoFloats = require('csgo-floats');
 var master = new csgoFloats();

Now, It’s time to Make a User and Login into CS:GO. (Replace it with your credentials)

 let user = new steamUser();
 user.logOn({
   accountName: 'your-steam-user-name',
   password: 'your-steam-account-password',
   twoFactorCode: steamTotp.generateAuthCode('your-shared-secret')
 });
 master.addBot(user);

Finally, At-last We’ll generate the Float Value from Inspect URL.

master.on("connectedToGC", function() {
 master.inspect("your-inspect-link").then(function(item) {
       console.log("Float Value is " + item.paintwear);
 }).catch(function(error) {
     console.log("err is " + error);
    });
});

We’re done, Now just run the file and you’ll find the output as your FloatValue. These Node Modules make it really easy to get float values directly from the game.

Explanations:

In this simple tutorial, we used steam-user node modules which allows us to login through node.js to steam and due to the additions of the Steam “Mobile-Authenticator”, We are using steam-totp module to convert the shared secret into the 2 Factor Code (Mobile Authenticator Code) which allows the bot to login everytime you stop and re-run the bot.  The csgo-floats module provides a layer of abstraction over the steam-user module to help us get the FloatValue Easily.

Conclusion:

In this simple tutorial, We created a Bot which can send us float values from inspect URLs of items in terms of console outputs and makes the task of getting values very easy. If you followed this tutorial Correctly, everything should be working well and If it doesn’t then Feel free to comment :)