Coins

class Coins(http: IHttp)

CoinGecko Coins API.

data_by_id(*, coin_id: str, **kwargs: Any) dict

Query all the coin data of a coin (name, price, market …. including exchange tickers) on CoinGecko coin page based on a particular coin id

Parameters:
  • coin_id – The coin id

  • localization – Set to false to exclude localized languages in response

  • tickers – Include tickers data

  • market_data – Include market data

  • community_data – Include community data

  • developer_data – Include developer data

  • sparkline – Include sparkline 7 days data

historical_chart_data_by_id(*, coin_id: str, vs_currency: str, days: str = '1', **kwargs: Any) dict

Query the historical price, market cap, volume, and total supply at a given date for a coin in a particular currency based on a particular coin id.

Parameters:
  • coin_id – The coin id

  • vs_currency – The target currency of coins

  • days – Data up to number of days ago

  • interval – Data interval, leave empty for auto granularity Possible value

  • percision – Decimal place for currency price value

historical_chart_data_within_time_range_by_id(*, coin_id: str, vs_currency: str, from_timestamp: int, to_timestamp: int, precision: str | None = None) dict

Get the historical chart data of a coin within certain time range in UNIX along with price, market cap and 24hrs volume based on particular coin id.

Parameters:
  • coin_id – The coin id

  • vs_currency – The target currency of coins

  • from_timestamp – Starting date in UNIX timestamp

  • to_timestamp – Ending date in UNIX timestamp

  • precision – Decimal place for currency price value

historical_data_by_id(*, coin_id: str, snapshot_date: str, localization: bool | None = None) dict

Query the historical data (price, market cap, 24hrs volume, etc) at a given date for a coin based on a particular coin id.

Parameters:
  • coin_id – The coin id

  • snapshot_date – The date of snapshot in dd-mm-yyyy

  • localization – Set to false to exclude localized languages in response

list_all(*, include_platform: bool | None = None) list

Query all the supported coins on CoinGecko with coins id, name and symbol.

Parameters:

include_platform – Set to true to include platform contract addresses.

list_with_markets(*, vs_currency: str, **kwargs: Any) list

Query all the supported coins with price, market cap, volume and market related data.

Parameters:
  • vs_currency – Target currency of coins and market data

  • ids – Coins’ ids, comma-separated if querying more than 1 coin.

  • category – Filter by coin category

  • order – Order results by field

  • per_page – Total results per page

  • page – Page through results

  • sparkline – Include sparkline 7 days data

  • price_change_percentage – Include price change percentage timeframe, comma-separated if query more than 1 price change percentage timeframe

  • locale – Language background

  • precision – Decimal place for currency price value

ohlc_chart_by_id(*, coin_id: str, vs_currency: str = 'usd', days: str = '1', interval: str | None = None, precision: str | None = None) list

Get the OHLC chart (Open, High, Low, Close) of a coin based on particular coin id.

Parameters:
  • coin_id – The coin id

  • vs_currency – The target currency of coins

  • days – Data up to number of days ago

  • interval – Data interval, leave empty for auto granularity Possible value

tickers_by_id(*, coin_id: str, **kwargs: Any) dict

Query the coin tickers on both centralized exchange (cex) and decentralized exchange (dex) based on a particular coin id.

Parameters:
  • coin_id – The coin id

  • exchange_ids – Filter tickers by exchange ids, comma-separated if querying more than 1 exchange

  • include_exchange_logo – Flag to include exchange’s logo

  • page – Page through results

  • order – Order results by field

  • depth – Order book depth