This simply wraps the Steam Market Pricing API to enable doing json requests to the market from Go
Start off by getting this package:
go get github.com/Gacnt/go-steam-market
To use this there is one simple function:
package main
import (
"fmt"
"github.com/Gacnt/go-steam-market"
)
func main() {
jsonResp := gosm.GetSinglePrice(false, "M4A1-S", "Master Piece", gosm.FT, "G")
fmt.Println(jsonResp)
// Or
jsonResp, _ := gosm.GetAssetInfo(key, appid, class_count, classid, instanceid)
for k, v := range jsonResp.Assets {
fmt.Println(v.Name) // Chroma Case
fmt.Println(v.GetPrice()) // &{true $0.03 72,028 $0.03}
}
}
// Response:
{true $88.69 39 $80.95}
The function takes 5 parameters:
GetSinglePrice(StatTrak Bool, "Weapon Type", "Skin Name", "Skin Wear", "G for Gun or K for Knife")
You can see the constants that are the skin types to pass to the function here
If item is a knife with no skin, e.g. it's JUST a Gut Knife just put an empty string ""
for the Skin Wear parameters as Golang does not support optional Params
You can see more about the API here: GoDoc