coinmarketcap

package module
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 8 Imported by: 3

README

go-coinmarketcap

License Go Report Card GoDoc

Coinmarketcap (CMC) Pro API Client written in Golang

Usage

  • As library, start from coinmarketcap.GetInstanceWithKey('YOUR_API_KEY')
  • As program, start from coinmarketcap.GetInstance() after executing go run -cmcApikey=[YOUR_API_KEY]

Features

Type Endpoint Done
Cryptocurrency /v1/cryptocurrency/info
Cryptocurrency /v1/cryptocurrency/map
Cryptocurrency /v1/cryptocurrency/listings/latest
Cryptocurrency /v1/cryptocurrency/listings/historical -
Cryptocurrency /v1/cryptocurrency/market-pairs/latest
Cryptocurrency /v1/cryptocurrency/ohlcv/latest
Cryptocurrency /v1/cryptocurrency/ohlcv/historical
Cryptocurrency /v1/cryptocurrency/quotes/latest
Cryptocurrency /v1/cryptocurrency/quotes/historical -
Exchange /v1/exchange/info
Exchange /v1/exchange/map
Exchange /v1/exchange/listings/latest
Exchange /v1/exchange/listings/historical -
Exchange /v1/exchange/market-pairs/latest
Exchange /v1/exchange/quotes/latest
Exchange /v1/exchange/quotes/historical -
Global Metrics /v1/global-metrics/quotes/latest -
Global Metrics /v1/global-metrics/quotes/historical -
Tools /v1/tools/price-conversion -

Reference

Coinmarketcap (CMC) Pro

Documentation

Overview

Package coinmarketcap is an API Client for CMC Pro

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for CoinMarketCap API

func GetInstance

func GetInstance() *Client

GetInstance returns singleton

func GetInstanceWithKey

func GetInstanceWithKey(key string) *Client

GetInstanceWithKey returns singleton

func (*Client) CryptoInfo

func (s *Client) CryptoInfo(options *types.Options) (*types.CryptoInfoMap, error)

CryptoInfo returns all static metadata for one or more cryptocurrencies

arg: id, symbol
src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/info
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyInfo

func (*Client) CryptoListingsLatest

func (s *Client) CryptoListingsLatest(options *types.Options) (*types.CryptoMarketList, error)

CryptoListingsLatest gets a paginated list of all cryptocurrencies with latest market data.

arg: start, limit, convert, sort, sort_dir, cryptocurrency_type
src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyListingsLatest

func (*Client) CryptoMap

func (s *Client) CryptoMap(options *types.Options) (*types.CryptoMapList, error)

CryptoMap returns a paginated list of all cryptocurrencies by CoinMarketCap ID

arg: symbol, start, limit, listing_status
src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/map
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyMap

func (*Client) CryptoMarketPairsLatest

func (s *Client) CryptoMarketPairsLatest(options *types.Options) (*types.MarketPairs, error)

CryptoMarketPairsLatest lists all market pairs for the specified cryptocurrency with associated stats.

arg: id, symbol, start, limit, convert
src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/market-pairs/latest
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyMarketpairsLatest

func (*Client) CryptoMarketQuotesLatest

func (s *Client) CryptoMarketQuotesLatest(options *types.Options) (*types.CryptoMarketMap, error)

CryptoMarketQuotesLatest gets the latest market quote for 1 or more cryptocurrencies.

arg: id, symbol, convert
src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyQuotesLatest

func (*Client) CryptoOhlcvHistorical added in v1.3.0

func (s *Client) CryptoOhlcvHistorical(options *types.Options) (*types.OhlcvList, error)

CryptoOhlcvHistorical returns an interval of historic OHLCV (Open, High, Low, Close, Volume) market quotes for a cryptocurrency.

arg: id, symbol, convert, time_period, time_start, time_end, count, interval
src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/ohlcv/historical
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyOhlcvHistorical

func (*Client) CryptoOhlcvLatest added in v1.3.0

func (s *Client) CryptoOhlcvLatest(options *types.Options) (*types.OhlcvMap, error)

CryptoOhlcvLatest returns the latest OHLCV (Open, High, Low, Close, Volume) market values for one or more cryptocurrencies in the currently UTC day.

arg: id, symbol, convert
src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/ohlcv/latest
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyOhlcvLatest

func (*Client) ExchangeInfo

func (s *Client) ExchangeInfo(options *types.Options) (*types.ExchangeInfoMap, error)

ExchangeInfo returns all static metadata for one or more exchanges including logo and homepage URL.

arg: id, slug
src: https://pro-api.coinmarketcap.com/v1/exchange/info
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeInfo

func (*Client) ExchangeListingsLatest

func (s *Client) ExchangeListingsLatest(options *types.Options) (*types.ExchangeMarketList, error)

ExchangeListingsLatest gets a paginated list of all cryptocurrency exchanges including the latest aggregate market data for each exchange.

arg: start, limit, sort, sort_dir, market_type, convert
src: https://pro-api.coinmarketcap.com/v1/exchange/listings/latest
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeListingsLatest

func (*Client) ExchangeMap

func (s *Client) ExchangeMap(options *types.Options) (*types.ExchangeMapList, error)

ExchangeMap returns a paginated list of all cryptocurrency exchanges by CoinMarketCap ID.

arg: slug, start, limit, listing_status
src: https://pro-api.coinmarketcap.com/v1/exchange/map
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeMap

func (*Client) ExchangeMarketPairsLatest

func (s *Client) ExchangeMarketPairsLatest(options *types.Options) (*types.MarketPairs, error)

ExchangeMarketPairsLatest get a list of active market pairs for an exchange.

arg: id, slug, start, limit, convert
src: https://pro-api.coinmarketcap.com/v1/exchange/market-pairs/latest
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeMarketpairsLatest

func (*Client) ExchangeMarketQuotesLatest

func (s *Client) ExchangeMarketQuotesLatest(options *types.Options) (*types.ExchangeMarketQuotes, error)

ExchangeMarketQuotesLatest gets the latest aggregate market data for 1 or more exchanges.

arg: id, slug, convert
src: https://pro-api.coinmarketcap.com/v1/exchange/quotes/latest
doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeQuotesLatest

type Interface

type Interface interface {
	CryptoInfo(options *types.Options) (*types.CryptoInfoMap, error)
	CryptoMap(options *types.Options) (*types.CryptoMapList, error)
	CryptoListingsLatest(options *types.Options) (*types.CryptoMarketList, error)
	CryptoMarketPairsLatest(options *types.Options) (*types.MarketPairs, error)
	CryptoOhlcvLatest(options *types.Options) (*types.OhlcvMap, error)
	CryptoOhlcvHistorical(options *types.Options) (*types.OhlcvList, error)
	CryptoMarketQuotesLatest(options *types.Options) (*types.CryptoMarketMap, error)

	ExchangeInfo(options *types.Options) (*types.ExchangeInfoMap, error)
	ExchangeMap(options *types.Options) (*types.ExchangeMapList, error)
	ExchangeListingsLatest(options *types.Options) (*types.ExchangeMarketList, error)
	ExchangeMarketPairsLatest(options *types.Options) (*types.MarketPairs, error)
	ExchangeMarketQuotesLatest(options *types.Options) (*types.ExchangeMarketQuotes, error)
}

Interface for APIs

Directories

Path Synopsis
Package statistics gathers data and makes history It can be useful when your API plan is under standard, not authorized to historical data
Package statistics gathers data and makes history It can be useful when your API plan is under standard, not authorized to historical data
Package types of both request and response for API
Package types of both request and response for API
Package util supports specific parsing
Package util supports specific parsing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL