Import CryptoCompare Data to Google Sheets

CryptoCompare provides streaming pricing data for cryptocurrencies. In this guide, we’ll walk through how to pull cryptocurrency data from the CryptoCompare API directly into Google Sheets, using the API Connector add-on for Sheets. We’ll first get an API key from CryptoCompare, and then set up a request to pull in cryptocurrency exchange rate details to your spreadsheet.

PART 1: GET YOUR CRYPTOCOMPARE API KEY

  1. If you haven’t already, navigate to https://min-api.cryptocompare.com/pricing and click Get your free key.
    cryptocompare-img1
  2. Fill out your details and click Sign Up
  3. A moment later you’ll receive an email. Click on the email to verify your account, and you’ll land on your new CryptoCurrency dashboard. Click https://www.cryptocompare.com/cryptopian/api-keys to access the API key section of your account.
  4. Click ‘Create an API key’
    cryptocompare-img2
  5. Give your API key a name, it can be anything but here we’ll call it ‘Crypto for Google Sheets’. Select the permissions you’d like, and click Add.
    cryptocompare-img3
  6. You’ll now see your API key. Congrats, you now have access to the CryptoCompare API! Copy this and keep it handy, we’ll need it in a moment.
    cryptocompare-img4

PART 2: CREATE YOUR CRYPTOCOMPARE API REQUEST URL

We’ll follow the CryptoCompare documentation to access the current price of BTC (Bitcoin).

  • API root: https://min-api.cryptocompare.com
  • Endpoint: /data/price
  • Query Strings: ?fsym=BTC&tsyms=USD,JPY,EUR

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

https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD,JPY,EUR

PART 3: PULL CRYPTOCOMPARE API DATA INTO SHEETS

We can now enter all our values into API Connector and import CryptoCompare 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
    cryptocompare-img5

     

  3. Under Headers enter a set of key-value pairs like this:
    authorizationApikey YOUR_API_KEY

    Replace YOUR_API_KEY with the API key you received above in step 6.
    cryptocompare-img6

  4. Create a new tab. You can call it whatever you like, but here we’ll call it ‘CryptoCompare’. While still in that tab, click ‘Set’ to use that tab as your data destination.
  5. Name your request. Again we’ll call it ‘CryptoCompare’
  6. Click Run and a moment later you’ll see the latest exchange rates for Bitcoin in your Google Sheet:
    cryptocompare-img7

 

PART 4: CRYPTOCOMPARE API + GOOGLE SHEETS NOTES AND EXPANSIONS

 

  1. Experiment with endpoints and query strings as described in the documentation to see other types of cryptocurrency data. For example, you can see top coins by total volume in the last 24 hours by entering
    https://min-api.cryptocompare.com/data/top/totalvolfull?limit=10&tsym=USD
  2. If you’re looking for a more dynamic, ticker-like experience, check out the API Connector custom function IMPORTAPI() for faster refresh rates.

3 thoughts on “Import CryptoCompare Data to Google Sheets”

    • Hey Doug! Sorry you’re having trouble. You can see full information on error messages here, but basically this error is usually associated with large requests timing out, since Google Sheets has a 6 minute / execution request limit. I checked this file and the issue is not that it’s huge, but that it has a deeply nested structure, which takes a long time to flatten out to cells and potentially runs into that execution limit. In my own test it worked when I switched to compact mode, since that runs a bit faster, can you please try that?

      Reply

Leave a Comment