Skip to content

leighmacdonald/steamweb

Repository files navigation

steamweb

License: MIT Build Codacy Badge Go Report Card GoDoc Discord chat

A golang library for querying the steam webapi.

Endpoints

  • ISteamApps

    • GetAppList
    • GetServersAtAddress
    • UpToDateCheck
  • ISteamEconomy

    • GetAssetClassInfo
    • GetAssetPrices
  • ISteamNews

    • GetNewsForApp
  • ISteamUser

    • GetFriendList
    • GetPlayerBans
    • GetPlayerSummaries
    • GetUserGroupList
    • ResolveVanityURL
  • IPlayerService

    • GetRecentlyPlayedGames
    • GetOwnedGames
    • GetSteamLevel
    • GetBadges
    • GetCommunityBadgeProgress
  • ISteamWebAPIUtil

    • GetServerInfo
    • GetSupportedAPIList
  • IEconItems_

    • GetPlayerItems
    • GetSchema
    • GetSchemaURL
    • GetStoreMetadata
    • GetStoreStatus
  • Extra Non-WebAPIs functions

    • GetGroupMembers - Return a list of steamids belonging to a steam group

Example Usage

package main

import (
  "context"
  "fmt"
  "github.com/leighmacdonald/steamid/v3/steamid"
  "github.com/leighmacdonald/steamweb/v2"
  "os"
)

func main() {
    // The env var STEAM_TOKEN can also be used to set the key instead of 
    // calling SetKey directly.
    if err := steamweb.SetKey("XXXXXXXXXXXXXXXXXXXXX"); err != nil {
        fmt.Printf("Error setting steam key: %v", err)  
        os.Exit(1)
    }
    ids := steamid.Collection{steamid.New(76561198132612090), steamid.New(76561197960435530)}
    summaries, _ := steamweb.PlayerSummaries(context.Background(), ids)
    for _, summary := range summaries {
        fmt.Println(summary)        
    }
}