Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

horisystems/cryptodatapi-go-sdk

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.

Sponsor this project

  •  

Packages

No packages published

Languages