CoinGeckoApi (coin_gecko_api v0.1.0) View Source

Documentation for CoinGeckoApi.

This interface is based on version 3 of the api. Base URL is "https://api.coingecko.com/api/v3/" Also check out CoinGecko api for more information at https://www.coingecko.com/en/api.

Link to this section Summary

Functions

Get historical data (name, price, market, stats) at a given date for a coin

Get historical market data include price, market cap, and 24h volume (granularity auto)

Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto)

Get status updates for a given coin (beta)

Get coin tickers (paginated to 100 items)

List all supported coins id, name and symbol (no pagination required) returns a list with objects like this: %{"id" => "1", "name" => "coin_name", "symbol" => "coin_symbol"}

List all derivative tickers

List all derivative exchanges

List all derivative exchanges name and identifier

Get events, paginated by 100

Get list of event countries

Get list of event types

get BTC-to-Currency exchange rates

List all exchanges

get exchange volume in BTC and top 100 tickers only

get status updates for a given exchange (beta)

Get volume_chart data for a given exchange (beta)

List all supported market id and name

List all finance platforms

List all finance products

Get cryptocurrency global data

Get cryptocurrency global decentralized finance (defi_ data)

List all market indexes

list market indexes id and name

Ping API

Get trending search coins on coingecko from last 24 hours

Get the current price of any cryptocurrencies in any other supported currencies that you need. returns object like this: %{"bitcoin" => %{"usd" => 35861}}

Get list of supported_vs_currencies

Link to this section Functions

Link to this function

coins(id \\ "bitcoin", params \\ %{"tickers" => "true", "market_data" => "true", "community_data" => "true", "developer_data" => "true", "sparkline" => "false"})

View Source

Get current data (name, price, market, ... including exchange tickers) for a coin

Link to this function

coins_id_contract_contract_address(id \\ "ethereum", contract_address \\ "0xc00e94cb662c3520282e6f5717214004a7f26888")

View Source

Get coin info from contract address

Link to this function

coins_id_contract_contract_address_market_chart(id \\ "ethereum", contract_address \\ "0xc00e94cb662c3520282e6f5717214004a7f26888", params \\ %{"vs_currency" => "usd", "days" => "100"})

View Source

Get historical market data include price, market cap, and 24h volume (granularity auto) from a contract address

Link to this function

coins_id_contract_contract_address_market_chart_range(id \\ "ethereum", contract_address \\ "0xc00e94cb662c3520282e6f5717214004a7f26888", params \\ %{"vs_currency" => "usd", "from" => "1392577232", "to" => "1422577232"})

View Source

Get historical market data include price, market cap, and 24h volume (granularity auto) from a contract address

Link to this function

coins_id_history(id \\ "bitcoin", params \\ %{"date" => "01-01-2015"})

View Source

Get historical data (name, price, market, stats) at a given date for a coin

Link to this function

coins_id_market_chart(id \\ "bitcoin", params \\ %{"vs_currency" => "usd", "days" => "100"})

View Source

Get historical market data include price, market cap, and 24h volume (granularity auto)

Link to this function

coins_id_market_chart_range(id \\ "bitcoin", params \\ %{"vs_currency" => "usd", "from" => "1392577232", "to" => "1422577232"})

View Source

Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto)

Link to this function

coins_id_ohlc(id \\ "bitcoin", params \\ %{"vs_currency" => "usd", "days" => "90"})

View Source

Get coin's OHLC (beta)

Candle’s body:

1 - 2 days: 30 minutes 3 - 30 days: 4 hours 31 and before: 4 days

Link to this function

coins_id_status_updates(id \\ "bitcoin", params \\ %{})

View Source

Get status updates for a given coin (beta)

Link to this function

coins_id_tickers(id \\ "bitcoin", params \\ %{})

View Source

Get coin tickers (paginated to 100 items)

List all supported coins id, name and symbol (no pagination required) returns a list with objects like this: %{"id" => "1", "name" => "coin_name", "symbol" => "coin_symbol"}

Link to this function

coins_markets(params \\ %{"vs_currency" => "usd", "ids" => "bitcoin", "order" => "market_cap_desc", "per_page" => "100", "sparkline" => "false"})

View Source

Use this to obtain all the coins market data (price, market cap, volume)

List all derivative tickers

List all derivative exchanges

Link to this function

derivatives_exchanges_id(exchange_id \\ "bitmex")

View Source

show derivative exchange data

Link to this function

derivatives_exchanges_list()

View Source

List all derivative exchanges name and identifier

Get events, paginated by 100

Get list of event countries

Get list of event types

get BTC-to-Currency exchange rates

List all exchanges

Link to this function

exchanges_id(id \\ "binance")

View Source

get exchange volume in BTC and top 100 tickers only

Link to this function

exchanges_id_status_updates(id \\ "binance", params \\ %{})

View Source

get status updates for a given exchange (beta)

Link to this function

exchanges_id_volume_chart(id \\ "binance", days \\ "100")

View Source

Get volume_chart data for a given exchange (beta)

List all supported market id and name

List all finance platforms

List all finance products

Link to this function

get_api_params(api_path, params \\ %{})

View Source

Get cryptocurrency global data

Link to this function

global_decentralized_finance_defi()

View Source

Get cryptocurrency global decentralized finance (defi_ data)

List all market indexes

list market indexes id and name

Ping API

Examples

iex(1)> CoinGeckoApi.ping
%{"gecko_says" => "(V3) To the Moon!"}

Get trending search coins on coingecko from last 24 hours

Link to this function

simple_price(params \\ %{"ids" => "bitcoin", "vs_currencies" => "usd", "include_market_cap" => "true", "include_24hr_vol" => "true", "include_24hr_change" => "true", "include_last_updated_at" => "true"})

View Source

Get the current price of any cryptocurrencies in any other supported currencies that you need. returns object like this: %{"bitcoin" => %{"usd" => 35861}}

Link to this function

simple_supported_vs_currencies()

View Source

Get list of supported_vs_currencies

Link to this function

simple_token_price(params \\ %{"contract_addresses" => "0xc00e94cb662c3520282e6f5717214004a7f26888", "vs_currencies" => "usd", "include_market_cap" => "true", "include_24hr_vol" => "true", "include_24hr_change" => "true", "include_last_updated_at" => "true"})

View Source

Get current price of tokens (using contract addresses) for a given platform in any other currency that you need. returns object like this:

%{
  "0xc00e94cb662c3520282e6f5717214004a7f26888" => %{
    "last_updated_at" => 1611109511,
    "usd" => 213.46,
    "usd_24h_change" => -6.384358204432436,
    "usd_24h_vol" => 87929838.57157373,
    "usd_market_cap" => 888756153.0997704
  }
}