Home

Awesome

Steam WebAPI Client

This is yet another node.js module for the Steam WebAPI. I made it for myself because I'm sure none of the other modules are any good, but anyone is of course welcome to use it. Don't expect too many updates outside of fixing stuff.

It detects and handles errors from the X-eresult and X-error_message headers. It also requests gzip compression for responses.

Constructor

The constructor takes two arguments: key and localAddress.

var SteamWebAPI = require('@doctormckay/steam-webapi');
var api = new SteamWebAPI("yourapikey", "192.168.0.5");

The first argument is your API key. The second is the local IP address you want to make your requests from. Both are optional. If you don't provide an API key you can only use the methods that don't require one.

You can change your API key at any time by assigning it to the key property. Same goes for localAddress with the localAddress property.

Methods

get(iface, method, version[, input], callback)

Performs a GET request to a method.

post(iface, method, version[, input], callback)

Same as get except with a POST request.

Failure

On failure, you'll get back an Error object with the following properties:

Response

Response data is parsed as JSON. If the top-level object contains exactly one property named response, then the value of the response property is returned. Otherwise, the parsed JSON is returned as-is.