Print

Import CoinAPI Data to Google Sheets

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

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your CoinAPI API Key

  1. If you haven't already, navigate to https://www.coinapi.io/ and click Get a Free API Key
    coinapi-img1
  2. Fill out your details and click Get a Free API Key
    coinapi-img2
  3. A few minutes later you'll receive an email containing your API key. Congrats! You now have access to CoinAPI. Keep this key handy as we'll need it in a moment.
    coinapi-img3

Part 2: Pull CoinAPI Data into Sheets

For this example, we'll access Bitcoin (BTC) exchange rates. Here's how to configure the request. Replace your_api_key with your own CoinAPI API Key.

  1. Open up Google Sheets and click Extensions > API Connector > Open > Create request.
  2. In the request form enter the following:
    • ApplicationCustom
    • MethodGET
    • Request URLhttps://rest.coinapi.io/v1/exchangerate/BTC
    • Headers:
      • X-CoinAPI-Key: your_api_key
      • Accept: application/json
  3. Create a new tab and click Set current to use that tab as your data destination.
  4. Name your request and click Run. A moment later you’ll see a list of current BTC exchange rates in your Google Sheet:
    coinapi-img6

Part 3: Get More CoinAPI Data

  1. Experiment with endpoints and query strings as described in the documentation to see other types of cryptocurrency data. For example, you can see a detailed list of all exchanges tracked by CoinAPI with this URL:
    https://rest.coinapi.io/v1/exchanges
  2. For more complex API requests, CoinAPI uses a system to clump exchange-type-trading pairs into a single "symbol" for use in their API. As an example, if you wanted to call the BTC-USD trading pair on the spot market of Kraken, you would formulate the symbol like this: KRAKEN_SPOT_BTC_USD. An example call would look like this:
    https://rest.coinapi.io/v1/trades/KRAKEN_SPOT_BTC_USD/latest?limit=10

Part 4: API Documentation

Official API documentation: https://docs.coinapi.io/

2 thoughts on “Import CoinAPI Data to Google Sheets”

  1. Hi Ana,
    I followed this tutorial and was successful at replicating your example. However, I'm looking to use an api to look up price history. Looking at the coinapi docs, I believe the function I need is called Get Specific Rate (https://docs.coinapi.io/market-data/rest-api/exchange-rates/get-specific-rate). I have not been successful yet at figuring out how to implement that request in API Connector. Would you please show an example of how it can be set up?

    Ideally, I would like to be able to match a crypto price at the time of transaction for a long list of transactions in a google sheet. I already have the date/time (UTC), crypto symbol (e.g. BTC), and amount of crypto transacted. I would like to add a new column that shows the USD exchange rate (accurate to the nearest minute) of the crypto at the time of transaction.

    Any advice for how to accomplish this task would be appreciated. I have already attempted to run the request in API Connector many times, but each time I get an error response. I believe I am not setting it up correctly.

    Reply

Leave a Comment

Jump To