module SteamApi::Urls

This module is a container for all of the different URL's for the Steam Web API

Public Class Methods

badges(userid) click to toggle source

A helper method which gets the base url for API call to get users badges @param userid [String] A single user Steam id 64 @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 105
def self.badges(userid)
  "http://api.steampowered.com/IPlayerService/GetBadges/v1?&steamid=#{userid}"
end
community_badge_progress(userid, badge_id) click to toggle source

A helper method which gets the base url for API call to get users badges @param userid [String] A single user Steam id 64 @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 112
def self.community_badge_progress(userid, badge_id)
  "http://api.steampowered.com/IPlayerService/GetCommunityBadgeProgress/v1?&steamid=#{userid}&badgeid=#{badge_id}"
end
friend_list(id, relationship) click to toggle source

A helper method which gets the base url for friend list API call @param id [String] The users steam_id_64 @param relationship [String] The given relationship to look for (either friend or all) @return [String] An interpolated string for the API call to get a users friends list.

It contains the users ID, but not the API key
# File lib/steam_api/urls.rb, line 9
def self.friend_list(id, relationship)
  "http://API.steampowered.com/ISteamUser/GetFriendList/v0001/?steamid=#{id}&relationship=#{relationship}"
end
global_achievement_percentages_for_app(id) click to toggle source

A helper method which gets the base url for API call to get global achievement percentages for app @param id [String] A single Steam app id @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 44
def self.global_achievement_percentages_for_app(id)
  "http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0002/?&gameid=#{id}"
end
number_of_current_players(id) click to toggle source

A helper method which gets the base url for API call to get current number of players for an app @param id [String] A single Steam app id @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 51
def self.number_of_current_players(id)
  "http://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1/?appid=#{id}"
end
owned_games(userid, include_appinfo, include_played_free_games) click to toggle source

A helper method which gets the base url for API call to get a list of users owned games @param userid [String] A single user id 64 @param include_appinfo [Boolean] (Optional) A boolean indicating whether to include information about the game (name, pictures, playtime) @param include_played_free_games [Boolean] (Optional) A boolean indicating whether to include free to play games @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 91
def self.owned_games(userid, include_appinfo, include_played_free_games)
  "http://api.steampowered.com/IPlayerService/GetOwnedGames/v1?&steamid=#{userid}&include_played_free_games=#{include_played_free_games}&include_appinfo=#{include_appinfo}"
end
player_achievements(userid, appid) click to toggle source

A helper method which gets the base url for API call to get achievement completion for a player and app @param userid [String] A single user steam id 64 @param appid [String] A single Steam app id @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 59
def self.player_achievements(userid, appid)
  "http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v1/?&steamid=#{userid}&appid=#{appid}"
end
player_bans(ids) click to toggle source

A helper method which gets the base url for API call to get info about player bans @param ids [String] A string containing a single steam_id_64 or multiple comma delimited steam_id_64s @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 16
def self.player_bans(ids)
  "http://api.steampowered.com/ISteamUser/GetPlayerBans/v1?&steamids=#{ids}"
end
player_summaries(ids) click to toggle source

A helper method which gets the base url for API call to get info about player summaries @param ids [String] A string containing a single steam_id_64 or multiple comma delimited steam_id_64s @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 23
def self.player_summaries(ids)
  "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?&steamids=#{ids}"
end
recently_played_games(userid, count) click to toggle source

A helper method which gets the base url for API call to get info about users recently played games @param userid [String] A single user id 64 @param count [Fixnum] The max number of games to find @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 82
def self.recently_played_games(userid, count)
  "http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v1?&steamid=#{userid}&count=#{count}"
end
schema_for_game(appid) click to toggle source

A helper method which gets the base url for API call to get a schema for a game @param appid [String] A single game steam id @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 66
def self.schema_for_game(appid)
  "http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/?&appid=#{appid}"
end
steam_level(userid) click to toggle source

A helper method which gets the base url for API call to get a users Steam level @param userid [String] A single user Steam id 64 @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 98
def self.steam_level(userid)
  "http://api.steampowered.com/IPlayerService/GetSteamLevel/v1?&steamid=#{userid}"
end
user_group_list(id) click to toggle source

A helper method which gets the base url for API call to get info about a players groups @param id [String] A single users steam_id_64 @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 30
def self.user_group_list(id)
  "http://api.steampowered.com/ISteamUser/GetUserGroupList/v1?steamid=#{id}"
end
user_stats_for_game(userid, appid) click to toggle source

A helper method which gets the base url for API call to get users stats for a game @param userid [String] A single user id 64 @param appid [String] A single game steam id @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 74
def self.user_stats_for_game(userid, appid)
  "http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v2/?&appid=#{appid}&steamid=#{userid}"
end
vanity_url(vanity_url) click to toggle source

A helper method which gets the base url for API call to get a users steam_id_64 @param vanity_url [String] A single users vanity url @return [String] An interpolated string for the API call (without the API key)

# File lib/steam_api/urls.rb, line 37
def self.vanity_url(vanity_url)
  "http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?&vanityurl=#{vanity_url}"
end