xDimGG / node-steamapi

An object-oriented Steam API wrapper for Node.js developers.
https://www.npmjs.com/package/steamapi
178 stars 43 forks source link

Idea: Add Game Leaderboard checks #4

Closed zetterburn closed 5 years ago

zetterburn commented 6 years ago

Currently it looks like you're only able to check leaderboard stats on a user-to-user basis, but being able to pull information directly from a leaderboard as a object list of players including nickname and score values would be nice.

Example for the game Rivals of Aether:

appID = 383980; leaderboardID = 2222327;

the code for checking a leaderboard would probably be something like:

steam.getGameLeaderboards(appID).then(lb => { console.log(lb); //object list of leaderboard ID's for game });

steam.getGameLeaderboard(leaderboardID, appID).then(lb => { /* lb would be an object of players in the top 200 list on the leaderboard */ console.log(lb.player[0].nickname, lb.player[0].score); //expected output: "No Love Deep Weeb, 2386" });

The leaderboardID corresponds to "Ranked Season 3 Leaderboard" for the game "Rivals of Aether". Under user stats, a player's score on this leaderboard is listed as player.stats.ranked3_score for that player. Link to leaderboard here: https://steamcommunity.com/stats/383980/leaderboards/2222327

xDimGG commented 6 years ago

Is there a uh... documented API endpoint for this?