Home

Awesome

Coinpaprika API Go Client

Build Status go-doc Go Report Card

Usage

This library provides convenient way to use coinpaprika.com API in Go.

Coinpaprika delivers full market data to the world of crypto: coin prices, volumes, market caps, ATHs, return rates and more.

Getting started

package main

import (
	"fmt"

	"github.com/coinpaprika/coinpaprika-api-go-client/coinpaprika"
)

func main() {
	paprikaClient := coinpaprika.NewClient(nil)

	tickers, err := paprikaClient.Tickers.List(nil)
	if err != nil {
		panic(err)
	}

	for _, t := range tickers {
		if t.Name == nil || t.Symbol == nil || t.Rank == nil {
			continue
		}

		fmt.Println("Name:", *t.Name)
		fmt.Println("Symbol:", *t.Symbol)
		fmt.Println("Rank:", *t.Rank)
		fmt.Println("----")
	}
}

Setting custom HTTP client

customClient := &http.Client{Timeout: 10 * time.Second}
paprikaClient := coinpaprika.NewClient(customClient)

Setting API key for and enabling access to Coinpaprika Pro API

Key can be obtained from Coinpaprika API

paprikaClient := coinpaprika.NewClient(nil, coinpaprika.WithAPIKey("your_api_key_goes_here"))

Examples

Check out the ./examples directory.

Implementation status

Global

Coins

People

Tags

Tickers

Exchanges

Search

Price Converter

License

CoinpaprikaAPI is available under the MIT license. See the LICENSE file for more info.