How to pull crypto exchange data from CoinAPI into Google Sheets

CoinAPI is a cryptocurrency exchange API with more than 250 exchanges available and CoinAPI has data on more than 9,000 assets.

You can access CoinAPI’s data via their REST API which returns crypto data in JSONXML or CSV formats.

CoinAPI is free to use for up to 100 daily requests and their paid plans start at $79/month.

In this tutorial, you will learn how to connect the CoinAPI to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Get your free CoinAPI Key
  3. Choose your CoinAPI Endpoint URL
  4. Enter your CoinAPI request into Apipheny
  5. Run the CoinAPI request

Step 1.) Install and open the Apipheny add-on for Google Sheets

To pull data from CoinAPI into Google Sheets, first install and open the Apipheny Google Sheets add-on.

Apipheny is an API integrator for Google Sheets. With Apipheny, you can connect to unlimited API data sources, make unlimited API requests, and more. Click here for more information about Apipheny. There’s a 30-day free trial included, then it’s $19-$29/month.

1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page:

https://gsuite.google.com/marketplace/app/apipheny/966163326746

Install Apipheny
Install Apipheny

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons option in the top menu. Then, in the add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheet:

Open Apipheny
Open Apipheny

Step 2.) Get a Free CoinAPI Key

1. Go to https://www.coinapi.io/pricing?apikey to get a free api key from CoinAPI, or if you want to sign up for one of their paid plans, you can do so here.

CoinAPI Pricing Page
CoinAPI Pricing Page

2. Just enter your information into the required fields and then click “Get a free API key“:

Get a free CoinAPI key
Get a free CoinAPI key

3. After you sign up, your CoinAPI key will be sent in an email to your inbox:

CoinAPI key sent to my email
CoinAPI key sent to my email

Step 3.) Choose a CoinAPI Endpoint URL

In this section, we’ll show you how to browse the CoinAPI documentation to obtain an API URL that retrieves the specific information you need. If you’re new to what an API is, an endpoint is just a specific API URL that returns the specific data you need from the API.

If you already know your endpoint URL, or you want to use the same example URL as us, just skip to Step 4.

To find your endpoint, first, open the CoinAPI documentation page: https://docs.coinapi.io/

The menu on the left contains a list of the available APIs, each with its own endpoints:

CoinAPI Documentation Page
CoinAPI Documentation Page

Clicking on an API scrolls to that API’s section, containing a list of associated endpoints.

For instance, when I click on Metadata, it scrolls to the list of the 5 Metadata endpoints:

  1. List all exchanges
  2. List all exchange icons
  3. List all assets
  4. List all asset icons
  5. List all symbols

All API calls to CoinAPI should be made to the https://rest.coinapi.io/ base domain.

Base/root domain:
https://rest.coinapi.io/

As an example, one of the available endpoints is List all assets: /v1/assets

So if I want to use this endpoint, I put my base domain and endpoint together like this:

https://rest.coinapi.io/v1/assets

The documentation for each endpoint contains a short description, the HTTP method used (GET) and the link you should append to the root API URL for querying this endpoint (eg. /v1/assets):

List all assets endpoint documentation
“List all assets” endpoint documentation

For endpoints that accept parameters, the documentation is where you would find them listed and explained, along with example inputs and responses.

Step 4.) Enter your CoinAPI URL into Apipheny

Go back to your Google Sheet and make sure that you have the Apipheny add-on open, with the “Import” tab open (screenshot below). Then enter these details into the Import tab in Apipheny:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the CoinAPI REST API endpoint that you need. Now copy the complete URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query (if applicable).

For this example, we are using the List all exchanges endpoint, to get a detailed list of all the available exchanges provided by CoinAPI:

https://rest.coinapi.io/v1/exchanges

If you want to use this same URL as us, just copy and paste the above URL into the “API URL Path” field in Apipheny.

Headers: In the Headers section, add one row with the following key and value:

Key:
X-CoinAPI-Key
Value:
<your_api_key>

<your_api_key> is the CoinAPI key you got previously, in Step 2. Do not include the carrots “<>”.

CoinAPI request entered into Apipheny in Google Sheets
CoinAPI request entered into Apipheny in Google Sheets

Step 5.) Run the CoinAPI request in your Google Sheet

Your final step to pull data from CoinAPI into your Google Sheet is to click the Run button at the bottom of the Apipheny add-on and then wait for the CoinAPI data to be imported to your Google spreadsheet:

CoinAPI data in Google Sheets
CoinAPI data in Google Sheets

After making a successful request to CoinAPI, try querying a different endpoint, or try using one of the more advanced features of the Apipheny add-on, such as:

  • Save and schedule your API request
  • Make a POST request (if available)
  • Use the custom =APIPHENY() function to call the API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in the API URL with three curly braces eg. {{{Sheet1!A1}}}

If you have questions about CoinAPI, check out their FAQ page here and if you want to contact their support team you can do so here.

Related posts:

Related Posts

Leave a Comment