Documentation
¶
Index ¶
- Constants
- Variables
- type Achievement
- type AchievementPercentages
- type App
- type AppList
- type AppNews
- type Apps
- type Config
- type Friend
- type Friends
- type FriendsList
- type Game
- type GamesOwned
- type GamesOwnedResponse
- type GlobalAchievements
- type GlobalStats
- type GlobalStatsResponse
- type JSONData
- type News
- type NewsItem
- type Option
- func (o *Option) SetAppIDs(appIDs []int)
- func (o *Option) SetIncludeAppInfo(includeAppInfo bool, IsService bool)
- func (o *Option) SetIncludePlayedFreeGames(includePlayedFreeGames bool, IsService bool)
- func (o *Option) SetSteamID(steamID int, IsService bool)
- func (o *Option) SetSteamIDs(ids []string) error
- type PlayerAchievement
- type PlayerInfo
- type PlayerStat
- type PlayerStatistics
- type PlayerStats
- type PlayerSummaries
- type PlayerSummariesResponse
- type Stat
- type Steam
- func (s *Steam) GetAppList() (*Apps, error)
- func (s *Steam) GetFriendList(o *Option) (*Friends, error)
- func (s *Steam) GetGlobalAchievement(o *Option) (*GlobalAchievements, error)
- func (s *Steam) GetGlobalStatsForGame(o *Option) (*GlobalStatsResponse, error)
- func (s *Steam) GetNews(o *Option) (*AppNews, error)
- func (s *Steam) GetOwnedGames(o *Option) (*GamesOwned, error)
- func (s *Steam) GetPlayerAchievements(o *Option) (*PlayerStats, error)
- func (s *Steam) GetPlayerSummaries(o *Option) (*PlayerSummaries, error)
- func (s *Steam) GetUserStatsForGame(o *Option) (*PlayerStats, error)
- func (s *Steam) SetSteamKey(key string)
Constants ¶
const (
BaseURL = "https://api.steampowered.com"
)
Variables ¶
var (
ErrSteamIDsExceedsLimit = errors.New("Steam IDs exceeds the max allowed steam IDs")
)
Functions ¶
This section is empty.
Types ¶
type Achievement ¶
type AchievementPercentages ¶
type AchievementPercentages struct {
Achievements []Achievement `json:"achievements"`
}
type Friends ¶
type Friends struct {
List FriendsList `json:"friendslist"`
}
type FriendsList ¶
type FriendsList struct {
Friends []Friend `json:"friends"`
}
type GamesOwned ¶
type GamesOwned struct {
GamesOwnedResponse GamesOwnedResponse `json:"response"`
}
type GamesOwnedResponse ¶
type GlobalAchievements ¶
type GlobalAchievements struct {
Percentages AchievementPercentages `json:"achievementpercentages"`
}
type GlobalStats ¶
type GlobalStatsResponse ¶
type GlobalStatsResponse struct {
GlobalStats GlobalStats `json:"response"`
}
type NewsItem ¶
type NewsItem struct { GID string `json:"gid"` Title string `json:"title"` URL string `json:"url"` IsExternalURL bool `json:"is_external_url"` Author string `json:"author"` Contents string `json:"contents"` FeedLabel string `json:"feedlabel"` DateUnix int `json:"date"` Date time.Time `json:"-"` FeedName string `json:"feedname"` }
type Option ¶
type Option struct { AppID int Count int MaxLength int Names []string SteamIDs string SteamID string Relationship string Language string IncludeAppInfo bool IncludePlayedFreeGames bool HasJSONData bool JSONData JSONData }
func (*Option) SetIncludeAppInfo ¶
func (*Option) SetIncludePlayedFreeGames ¶
func (*Option) SetSteamID ¶
Set the steam ID filter, If IsService is set true then the filters are only sent as JSON input
func (*Option) SetSteamIDs ¶
Set steamIDs to Option
type PlayerAchievement ¶
type PlayerInfo ¶
type PlayerInfo struct { SteamID string `json:"steamid"` CommunityVisibilityState int `json:"communityvisibilitystate"` ProfileState int `json:"profilestate"` ProfileName string `json:"personaname":` LastLogOff int `json:"lastlogoff"` ProfileURL string `json:"profileurl"` Avatar string `json:"avatar"` AvatarMedium string `json:"avatarmedium"` AvatarFull string `json:"avatarfull"` PersonaState int `json:"personastate"` RealName string `json:"realname"` PrimaryClanID string `json:"primaryclanid"` TimeCreated int `json:"timecreated"` PersonaStateFlags int `json:"personastateflags"` LocalCountryCode string `json:"loccountrycode"` LocalStateCode string `json:"locstatecode"` LocalCityID int `json:"loccityid"` GameID int `json:"gameid"` GameServerIP string `json:"gameserverip"` GameExtraInfo string `json:"gameextrainfo"` }
type PlayerStat ¶
type PlayerStatistics ¶
type PlayerStatistics struct { SteamID string `json:"steamID"` GameName string `json:"gameName"` Achievements []PlayerAchievement `json:"achievements"` Stats []PlayerStat `json:"stats"` }
type PlayerStats ¶
type PlayerStats struct {
Stats PlayerStatistics `json:"playerstats"`
}
type PlayerSummaries ¶
type PlayerSummaries struct {
Response PlayerSummariesResponse `json:"response"`
}
type PlayerSummariesResponse ¶
type PlayerSummariesResponse struct {
PlayerInfos []PlayerInfo `json:"players"`
}
type Steam ¶
type Steam struct {
// contains filtered or unexported fields
}
func (*Steam) GetAppList ¶
Get list of all apps present in steam along with their App IDs.
func (*Steam) GetFriendList ¶
Get player's friend list using their steam id. Version: v0001
Options:
SteamID(Mandatory) - Steam ID of the player.
Relationship(Madatory) - Relationship filter. Possible values are all, friend.
func (*Steam) GetGlobalAchievement ¶
func (s *Steam) GetGlobalAchievement(o *Option) (*GlobalAchievements, error)
Get global acheivements overview of a specific game in percentage. Version: v0002
Options:
AppID(Mandatory) - App for which you need the global achievements.
func (*Steam) GetGlobalStatsForGame ¶
func (s *Steam) GetGlobalStatsForGame(o *Option) (*GlobalStatsResponse, error)
Get global stats detail for a particular achievement for the given game. Version: v0001
Options:
AppID(Mandatory) - App for which you need the global stats.
Names(Mandatory, atleast 1) - The achievement name/names for which you need the global stats.
func (*Steam) GetNews ¶
Get news related to the application specified by application's ID. Version: v0002
Options:
AppID(Mandatory) - App for which you need the news.
Count(Optional) - Number of news articles you want to receive.
MaxLength(Optional) - Maximum length of each news entry.
func (*Steam) GetOwnedGames ¶
func (s *Steam) GetOwnedGames(o *Option) (*GamesOwned, error)
Get 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 steam API key you are using is linked to the steamid you are requesting). Version: v0001
Options:
This API is a service API, you set the filters by using IsService=true.
SteamID(Mandatory) - Steam ID of the player you need achievement stats for.
IncludeAppInfo(Optional) - Include game name and logo information in the output. The default is to return appids only.
IncludePlayedFreeGames(Optional) - 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.
AppIDs(Optional) - App IDs to verify if the user owns it.
func (*Steam) GetPlayerAchievements ¶
func (s *Steam) GetPlayerAchievements(o *Option) (*PlayerStats, error)
Get player's achievements for the given app. Version: v0001
Options:
SteamID(Mandatory) - Steam ID of the player you need achievement stats for.
AppID(Mandatory) - The Application for which achievements are needed.
l(Optional) - Language in which the achievements should be displayed.
func (*Steam) GetPlayerSummaries ¶
func (s *Steam) GetPlayerSummaries(o *Option) (*PlayerSummaries, error)
Get player summaries using their steamids. Version: v0002
Options:
SteamIDs(Mandatory) - You can set comma seperated steamIDs or use Option's method SetSteamIDs(steamIDs[]string)
Steam should have been initialized with Steam API Key Or use Steam's SetSteamKey(key string) to set the Steam API key
func (*Steam) GetUserStatsForGame ¶
func (s *Steam) GetUserStatsForGame(o *Option) (*PlayerStats, error)
Get list of achievements by this user for the given app/game. Version: v0002
Options:
SteamID(Mandatory) - Steam ID of the player you need achievement stats for.
AppID(Mandatory) - The Application for which achievements are needed.
l(Optional) - Language in which the achievements should be displayed.
func (*Steam) SetSteamKey ¶
Set steam key for the Steam API instance