Skip to content

API to get the price of items on the market for CSGO

License

Notifications You must be signed in to change notification settings

bartezr8/go-steam-market

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

CSGO Steam Market Pricing API Wrapper

This simply wraps the Steam Market Pricing API to enable doing json requests to the market from Go

Usage

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

About

API to get the price of items on the market for CSGO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages