0.0.3 • Published 3 years ago

steamworks-api v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

steamworks-api

Node package for SteamWorks API.

Documentation

Installation

npm install steamworks-api

Example

const Steam = require('steamworks-api');

const steam = new Steam({
  key: 'STEAM_API_KEY',
});

(async () => {
  try {
    const recentlyPlayedGames = await steam.get('/IPlayerService/GetRecentlyPlayedGames/v1/', { steamid: '76561198027639832' }, false);
    console.log(recentlyPlayedGames);

    const ownedGames = await steam.get('/IPlayerService/GetOwnedGames/v1/', { steamid: '76561198027639832' }, false);
    console.log(ownedGames);
  } catch (error) {
    console.error(error);
  }
})();

Response example

{ 
  "response": { 
    "total_count": 1, 
    "games": [
      {
        "appid": 730,
        "name": "Counter-Strike: Global Offensive",
        "playtime_2weeks": 387,
        "playtime_forever": 7201,
        "img_icon_url": "69f7ebe2735c366c65c0b33dae00e12dc40edbe4",
        "img_logo_url": "d0595ff02f5c79fd19b06f4d6165c3fda2372820",
        "playtime_windows_forever": 1566,
        "playtime_mac_forever": 3297,
        "playtime_linux_forever": 0
      }
    ]
  }
}

Built With

Authors

Acknowledgments