seishun / node-steam

Interface directly with Steam servers from Node.js
MIT License
1k stars 181 forks source link

Getting Market Price of Items (with item.classid) #135

Closed RakouskyS closed 9 years ago

RakouskyS commented 9 years ago

Is it possible to get the current (or even better: average market price) of an item with the classid?

Currently stuck with this problem and I cant find a solution to this.

Thanks for all answers.

seishun commented 9 years ago

As far as I know, Steam market is entirely web-based, so such functionality is outside the scope of this library.

RakouskyS commented 9 years ago

What else could I use to find a solution if you know of any? :(

jabbink commented 9 years ago

Make or find a library that communicates with the Steam Market.

Beware that you either

srabouin commented 9 years ago

It's actually possible to get (some) market prices through messages.

I have this piece of code here, hopefully you can find it useful

this._handlers[1081] = function clientMarketDataResponseHandler(message) {
    var response = base_gcmessages.CMsgGCClientMarketData.parse(message);
    self._client.emit('marketData', response);
};

TeamFortress2.prototype.MarketDataRequest = function (currency) {
    var payload = base_gcmessages.CMsgGCClientMarketDataRequest.serialize({
        user_currency: currency
    })
    this._client.toGC(440, (1080 | protoMask), payload);
};

Obviously this is for TF2. You'd have to figure out the message for other games. Hope you know what you're doing because that's as far as I will go on explaining this. The data is pretty much useless because it doesn't work with classid, it returns a defindex and a quality, and nothing else. So if it's an unusual hat, you won't have the extra details like particles, etc.

The only solution is to parse the market data via http.

http://steamcommunity.com/market/search/render/?query=&start=0&count=100&search_descriptions=0&sort_column=name&sort_dir=asc&appid=440

Good luck.