Giter VIP home page Giter VIP logo

node-backpacktf's Introduction

node-backpacktf

License npm version npm downloads

paypal Steam Items Donate Button paypal donate

A node.js wrapper to get data from the backpack.tf API.

Usage

Install this module from npm using npm install backpacktf.

Initialize module like so:

var backpacktf = require('backpacktf');

And call methods off backpacktf. When passing to parameters, SteamIDs and backpack.tf API keys should always be Strings.

To use methods from this module, you need a backpack.tf API key. Also keep in mind that most of the methods will cache their results, and have a varying time limit (additional details can be found here).

backpacktf on npmjs.com

Enums

AppIDs

An object containing constants representing Steam App IDs. For instance, if you want the AppID for TF2 you could use backpacktf.AppIDs.TF2 instead of 440.

Quality

backpack.tf uses these quality IDs as keys in the json returned for TF2 prices. For example backpacktf.AppIDs.Unique evaluates to 6. Conversely,

Object.keys(backpacktf.AppIDs)[6]

evaluates to "Unique".

UnusualEffects

These are the values that is used in TF2 schema for the unusual quality IDs. For example, backpacktf.UnusualEffects["Burning Flames"] evaluates to 13.

ErrorCodes

This contains the data from SteamKit for .NET about Steam Error codes - not necessarilly related to backpack.tf but useful for telling users what the problem is in any trade bot thing.

Methods

getMarketPrices(key, appID, callback)

Retrieves Steam Community Market data in a readable format containing all items for a given game.

  • key - your backpack.tf API key
  • appID - Steam's numeric identifier for the game (i.e. 440 for TF2 and 730 for CS:GO, alternatively backpacktf.AppIDs.TF2, see AppID enums)
  • Callback is called with 2 parameters: an Error object (undefined on success), and an Object containing response data.

It is strongly reccomended that you save this data to a local JSON file, or at least a local. It is not something you want to download each time you need the data (and there is a time limit on the method).

getBPPrices(key, appID, callback)

Identical to backpacktf.getMarketPrices, but instead retrieves backpack.tf community pricings (and in a different format of object)

getCurrencies(key, appID, callback)

Currently disabled

Identical to backpacktf.getMarketPrices, but instead retrieves currency data from backpack.tf.

getUser(key, steamIDs, callback)

Currently disabled - this will be implemented more in the next update.

A thin wrapper for this API method. Returns data on backpack.tf-generated backpack value, bp.tf bans, SteamRep marks, and Steam/VAC/Trade bans.

  • key - your backpack.tf API key
  • steamIDs - a comma-delimited list of Steam IDs.
  • Callback just returns an Error object (undefined on success), and on success, the Object response from the backpack.tf API. I will write a method to easily work with this data eventually.

startAutomatic(steamid, token, callback)

Sends a heartbeat to the backpack.tf servers, telling them to add the lightning symbol to each of your trades denoting that they are automatic. Use this only when accepting trade offers automatically. Failure to accept offers when you have the lightning symbol can result in a ban from backpack.tf! Use at your own risk!

  • steamid - your Steam64 ID
  • token - backpack.tf third-party program token, found here under "Advanced"
  • Callback is called when backpack.tf responds. Called with an Error object on failure, no parameters on success.

offerAccepted(steamid, token, callback)

Gives you the "Lightning Fast" badge on backpack.tf.

Parameters are the same as startAutomatic().

node-backpacktf's People

Contributors

charredgrass avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.