Skip to content

CoinCircle/go-coinmarketcap

Repository files navigation


go-coinmarketcap


The Unofficial CoinMarketCap API client for Go.

License Build Status Go Report Card GoDoc

Supports the CoinMarketCap Version 2 (V2) Public API

Documentation

https://godoc.org/github.com/coincircle/go-coinmarketcap

Install

go get -u github.com/coincircle/go-coinmarketcap

Getting started

package main

import (
	"fmt"
	"log"

	cmc "github.com/coincircle/go-coinmarketcap"
)

func main() {
	tickers, err := cmc.Tickers(&cmc.TickersOptions{
		Start:   0,
		Limit:   100,
		Convert: "USD",
	})
	if err != nil {
		log.Fatal(err)
	}

	for _, ticker := range tickers {
		fmt.Println(ticker.Symbol, ticker.Quotes["USD"].Price)
	}
}

Examples

Check out the ./example directory and documentation.

License

MIT