Skip to content

horisystems/cryptodatapi-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
cryptodatapi-go-sdk logo

cryptodatapi-go-sdk

Crypto API SDK for Golang.

Release Go Report Card Go Reference License


Getting Started

import "github.com/horisystems/cryptodatapi-go-sdk"

Dependence

Testing

Run the following command to test the package.

USER=<username> PASS=<password> go test -v

Implementation

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)

License

This project is licensed under the BSD 3-Clause License - see the file for details.

Copyright

(c) 2020 - 2023 Hori Systems Limited.