UNPKG

steamwebapi

Version:
2,539 lines (631 loc) 31 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Module: SteamWebAPI</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Module: SteamWebAPI</h1> <section> <header> </header> <article> <div class="container-overview"> <div class="description">This module exports the API helper functions</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line180">line 180</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".getFriendList"><span class="type-signature">(static) </span>getFriendList<span class="signature">(steamid, relationship, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get friend list Returns the friend list of any Steam user, provided his Steam Community profile visibility is set to "Public" </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steamid</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">64 bit Steam ID to return friend list for</td> </tr> <tr> <td class="name"><code>relationship</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Relationship filter. Possibles values: all, friend</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line410">line 410</a> </li></ul></dd> </dl> <h4 class="name" id=".getGlobalAchievementPercentagesForApp"><span class="type-signature">(static) </span>getGlobalAchievementPercentagesForApp<span class="signature">(gameid, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get global achievement percentages for an app ID Returns on global achievements overview of a specific game in percentages </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>gameid</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">AppID of the game you want the percentages of</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line362">line 362</a> </li></ul></dd> </dl> <h4 class="name" id=".getGlobalStatsForGame"><span class="type-signature">(static) </span>getGlobalStatsForGame<span class="signature">(gameid, count, name, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get global stats for game Get the global stats for the provided achievement names </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>gameid</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">AppID of the game you want the stats of</td> </tr> <tr> <td class="name"><code>count</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">Length of the array of global stat names you will be passing</td> </tr> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">array</span> </td> <td class="description last">Name of the achievement as defined in Steamworks</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line378">line 378</a> </li></ul></dd> </dl> <h4 class="name" id=".getNewsForApp"><span class="type-signature">(static) </span>getNewsForApp<span class="signature">(appid, count, maxLength, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get news for an app ID GetNewsForApp returns the latest of a game specified by its appID </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>appid</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">AppID of the game you want the news of</td> </tr> <tr> <td class="name"><code>count</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">How many news enties you want to get returned</td> </tr> <tr> <td class="name"><code>maxLength</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">Maximum length of each news entry</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line346">line 346</a> </li></ul></dd> </dl> <h4 class="name" id=".getOwnedGames"><span class="type-signature">(static) </span>getOwnedGames<span class="signature">(steamid, include_appinfo, include_played_free_games, appids_filter, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get owned games GetOwnedGames returns a list of games a player owns along with some playtime information, if the profile is publicly visible. Private, friends-only, and other privacy settings are not supported unless you are asking for your own personal details (ie the WebAPI key you are using is linked to the steamid you are requesting). </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steamid</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The SteamID of the account</td> </tr> <tr> <td class="name"><code>include_appinfo</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Include game name and logo information in the output. The default is to return appids only</td> </tr> <tr> <td class="name"><code>include_played_free_games</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">By default, free games like Team Fortress 2 are excluded (as technically everyone owns them). If include_played_free_games is set, they will be returned if the player has played them at some point. This is the same behavior as the games list on the Steam Community</td> </tr> <tr> <td class="name"><code>appids_filter</code></td> <td class="type"> <span class="param-type">array</span> </td> <td class="description last">You can optionally filter the list to a set of appids. Note that these cannot be passed as a URL parameter, instead you must use the JSON format described in Steam_Web_API#Calling_Service_interfaces. The expected input is an array of integers (in JSON: "appids_filter: [ 440, 500, 550 ] " )</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line472">line 472</a> </li></ul></dd> </dl> <h4 class="name" id=".getPlayerAchievements"><span class="type-signature">(static) </span>getPlayerAchievements<span class="signature">(steamid, appid, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get player achievements Returns a list of achievements for this user by app id </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steamid</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">64 bit Steam ID to return friend list for</td> </tr> <tr> <td class="name"><code>appid</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">The ID for the game you're requesting</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line426">line 426</a> </li></ul></dd> </dl> <h4 class="name" id=".getPlayerSummaries"><span class="type-signature">(static) </span>getPlayerSummaries<span class="signature">(steamids, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get player summaries Returns basic profile information for a list of 64-bit Steam IDs </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steamids</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Comma-delimited list of 64 bit Steam IDs to return profile information for. Up to 100 Steam IDs can be requested</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line395">line 395</a> </li></ul></dd> </dl> <h4 class="name" id=".getRecentlyPlayedGames"><span class="type-signature">(static) </span>getRecentlyPlayedGames<span class="signature">(steamid, count, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get recently played games GetRecentlyPlayedGames returns a list of games a player has played in the last two weeks, if the profile is publicly visible. Private, friends-only, and other privacy settings are not supported unless you are asking for your own personal details (ie the WebAPI key you are using is linked to the steamid you are requesting). </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steamid</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The SteamID of the account</td> </tr> <tr> <td class="name"><code>count</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">Optionally limit to a certain number of games (the number of games a person has played in the last 2 weeks is typically very small)</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line503">line 503</a> </li></ul></dd> </dl> <h4 class="name" id=".getUserStatsForGame"><span class="type-signature">(static) </span>getUserStatsForGame<span class="signature">(steamid, appid, callback)</span><span class="type-signature"></span></h4> <div class="description"> Get user stats for game Returns a list of achievements for this user by app id </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steamid</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">64 bit Steam ID to return friend list for</td> </tr> <tr> <td class="name"><code>appid</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">The ID for the game you're requesting</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line442">line 442</a> </li></ul></dd> </dl> <h4 class="name" id=".isPlayingSharedGame"><span class="type-signature">(static) </span>isPlayingSharedGame<span class="signature">(steamid, appid_playing, callback)</span><span class="type-signature"></span></h4> <div class="description"> Is playing shared game IsPlayingSharedGame returns the original owner's SteamID if a borrowing account is currently playing this game. If the game is not borrowed or the borrower currently doesn't play this game, the result is always 0. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steamid</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The SteamID of the account playing</td> </tr> <tr> <td class="name"><code>appid_playing</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">The AppID of the game currently playing</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">Function to handle the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line526">line 526</a> </li></ul></dd> </dl> <h4 class="name" id=".send"><span class="type-signature">(static) </span>send<span class="signature">(method, parameters, callback)</span><span class="type-signature"></span></h4> <div class="description"> Send API request Send the specified request to the Steam Web API and execute the callback upon success or failure </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>method</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The method name on the Steam Web API</td> </tr> <tr> <td class="name"><code>parameters</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">An object containing all the required parameters for the API request</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">The function to call upon success or failure</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line229">line 229</a> </li></ul></dd> </dl> <h4 class="name" id=".setAPIKey"><span class="type-signature">(static) </span>setAPIKey<span class="signature">(newAPIKey)</span><span class="type-signature"> &rarr; {boolean}</span></h4> <div class="description"> Set API Key Sets the API key that will be used to validate the API requests </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>newAPIKey</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The new API key to use</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line208">line 208</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> If this function successfully set the provided API key </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> <h4 class="name" id=".setFormat"><span class="type-signature">(static) </span>setFormat<span class="signature">(newFormat)</span><span class="type-signature"></span></h4> <div class="description"> Set response format Sets the default response format for responses from the Steam Web API </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>newFormat</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The new preferred response format</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="SteamWebAPI.js.html">SteamWebAPI.js</a>, <a href="SteamWebAPI.js.html#line192">line 192</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-SteamWebAPI.html">SteamWebAPI</a></li></ul><h3>Global</h3><ul><li><a href="global.html#parametersValid">parametersValid</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Apr 22 2018 11:14:46 GMT-0400 (EDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>