You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cointop/vendor/github.com/miguelmota/go-coinmarketcap/example/coin_graph.go

26 lines
396 B
Go

package main
import (
"fmt"
"log"
"time"
cmc "github.com/miguelmota/go-coinmarketcap"
)
func main() {
threeMonths := int64(60 * 60 * 24 * 90)
now := time.Now()
secs := now.Unix()
start := secs - threeMonths
end := secs
// Get graph data for coin
coinGraphData, err := cmc.GetCoinGraphData("ethereum", start, end)
if err != nil {
log.Fatal(err)
}
fmt.Println(coinGraphData)
}