A very light Golang wrapper around steam community methods outlined in Revadike/InternalSteamWebAPI
Pulling the library
go mod init steamApiTest
go get https://github.com/volodymyrzuyev/steamCommunityMarket
touch main.go
nvim main.go
in main.go
package main
import (
"fmt"
mApi "github.com/volodymyrzuyev/steamCommunityMarket"
"time"
)
func main() {
requestInterval := time.Duration(10 * time.Second)
api := mApi.NewApiController(requestInterval)
params := mApi.MarketRecentParams{
Country: mApi.UnitedStates,
Language: mApi.English,
Currency: mApi.USD,
}
resp, err := api.MarketRecent(params)
if err != nil {
panic("Gaben does not like you")
}
fmt.Println(string(resp))
}
resp
will be a []byte that contains a json response from steam. You can
implement any logic that you might like.
Get's listings for an item you want. Example
func MarketListings(params MarketListingsParams) ([]byte, error)
type MarketListingsParams struct {
AppID string `Appid of the game you are interested in`
MarketHashName string `Name that shows up in url bar when you open item in browser`
Country country `One of the contries from the list defined in consts`
Currency currency `One of courrenties defined in consts.go`
Start string `First item to show`
Count string `Number of items that will be fetched`
Language language `One of languages defined in consts.go`
}
Get's price overview of an item. Example
func MarketPriceOverview(params MarketPriceOverviewParams) ([]byte, error)
type MarketPriceOverviewParams struct {
AppID string `Appid of the game you are interested in`
MarketHashName string `Name that shows up in url bar when you open item in browser`
Country country `One of courrenties defined in consts.go`
Currency currency `One of courrenties defined in consts.go`
}
Get's newly posted listings to market. Example
func MarketRecent(params MarketRecentParams) ([]byte, error) {
type MarketRecentParams struct {
Country country `One of courrenties defined in consts.go`
Language language `One of languages defined in consts.go`
Currency currency `One of courrenties defined in consts.go`
}
Find's items with similar name to the query. Example
func MarketSearch(params MarketSearchParams) ([]byte, error) {
type MarketSearchParams struct {
AppID string
Start string
Count string
Query string
}