Import CoinGecko Data to Google Sheets

CoinGecko is a cryptocurrency ranking website for tracking the activity of cryptocurrencies and exchanges. In this guide, we’ll walk through how to pull cryptocurrency market data from the CoinGecko API directly into Google Sheets, using the API Connector add-on for Sheets. This is a free, open API so we won’t need any API key.

PART 1: CREATE YOUR COINGECKO API REQUEST URL

We’ll follow the CoinGecko API documentation to access the current price of ETH (Ethereum).

  • API root: https://api.coingecko.com
  • Endpoint: /api/v3/coins/markets
  • Query String: ?vs_currency={currency}&ids={coin ID}
    Query String Example: ?vs_currency=usd&ids=ethereum

Putting it together, we get the full API Request URL:

https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=ethereum

PART 2: PULL COINGECKO API DATA INTO SHEETS

We can now enter all our values into API Connector and import CoinGecko API data into Google Sheets.

  1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
  2. In the Create Request interface, enter the Request URL we just created.
    coingecko-img1
  3. Leave the Headers section empty. This API is open and public, so we don’t need any authentication.
  4. Create a new tab. You can call it whatever you like, but here we’ll call it ‘CoinGecko-ETH’. While still in that tab, click ‘Set’ to use that tab as your data destination.
  5. Name your request. Again we’ll call it ‘CoinGecko-ETH’
  6. Click Run and a moment later you’ll see the latest exchange rate data for Ethereum to USD appear in your Google Sheet:
    coingecko-img2

PART 3: COINGECKO API + GOOGLE SHEETS NOTES AND EXPANSIONS

  • Experiment with endpoints and query strings as described in the documentation to see other types of currency and crypto data from the API. For example, you can try the following URLs, one at a time:
    https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd
    https://api.coingecko.com/api/v3/coins/list
    https://api.coingecko.com/api/v3/coins/bitcoin/tickers
    https://api.coingecko.com/api/v3/exchanges https://api.coingecko.com/api/v3/exchanges?view=cybersecurity
  • For a more dynamic, ticker-like experience in Sheets, check out the API Connector custom function IMPORTAPI().

Leave a Comment