Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

steamapi-node

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

steamapi-node

a Node.js wrapper for the steam api

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

steamapi-node

A wrapper for the Steam Api written in javascript.

Information

This is a fork of node-steamapi where i only refactored the code to be more Object Oriented aswell as fixed little stuff with JSDocs as example and used snekfetch for the http requests.

also it is fully documented with JsDocs and has typings included.

Usage

You just require the module and create a new Class instance of the exported class. You need to provide atleast an key but it also has caching options to cache requests for getGameNews because this enpoint has an rate-limit of 200 every 5 minutes. aswell as you can provide an array of names from these endpoint groups you dont need to save memory.

Examples:

const SteamUser = require('steamapi-node');
const steam = new SteamUser("YOUR STEAM API KEY HERE");

steam.others.resolve('/profiles/76561198334532819/').then(id => {
    // handle returned data
    steam.users.getUserFriends(id).then(result => {
        // handle more returnded data
    })
})

or with async/await

const SteamUser = require('steamapi-node');
const steam = new SteamUser("YOUR STEAM API KEY HERE");

const getFriends = async input => {
    const id = await steam.others.resolve(input);
    const friends = await steam.users.getUserFriends(id);
    return friends
}
getFriends('/profiles/76561198334532819/').then(result => {
    // handle returned data
});

if you only need specific endpoint groups as example you can do this

const SteamUser = require('steamapi-node');
const steam = new SteamUser("YOUR STEAM API KEY HERE", {}, ['games', 'users']);

steam.others.resolve('/profiles/76561198334532819/').then(result => {
    // handle returned data
})

Methods overview

Others

  • resolve(info)
  • get(path)
  • getAppList()
  • getFeaturedCategories()
  • getServers(ip)

Games

  • getFeaturedGames()
  • getGameAchievements(app)
  • getGameDetails(app)
  • getGameNews(app)
  • getGamePlayers(app)
  • getGameSchema(app)

Users

  • getUserAchievements(id, app)
  • getUserBadges(id)
  • getUserBans(id)
  • getUserFriends(id)
  • getUserGroups(id)
  • getUserLevel(id)
  • getUserOwnedGames(id)
  • getUserRecentGames(id)
  • getUserServers([key])
  • getUserStats(id, app)
  • getUserSummary(id)

Keywords

FAQs

Package last updated on 28 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc