Jump to content
McKay Development

How to get number of played hours in some app of user?


Recommended Posts

Posted
var request = require("request");
var steamid = '76561197960934690';
var apikey = 'u api key';

request({
    url: 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key='+apikey+'&steamid='+steamid+'&format=json&include_appinfo=1',
    json: true
}, function (error, response, body) {
    //    console.log(body.response.games);
    if (!error && response.statusCode === 200) {
        for (i = 0; i <= body.response.games.length; i++) {
            console.log(body.response.games[i].name + ' - ' + body.response.games[i].playtime_forever / 60 + ' hrs.')
        }
    }
})

https://steamcommunity.com/dev/apikey

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...