Giter VIP home page Giter VIP logo

steamapi-node's Introduction

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)

steamapi-node's People

Contributors

devyukine avatar auguwu avatar

Stargazers

Thomas avatar Nikola Selic avatar aderag phutsathan avatar Dennis K. avatar Jess avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.