steamwebapi
v0.0.4
Published
Steam Web API Node.js SDK
Downloads
67
Maintainers
Readme
Steam Web API Node.js SDK
Node.js SDK for interfacing with Steam's Web API.
Requirements
Node.js >= 6.0
Installation
Run the following command:
npm install steamwebapi
Usage
Require the SDK in your module by adding the following code
var SteamWebAPI = require('steamwebapi');
Set your API Key (Optional, but required for most API requests)
SteamWebAPI.setAPIKey('***My Steam API Key***');
Set your response format (Default json
)
SteamWebAPI.setFormat('xml');
Example
Example for retrieving a list of the 5 most recently played games for a given Steam 64 bit ID, and logging the response in console:
SteamWebAPI.getRecentlyPlayedGames('76561198020275445', 5, function(response) {
console.log(response);
});
Handling any errors in your request:
SteamWebAPI.getRecentlyPlayedGames('76561198020275445', 5, function(response) {
if (typeof response.error !== 'undefined') {
console.log(response.error)
}
...
});
Testing
npm test
Documentation
The official Steam documentation is found at: https://developer.valvesoftware.com/wiki/Steam_Web_API
SDK Documentation:
out/module-SteamWebAPI.html
Supported Enpoints:
getFriendList
getGlobalAchievementPercentagesForApp
getGlobalStatsForGame
getNewsForApp
getOwnedGames
getPlayerAchievements
getPlayerSummaries
getRecentlyPlayedGames
getUserStatsForGame
isPlayingSharedGame
License
Latest version
0.0.4