steampe

2.1.7 • Public • Published

SteamPE

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.

Installation

// NPM Installation
$ npm install steampe --save
// Yarn Installation 
$ yarn add steampe

Setting It Up!

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.
})

Methods

resolve

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...

getPlayerSummaries

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))

getNewsForApp

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))

getGlobalAchievementPercentagesForApp

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))

getAppList

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));

getFriendList

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))

getPlayerAchievements

Grabs the user's achievements.

steamAPI.getPlayerAchievements('504230', '76561198197461128')
    .then(res => console.log(res))
    .catch(err => console.error(err))

getUserStatsForGame

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))

getOwnedGames

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))

getRecentlyPlayedGames

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))

isPlayingSharedGame

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))

getSchemaForGame

Returns the schema for the app.

steamAPI.getSchemaForGame('504230')
    .then(res => console.log(res)) // Expecting output: the app schema
    .catch(err => console.error(err))

getPlayerBans

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))

getPlayerLevel

Grabs the user's level

steamAPI.getPlayerLevel('76561198197461128')
    .then(res => console.log(res)) // Expecting output: 
    .catch(err => console.error(err))

getPlayerBadges

Returns user's badges.

steamAPI.getPlayerBadges('76561198197461128')
    .then(res => console.log(res)) // Expecting output: Returns user's badges.
    .catch(err => console.error(err))

getCommunityBadgeProgress

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))

Contributing

To contribute follow these simple steps

  1. Fork the project on github...
  2. Code what ever...
  3. Make a PR(Pull Request)...
  4. 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...

/steampe/

    Package Sidebar

    Install

    npm i steampe

    Weekly Downloads

    2

    Version

    2.1.7

    License

    Apache-2.0

    Unpacked Size

    41.8 kB

    Total Files

    9

    Last publish

    Collaborators

    • npmstonic