This is just a simple steam API wrapper built in JS/Node.js. This will also require a steam API key, if you dont have one go here to get one.
// NPM Installation
$ npm install steampe --save
// Yarn Installation
$ yarn add steampe
const SteamPE = require('steampe');
const steamAPI = new SteamPE({
// This also come with options.
// The Steam API key which is required...
key: 'STEAM_API_KEY'
// If set this will default any steamID64 parameter with the option like the example below.
defaultUser: 'STEAM_ID64',
// If set this will default any appID parameter with this option like the example below.
defaultApp: 'APP_ID'
// Remember the IDs' must be in a string, or else it shall error.
})
Resolves steam user's vanityURL/name to a steamID64
steamAPI.resolve('https://steamcommunity.com/id/IMSTONIC/')
.then(res => console.log(res)) // Expecting output: The user steamID64.
.catch(err => console.error(err)) // Handling your errors...
Grabs the steam user / users summary.
// Can either use an array or a string of userIDs
steamAPI.getPlayerSummaries('76561198197461128')
.then(res => console.log(res)) // Expecting output: The user summaries...
.catch(err => console.error(err))
steamAPI.getPlayerSummaries(['76561198197461128', '76561198242531902'])
.then(res => console.log(res)) // Expecting output: The users summaries...
.catch(err => console.error(err))
Grabs any recent news on the app.
steamAPI.getNewsForApp('504230')
.then(res => console.log(res)) // Expecting output: The news for the app...
.catch(err => console.error(err))
Grabs the global achievement percentages for the app.
steamAPI.getGlobalAchievementPercentagesForApp('504230')
.then(res => console.log(res)) // Expecting output: The Global achievement percentages for the app.
.catch(err => console.error(err))
Grabs a list of apps from steam.
steamAPI.getAppList()
.then(res => console.log(res)) // Expecting output: The steam app list...
.catch(err => console.error(err));
Grabs the user's friend list.
steamAPI.getFriendList('76561198197461128')
.then(res => console.log(res)) // Expecting output: The user's friend list...
.catch(err => console.error(err))
Grabs the user's achievements.
steamAPI.getPlayerAchievements('504230', '76561198197461128')
.then(res => console.log(res))
.catch(err => console.error(err))
Grabs the user's stats for the game / app.
steamAPI.getUserStatsForGame('504230', '76561198197461128')
.then(res => console.log(res)) // Expecting output: The user stats for the app...
.catch(err => console.error(err))
Grab's the user's owned games/apps.
steamAPI.getOwnedGames('76561198197461128')
.then(res => console.log(res)) // Expecting output: The user owned games in appids...
.catch(err => console.error(err))
Returns potential user's recently played games.
steamAPI.getRecentlyPlayedGames('76561198197461128')
.then(res => console.log(res)) // Expecting output: The most recent appids that the user played.
.catch(err => console.error(err))
If that potential user is playing a shared game... this shall return the user who bought the game id.
steamAPI.isPlayingSharedGame('76561198197461128', '504230')
.then(res => console.log(res))
.catch(err => console.error(err))
Returns the schema for the app.
steamAPI.getSchemaForGame('504230')
.then(res => console.log(res)) // Expecting output: the app schema
.catch(err => console.error(err))
Returns Community, VAC, and Economy ban statuses for given users'.
// Can either use an array or a string of userIDs
steamAPI.getPlayerBans('76561198197461128')
.then(res => console.log(res)) // Expecting output: The user ban info
.catch(err => console.error(err))
steamAPI.getPlayerBans(['76561198197461128', '76561198242531902'])
.then(res => console.log(res)) // Expecting output: The users ban info
.catch(err => console.error(err))
Grabs the user's level
steamAPI.getPlayerLevel('76561198197461128')
.then(res => console.log(res)) // Expecting output:
.catch(err => console.error(err))
Returns user's badges.
steamAPI.getPlayerBadges('76561198197461128')
.then(res => console.log(res)) // Expecting output: Returns user's badges.
.catch(err => console.error(err))
Grabs the global / community badge progess fror the directed steam user and app.
steamAPI.getCommunityBadgeProgress('76561198197461128', '504230')
.then(res => console.log(res)) // Expecting output: the badge communtity progress
.catch(err => console.error(err))
To contribute follow these simple steps
- Fork the project on github...
- Code what ever...
- Make a PR(Pull Request)...
- I review it and probably commit it...
This is totally optional... If you don't want to do it you do not have to, You will still have the package and everything...