Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) AssetPlatforms(ctx context.Context, filter string) (*assetPlatforms.AssetPlatforms, error)
- func (c *Client) Categories(ctx context.Context, order string) (*categories.CategoriesWithMarketDataList, error)
- func (c *Client) CategoriesList(ctx context.Context) (*categories.CategoriesList, error)
- func (c *Client) Close()
- func (c *Client) CoinsId(ctx context.Context, id string, ...) (*coins.CoinID, error)
- func (c *Client) CoinsIdHistory(ctx context.Context, id, date string, localization bool) (*coins.History, error)
- func (c *Client) CoinsIdMarketChart(ctx context.Context, id, currency, days, interval string) (*types.MarketChart, error)
- func (c *Client) CoinsIdMarketChartRange(ctx context.Context, id, currency, from, to string) (*types.MarketChart, error)
- func (c *Client) CoinsIdTickers(ctx context.Context, ...) (*coins.Tickers, error)
- func (c *Client) CoinsList(ctx context.Context) ([]*coins.CoinInfo, error)
- func (c *Client) CoinsMarket(ctx context.Context, currency string, ids []string, category string, ...) ([]*coins.Market, error)
- func (c *Client) CoinsOhlc(ctx context.Context, id, currency, days string) (*coins.Ohlc, error)
- func (c *Client) ContractInfo(ctx context.Context, id, contractAddress string) (*contract.ContractAddressInfo, error)
- func (c *Client) ContractMarketChart(ctx context.Context, id, contractAddress, vsCurrency, days string) (*types.MarketChart, error)
- func (c *Client) ContractMarketChartRange(ctx context.Context, id, contractAddress, vsCurrency, from, to string) (*types.MarketChart, error)
- func (c *Client) DecentralizedFinanceDEFI(ctx context.Context) (*global.Defi, error)
- func (c *Client) Derivatives(ctx context.Context) ([]derivatives.Derivative, error)
- func (c *Client) DerivativesExchanges(ctx context.Context, order string, perPage, page int32) ([]derivatives.Exchange, error)
- func (c *Client) DerivativesExchangesId(ctx context.Context, id, includeTickers string) (*derivatives.ExchangeId, error)
- func (c *Client) DerivativesExchangesList(ctx context.Context) ([]derivatives.DerivativesListItem, error)
- func (c *Client) ExchangeRates(ctx context.Context) (*exchangeRates.Rates, error)
- func (c *Client) Exchanges(ctx context.Context, perPage, page string) (*exchanges.ExchangesList, error)
- func (c *Client) ExchangesId(ctx context.Context, id string) (*exchanges.ExchangeWithTicker, error)
- func (c *Client) ExchangesIdTickers(ctx context.Context, id, coinIds, includeExchangeLogo string, page int32, ...) (*exchanges.Tickers, error)
- func (c *Client) ExchangesIdVolumeChart(ctx context.Context, id, days string) ([]exchanges.Volume, error)
- func (c *Client) ExchangesList(ctx context.Context) ([]exchanges.ExchangeId, error)
- func (c *Client) Global(ctx context.Context) (*global.Global, error)
- func (c *Client) MakeReq(ctx context.Context, url string) ([]byte, error)
- func (c *Client) NftsContract(ctx context.Context, assetPlatform, contract string) (*nfts.NftId, error)
- func (c *Client) NftsId(ctx context.Context, id string) (*nfts.NftId, error)
- func (c *Client) NftsList(ctx context.Context, order, assetPlatformId string, perPage, page int32) ([]nfts.Nft, error)
- func (c *Client) Ping(ctx context.Context) (*ping.Ping, error)
- func (c *Client) PublicTreasuryCoinId(ctx context.Context, id string) (*companies.Treasury, error)
- func (c *Client) Search(ctx context.Context, query string) (*search.Search, error)
- func (c *Client) SimplePrice(ctx context.Context, ids, vsCurrencies string, ...) (simple.Price, error)
- func (c *Client) SimpleSupportedVsCurrency(ctx context.Context) (*simple.SupportedVsCurrency, error)
- func (c *Client) SimpleTokenPrice(ctx context.Context, id, contractAddresses, vsCurrencies string, ...) (simple.TokenPrice, error)
- func (c *Client) Trending(ctx context.Context) (*trending.Trending, error)
Constants ¶
This section is empty.
Variables ¶
var ( BaseURL = fmt.Sprintf("https://api.coingecko.com/api/%s", version) ProBaseURL = fmt.Sprintf("https://pro-api.coingecko.com/api/%s", version) )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AssetPlatforms ¶
func (c *Client) AssetPlatforms(ctx context.Context, filter string) (*assetPlatforms.AssetPlatforms, error)
func (*Client) Categories ¶
func (c *Client) Categories(ctx context.Context, order string) (*categories.CategoriesWithMarketDataList, error)
Categories List all categories with market data Cache / Update Frequency: every 5 minutes Parameters: order: valid values: market_cap_desc (default), market_cap_asc, name_desc, name_asc, market_cap_change_24h_desc and market_cap_change_24h_asc
func (*Client) CategoriesList ¶
func (c *Client) CategoriesList(ctx context.Context) (*categories.CategoriesList, error)
CategoriesList List all categories Cache / Update Frequency: every 5 minutes
func (*Client) CoinsIdHistory ¶
func (*Client) CoinsIdMarketChart ¶
func (*Client) CoinsIdMarketChartRange ¶
func (*Client) CoinsIdTickers ¶
func (*Client) CoinsMarket ¶
func (*Client) ContractInfo ¶
func (*Client) ContractMarketChart ¶
func (*Client) ContractMarketChartRange ¶
func (*Client) DecentralizedFinanceDEFI ¶
func (*Client) Derivatives ¶
func (c *Client) Derivatives(ctx context.Context) ([]derivatives.Derivative, error)
Derivatives List all derivative tickers. Note: 'open_interest' and 'volume_24h' data are in USD Cache / Update Frequency: every 30 seconds
func (*Client) DerivativesExchanges ¶
func (c *Client) DerivativesExchanges(ctx context.Context, order string, perPage, page int32) ([]derivatives.Exchange, error)
DerivativesExchanges List all derivative exchanges.
Cache / Update Frequency: every 60 seconds Parameters:
order(string) - order results using following params name_asc,name_desc,open_interest_btc_asc, open_interest_btc_desc,trade_volume_24h_btc_asc,trade_volume_24h_btc_desc
perPage(integer) - Total results per page page(integer) - Page through results
func (*Client) DerivativesExchangesId ¶
func (c *Client) DerivativesExchangesId(ctx context.Context, id, includeTickers string) (*derivatives.ExchangeId, error)
DerivativesExchangesId show derivative exchange data
Dictionary:
last: latest unconverted price in the respective pair target currency volume: unconverted 24h trading volume in the respective pair target currency converted_last: latest converted price in BTC, ETH, and USD converted_volume: converted 24h trading volume in BTC, ETH, and USD
Cache / Update Frequency: every 30 seconds Parameters:
id*(string) - pass the exchange id (can be obtained from derivatives/exchanges/list) eg. bitmex includeTickers(string) - ['all', 'unexpired'] - expired to show unexpired tickers, all to list all tickers, leave blank to omit tickers data in response
func (*Client) DerivativesExchangesList ¶
func (c *Client) DerivativesExchangesList(ctx context.Context) ([]derivatives.DerivativesListItem, error)
DerivativesExchangesList List all derivative exchanges name and identifier.
Cache / Update Frequency: every 5 minutes
func (*Client) ExchangeRates ¶
func (*Client) Exchanges ¶
func (c *Client) Exchanges(ctx context.Context, perPage, page string) (*exchanges.ExchangesList, error)
Exchanges List all exchanges Cache / Update Frequency: every 60 seconds Parameters per_page (string) Total results per page:
Valid values: 1...250 Total results per page Default value:: 100
page (string) page through results
func (*Client) ExchangesId ¶
ExchangesId Get exchange volume in BTC and tickers. For derivatives (e.g. bitmex, binance_futures), please use /derivatives/exchange/{id} endpoint.
IMPORTANT: Ticker object is limited to 100 items, to get more tickers, use /exchanges/{id}/tickers Ticker is_stale is true when ticker that has not been updated/unchanged from the exchange for more than 8 hours. Ticker is_anomaly is true if ticker's price is outliered by our system. You are responsible for managing how you want to display these information (e.g. footnote, different background, change opacity, hide)
Dictionary:
last: latest unconverted price in the respective pair target currency volume: unconverted 24h trading volume in the respective pair target currency converted_last: latest converted price in BTC, ETH, and USD converted_volume: converted 24h trading volume in BTC, ETH, and USD timestamp: returns the last time that the price has changed last_traded_at: returns the last time that the price has changed last_fetch_at: returns the last time we call the API Cache / Update Frequency: every 60 seconds
func (*Client) ExchangesIdTickers ¶
func (c *Client) ExchangesIdTickers(ctx context.Context, id, coinIds, includeExchangeLogo string, page int32, depth, order string) (*exchanges.Tickers, error)
ExchangesIdTickers Get exchange tickers (paginated) IMPORTANT: Ticker is_stale is true when ticker that has not been updated/unchanged from the exchange for more than 8 hours. Ticker is_anomaly is true if ticker's price is outliered by our system. You are responsible for managing how you want to display these information (e.g. footnote, different background, change opacity, hide)
Dictionary:
last: latest unconverted price in the respective pair target currency volume: unconverted 24h trading volume in the respective pair target currency converted_last: latest converted price in BTC, ETH, and USD converted_volume: converted 24h trading volume in BTC, ETH, and USD timestamp: returns the last time that the price has changed last_traded_at: returns the last time that the price has changed last_fetch_at: returns the last time we call the API Cache / Update Frequency: every 60 seconds Parameters:
id* - string - pass the exchange id (can be obtained from /exchanges/list) eg. binance coinIds - string - filter tickers by coin_ids (ref: v3/coins/list) includeExchangeLogo - string - flag to show exchange_logo. valid values: true, false page - integer - Page through results depth - string - lag to show 2% orderbook depth. i.e., cost_to_move_up_usd and cost_to_move_down_usd. valid values: true, false order - string - valid values: trust_score_desc (default), trust_score_asc and volume_desc
func (*Client) ExchangesIdVolumeChart ¶
func (c *Client) ExchangesIdVolumeChart(ctx context.Context, id, days string) ([]exchanges.Volume, error)
ExchangesIdVolumeChart Get 24 hour rolling trading volume data (in BTC) for a given exchange. Data granularity is automatic (cannot be adjusted)
1 day = 10-minutely 2-90 days = hourly 91 days above = daily
Note: exclusive endpoint is available for paid users to query more than 1 year of historical data
Cache / Update Frequency: every 60 seconds Parameters: id* - string - pass the exchange id (can be obtained from /exchanges/list) eg. binance days* - string - Data up to number of days ago (1/7/14/30/90/180/365)
func (*Client) ExchangesList ¶
ExchangesList Use this to obtain all the markets' id in order to make API calls Cache / Update Frequency: every 5 minutes
func (*Client) NftsContract ¶
func (c *Client) NftsContract(ctx context.Context, assetPlatform, contract string) (*nfts.NftId, error)
NftsContract
func (*Client) NftsId ¶
NftsId Get current data (name, price_floor, volume_24h ...) for an NFT collection. native_currency (string) is only a representative of the currency.
Cache / Update Frequency: every 60 seconds Parameters: id*(string) - id of nft collection (can be obtained from /nfts/list)
func (*Client) NftsList ¶
func (c *Client) NftsList(ctx context.Context, order, assetPlatformId string, perPage, page int32) ([]nfts.Nft, error)
NftsList Use this to obtain all the NFT ids in order to make API calls, paginated to 100 items.
Cache / Update Frequency: every 5 minutes Parameters: order(string) - valid values: h24_volume_native_asc, h24_volume_native_desc, floor_price_native_asc, floor_price_native_desc, market_cap_native_asc, market_cap_native_desc, market_cap_usd_asc, market_cap_usd_desc assetPlatformId(string) - The id of the platform issuing tokens (See asset_platforms endpoint for list of options) per_page(integer) - Valid values: 1..250. Total results per page page(integer) - Page through results
func (*Client) PublicTreasuryCoinId ¶
func (*Client) Search ¶
Search for coins, categories and markets listed on CoinGecko ordered by largest Market Cap first.
Cache / Update Frequency: every 15 minutes