import "github.com/horisystems/cryptodatapi-go-sdk"
Run the following command to test the package.
USER=<username> PASS=<password> go test -v
c: = client.New()
token,ok := c.Auth("<username>", "<password>")
// For example, call an endpoint such as LivePrice
live_price := c.LivePrice()
// Retrieve All LivePrice Data
j, err := live_price.GetAll()
// Retrieve LivePrice Data By ID
j, err := live_price.GetById("<id>")
// Retrieve LivePrice Data By Symbol
j, err := live_price.GetBySymbol("<symbol>")
// Get API result (see simplejson)
j.Get("Code").String()
j.Get("Message").String()
j.Get("Document").Array()
Below are all the available endpoints.
c.LivePrice()
c.TopGainers()
c.TopLosers()
c.History(2021)
c.History(2022)
c.History(2023)
c.Derivatives()
c.Dex()
c.Lending()
c.Spot()
c.News()
All the endpoints listed above have five methods.
- GetAll()
- GetById(id int)
- Create(data map[string]interface{})
- UpdateById(id int, data map[string]interface{})
- DeleteById(id int)
This project is licensed under the BSD 3-Clause License - see the file for details.
(c) 2020 - 2023 Hori Systems Limited.