Deno steam api
Deno Wrapper to communicate with Steam Web API
SteamID64 Finder
Please refer to http://steamid.co/ or http://steamidconverter.com/ to find the user steam id.
Usage
import Steam from "https://deno.land/x/steam/mod.ts";
const steam = new Steam("your api key");
Api
GetAppList
GetServersAtAddress
GetNewsForApp
@param appid String
@param options (Optional) GetNewsForAppOptions
@return Output
/** * Returns the latest news of a game specified by its appID. * @param appid * @param {GetNewsForAppOptions} options * @return {Output} */ const news = await steam.GetNewsForApp(440, { count: 3 }).catch(console.error);
GetGlobalAchievementPercentagesForApp
@param gameid Number
@param format (Optional) Format
@return Output
/** * Returns on global achievements overview of a specific game in percentages. * @param {number!} gameid AppID of the game you want the news of. * @param {Format?} format * @return {Output} */ const GlobalAchievementPercentages = await steam.GetGlobalAchievementPercentagesForApp({ gameid: 440 }).catch(console.error);
GetPlayerSummaries
@param steamids [String]
@param format (Optional) Format
@return Output
/** * Returns basic profile information for a list of 64-bit Steam IDs. * @param {[string]!} steamids Comma-delimited list of 64 bit Steam IDs to return profile information for. Up to 100 Steam IDs can be requested. * @param {Format?} format * @return {Output} */ const PlayerSummaries = await steam.GetPlayerSummaries({ steamids: "steam ID" }).catch(console.error);
GetFriends
@param steamid String
@param relationship RelationShip
@param format (Optional) Format
@return Output
/** * Returns the friend list of any Steam user, provided his Steam Community profile visibility is set to "Public". * @param {string!} steamid 64 bit Steam ID to return friend list for. * @param {RelationShip!} relationship Relationship filter. Possibles values: all, friend. * @param {Format?} format * @return {Output} */ const Friends = await steam.GetFriendList({ steamid: "steam ID", relationship: "all" }).catch(console.error);
GetPlayerAchievements
@param steamid String
@param appid Number
@param options (Optional) PlayerAchievementsOptions
@return Output
/** * Returns a list of achievements for this user by app id. * @param {string!} steamid 64 bit Steam ID to return friend list for. * @param {number!} appid The ID for the game you're requesting. * @param {PlayerAchievementsOptions} options * @return {Output} */ const PlayerAchievements = await steam.GetPlayerAchievements("steam ID", 730).catch(console.error);
GetUserStatsForGame
@param steamid String
@param appid Number
@param options (Optional) UserStatsForGameOptions
@return Output
/** * Returns a list of achievements for this user by app id. * @param {string!} steamid 64 bit Steam ID to return friend list for. * @param {number!} appid The ID for the game you're requesting. * @param {UserStatsForGameOptions} options * @return {Output} */ const UserStats = await steam.GetUserStatsForGame("steam ID", 730).catch(console.error);
GetNumberOfCurrentPlayers
@param appid Number
@param format (Optional) Format
@return Output
/** * Returns number of current players by app id. * @param {number!} appid The ID for the game you're requesting. * @param {Format} format * @return {Output} */ const NumberOfCurrentPlayers = await steam.GetNumberOfCurrentPlayers(730).catch(console.error);
GetOwnedGames
@param steamid String
@param options (Optional) OwnedGamesOptions
@return Output
/** * Returns a list of games a player owns along with some playtime information. * @param {string!} steamid 64 bit Steam ID to return friend list for. * @param {OwnedGamesOptions} options * @return {Output} */ const Games = await steam.GetOwnedGames("steam ID").catch(console.error);
GetRecentlyPlayedGames
@param steamid String
@param options (Optional) RecentlyPlayedGamesOptions
@return Output
/** * Returns a list of games a player has played in the last two weeks. * @param {string!} steamid 64 bit Steam ID to return friend list for. * @param {RecentlyPlayedGamesOptions} options * @return {Output} */ const Games = await steam.GetRecentlyPlayedGames("steam ID").catch(console.error);
TypeDef
Format
type Format = "json" | "xml";
RelationShip
type RelationShip = "all" | "friend";
GetNewsForAppOptions
type GetNewsForAppOptions = { count?: number, maxlength?: number, format?: Format };
PlayerAchievementsOptions
type PlayerAchievementsOptions = { L?: string format?: Format }
UserStatsForGameOptions
type UserStatsForGameOptions = PlayerAchievementsOptions;
OwnedGamesOptions
type OwnedGamesOptions = { includeAppinfo?: boolean, includePlayedFreeGames?: boolean, format?: Format };
RecentlyPlayedGamesOptions
type RecentlyPlayedGamesOptions = { count?: number; format?: Format };
Output
type Output = Promise<string | JSON | undefined>;