Documentation ¶
Overview ¶
methods on the steam client
Index ¶
- Constants
- type Client
- func (c Client) GetFriendList(params GetFriendListParams) (*model.FriendList, error)
- func (c Client) GetGlobalAchievementPercentagesForApp(params GlobalAchievementPercentageParams) (*model.GlobalAchievementPercentages, error)
- func (c Client) GetNewsForApp(params GetNewsForAppParams) (*model.AppNews, error)
- func (c Client) GetNumberOfCurrentPlayers(params NumberOfCurrentPlayersParams) (*model.NumberOfCurrentPlayers, error)
- func (c Client) GetOwnedGames(params GetOwnedGamesParams) (*model.OwnedGames, error)
- func (c Client) GetPlayerAchievements(params PlayerAchievementsParams) (*model.PlayerAchievements, error)
- func (c Client) GetPlayerSummaries(params GetPlayerSummariesParams) (*model.PlayerSummaries, error)
- func (c Client) GetRecentlyPlayedGames(params GetRecentlyPlayedGamesParams) (*model.RecentlyPlayedGames, error)
- func (c Client) GetSchemaForGame(params SchemaForGameParams) (*model.GameSchemaGame, error)
- func (c Client) GetUserStatsForGame(params UserStatsForGameParams) (*model.UserStats, error)
- func (c Client) IsKeySet() bool
- type GetFriendListParams
- type GetNewsForAppParams
- type GetOwnedGamesParams
- type GetPlayerSummariesParams
- type GetRecentlyPlayedGamesParams
- type GlobalAchievementPercentageParams
- type GlobalGameStatsParams
- type NumberOfCurrentPlayersParams
- type PlayerAchievementsParams
- type SchemaForGameParams
- type UserStatsForGameParams
Constants ¶
const ( IPlayerService = "IPlayerService" GetOwnedGamesEndpoint = "GetOwnedGames" // v0001 GetRecentlyPlayedGamesEndpoint = "GetRecentlyPlayedGames" // v0001 )
const ( ISteamNews = "ISteamNews" GetNewsForAppEndpoint = "GetNewsForApp" // v0002 )
const ( ISteamUser = "ISteamUser" GetPlayerSummariesEndpoint = "GetPlayerSummaries" // v0002 GetFriendListEndpoint = "GetFriendList" // v0001 )
const ( ISteamUserStats = "ISteamUserStats" // v1 GetPlayerAchievementsEndpoint = "GetPlayerAchievements" // v0001 GetUserStatsForGameEndpoint = "GetUserStatsForGame" // v0002 GetGlobalAchievementPercentagesForAppEndpoint = "GetGlobalAchievementPercentagesForApp" // v0002 GetNumberOfCurrentPlayersEndpoint = "GetNumberOfCurrentPlayers" // v1 GetSchemaForGameEndpoint = "GetSchemaForGame" // v2 SetUserStatsForGameEndpoint = "SetUserStatsForGame" // v1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Key string // Access-/API-Key for the Steam API HttpClient *http.Client // An Http-Client to send requests with. Customizable }
This Client is used to send the requests to steam
func NewClientWithoutKey ¶
Create a Client, without Key
func (Client) GetFriendList ¶
func (c Client) GetFriendList(params GetFriendListParams) (*model.FriendList, error)
Returns the friend list of any Steam user, provided their Steam Community profile visibility is set to "Public".
Key required ¶
Arguments
- steamid 64 bit Steam ID to return friend list for.
- relationship Relationship filter. Possibles values: all, friend.
- format Output format. json (default), xml or vdf.
func (Client) GetGlobalAchievementPercentagesForApp ¶
func (c Client) GetGlobalAchievementPercentagesForApp(params GlobalAchievementPercentageParams) (*model.GlobalAchievementPercentages, error)
Returns on global achievements overview of a specific game in percentages.
No key required.
Arguments
- gameid AppID of the game you want the news of.
- format Output format. json (default), xml or vdf.
func (Client) GetNewsForApp ¶
func (c Client) GetNewsForApp(params GetNewsForAppParams) (*model.AppNews, error)
GetNewsForApp returns the latest of a game specified by its appID.
Arguments:
- appid AppID of the game you want the news of.
- count How many news enties you want to get returned.
- maxlength Maximum length of each news entry.
- format Output format. json (default), xml or vdf.
returns: output in the specified format
func (Client) GetNumberOfCurrentPlayers ¶
func (c Client) GetNumberOfCurrentPlayers(params NumberOfCurrentPlayersParams) (*model.NumberOfCurrentPlayers, error)
TODO: model
func (Client) GetOwnedGames ¶
func (c Client) GetOwnedGames(params GetOwnedGamesParams) (*model.OwnedGames, error)
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).
Key required ¶
Arguments
- steamid The SteamID of the account.
- include_appinfo Include game name and logo information in the output. The default is to return appids only.
- include_played_free_games 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.
- format Output format. json (default), xml or vdf.
- appids_filter You can optionally filter the list to a set of appids.
func (Client) GetPlayerAchievements ¶
func (c Client) GetPlayerAchievements(params PlayerAchievementsParams) (*model.PlayerAchievements, error)
Returns a list of achievements for this user by app id
Key required ¶
Arguments
- steamid 64 bit Steam ID to return friend list for.
- appid The ID for the game you're requesting
- l (Optional) Language. If specified, it will return language data for the requested language.
func (Client) GetPlayerSummaries ¶
func (c Client) GetPlayerSummaries(params GetPlayerSummariesParams) (*model.PlayerSummaries, error)
Returns basic profile information for a list of 64-bit Steam IDs.
key required
Arguments
- steamids Comma-delimited list of 64 bit Steam IDs to return profile information for. Up to 100 Steam IDs can be requested.
- format Output format. json (default), xml or vdf.
func (Client) GetRecentlyPlayedGames ¶
func (c Client) GetRecentlyPlayedGames(params GetRecentlyPlayedGamesParams) (*model.RecentlyPlayedGames, error)
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).
Key required ¶
Arguments
- steamid The SteamID of the account.
- count 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)
- format Output format. json (default), xml or vdf.
func (Client) GetSchemaForGame ¶
func (c Client) GetSchemaForGame(params SchemaForGameParams) (*model.GameSchemaGame, error)
key required
func (Client) GetUserStatsForGame ¶
func (c Client) GetUserStatsForGame(params UserStatsForGameParams) (*model.UserStats, error)
Returns a list of achievements for this user by app id
Key required ¶
Arguments
- steamid 64 bit Steam ID to return friend list for.
- appid The ID for the game you're requesting
- l (Optional) Language. If specified, it will return language data for the requested language.
type GetFriendListParams ¶
type GetFriendListParams struct { SteamId int64 // SteamID of user Relationship config.FriendsListRelationship // relationship type Format config.OutputFormat // Format of the output }
Parameters for the GetFriendList method
type GetNewsForAppParams ¶
type GetNewsForAppParams struct { AppId uint32 // AppID to retrieve news for Count uint32 // # of posts to retrieve (default 20) MaxLength uint32 // Maximum length for the content to return, if this is 0 the full content is returned, if it's less then a blurb is generated to fit. Format config.OutputFormat // Format of the output }
type GetOwnedGamesParams ¶
type GetOwnedGamesParams struct { SteamId int64 // The player we're asking about IncludeAppinfo bool // true if we want additional details (name, icon) about each game IncludePlayedFreeGames bool // Free games are excluded by default. If this is set, free games the user has played will be returned. Format config.OutputFormat // Format of the output AppIdsFilter []int64 // (optional) if set, restricts result set to the passed in apps Language *config.Language // (optional) output Language }
Parameters for the GetOwnedGames method
type GetPlayerSummariesParams ¶
type GetPlayerSummariesParams struct { SteamIds []int64 // Comma-delimited list of SteamIDs (max: 100) Format config.OutputFormat // Format of the output }
Parameters for the GetPlayerSummaries method
type GetRecentlyPlayedGamesParams ¶
type GetRecentlyPlayedGamesParams struct { SteamId int64 // The player we're asking about Count int // The number of games to return (0/unset: all) Format config.OutputFormat // Format of the output }
Parameters for the GetRecentlyPlayedGames method
type GlobalAchievementPercentageParams ¶
type GlobalAchievementPercentageParams struct { GameId uint64 // GameID to retrieve the achievement percentages for Format config.OutputFormat // Format of the output }
Parameters for the GetGlobalAchievementPercentage method
type GlobalGameStatsParams ¶
type GlobalGameStatsParams struct { AppID uint32 // AppID that we're getting global stats for Count uint32 // Number of stats get data for Names []string // Names of stat to get data for Format config.OutputFormat // Format of the output StartDate *uint32 // (optional) Start date for daily totals (unix epoch timestamp) EndDate *uint32 // (optional) End date for daily totals (unix epoch timestamp) }
Parameters for the GetGlobalGameStats method
type NumberOfCurrentPlayersParams ¶
type NumberOfCurrentPlayersParams struct { GameId uint64 // AppID that we're getting user count for Format config.OutputFormat // Format of the output }
Parameters for the GetNumberOfCurrentPlayers method
type PlayerAchievementsParams ¶
type PlayerAchievementsParams struct { SteamId uint64 // SteamID of user AppId uint32 // AppID to get achievements for Format config.OutputFormat // Format of the output Language *config.Language // (optional) output Language }
Parameters for the GetPlayerAchievements method
type SchemaForGameParams ¶
type SchemaForGameParams struct { AppId uint32 // access key Format config.OutputFormat // Format of the output Language *config.Language // (optional) output Language }
Parameters for the GetSchemaForGame method
type UserStatsForGameParams ¶
type UserStatsForGameParams struct { SteamId uint64 // SteamID of user AppId uint32 // appid of game Format config.OutputFormat // Format of the output Language *config.Language // (optional) output Language }
Parameters for the GetUserStatsForGame method
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
model
|
|
ISteamUserStats
user stats for a specific game
|
user stats for a specific game |