Skip to content

Get real-time Cryptocurrency quotes via CoinMarketCap.

License

Notifications You must be signed in to change notification settings

pinealctx/quoter

Repository files navigation

quoter

Go Reference golangci-lint Go Report Card License

Get real-time Cryptocurrency quotes via CoinMarketCap.

Get it

go get -u github.com/pinealctx/quoter

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)
	}
}

About

Get real-time Cryptocurrency quotes via CoinMarketCap.

Resources

License

Stars

Watchers

Forks

Packages

No packages published