quoter

Go Reference golangci-lint Go Report Card License

Get real-time Cryptocurrency quotes via CoinMarketCap.

Get it

go get -u github.com/pinealctx/opensea-go

Use it

package main

import (
	"github.com/pinealctx/quoter"
	"log"
	"time"
)

func main() {
	var p, err = quoter.New()
	if err != nil {
		log.Fatalf("new.price.latest.error:%+v", err)
		return
	}
	for i := 0; i < 2; i++ {
		log.Printf("1ETH = %fUSD, 1ETH = %fCNY", p.Price(quoter.USD, quoter.ETH), p.Price(quoter.CNY, quoter.ETH))
		time.Sleep(time.Second * 5)
	}
}

GitHub

View Github