steam-go is a lightweight Go SDK focused on the Steam Web API.
- Root
Clientwith grouped service access underclient.API.* - Functional options for API key, access token, timeout, retry, rate limit, and proxy selection
- Buffered response bodies are capped by default and can be tuned with
WithMaxResponseBodyBytes(...) keyandaccess_tokenare treated as different credentials and can be configured independently- API key is optional and can be supplied through a rotating key provider
- Typed responses by default with matching raw response methods
401/429can automatically retry with the next API key whenWithAPIKeys(...)andWithRetry(...)are used together- Independent addons can extend the SDK without bloating the core Web API client
go get github.com/GoFurry/steam-go@latestpackage main
import (
"context"
"fmt"
"time"
steam "github.com/GoFurry/steam-go"
)
func main() {
client, err := steam.NewClient(
steam.WithTimeout(10*time.Second),
steam.WithRetry(2),
)
if err != nil {
panic(err)
}
defer client.Close()
resp, err := client.API.SteamUser.GetPlayerSummaries(
context.Background(),
[]string{"76561198370695025"},
)
if err != nil {
panic(err)
}
for _, player := range resp.Response.Players {
fmt.Printf("%s: %s\n", player.SteamID, player.PersonaName)
}
}Detailed API group references live in docs/api.md.
addons/a2sis a lightweight bridge togithub.com/GoFurry/a2s-gov1.0.1addons/openidprovides Steam OpenID login verification for browser-based sign-in flows- OpenID only confirms Steam identity and returns
SteamID64; it does not replace Web API credentials - detailed addon notes live in docs/addons.md
steam-go keeps proxy support centered on WithProxySelector(...).
NewStaticProxySelector(...)for one fixed proxyNewRoundRobinProxySelector(...)for simple rotationNewRoutingProxySelector(...)for host/path-based routingNewHTTPClientWithProxySelector(...)for addon or standalone HTTP flows- no built-in health checks, circuit breaking, or heavy proxy-pool management
Static example:
selector, err := steam.NewStaticProxySelector("http://127.0.0.1:7897")
if err != nil {
panic(err)
}
client, err := steam.NewClient(
steam.WithAPIKey("your-key"),
steam.WithProxySelector(selector),
)
if err != nil {
panic(err)
}Routing example:
selector, err := steam.NewRoutingProxySelector(
steam.ProxyRoute{
Host: "api.steampowered.com",
PathPrefix: "/ISteamUser/",
ProxyURL: "http://127.0.0.1:7897",
},
steam.ProxyRoute{
Host: "steamcommunity.com",
PathPrefix: "/openid/",
ProxyURL: "",
},
)
if err != nil {
panic(err)
}On China-region networks, browser login may succeed while the server-side Steam OpenID check_authentication request still times out. The OpenID example supports --proxy http://127.0.0.1:7897 for that case and also demonstrates cookie-backed state verification on the callback.
go run ./examples/a2s -server 1.2.3.4:27015 -query infogo run ./examples/a2s -server 1.2.3.4:27015 -query playersgo run ./examples/a2s -server 1.2.3.4:27015 -query rulesgo run ./examples/openidgo run ./examples/openid --proxy http://127.0.0.1:7897go run ./examples/proxygo run ./test
SDK errors use *steam.APIError with these kinds:
request_buildtransporthttp_statusdecodeapi_response
Use errors.As(err, &apiErr) to inspect kind, status code, and raw body.