Crypto API Tutorials:

How to get data from Glassnode into Google Sheets

Glassnode is a blockchain data and intelligence provider that generates innovative on-chain metrics and tools for digital asset stakeholders. We can use the Glassnode API to import data from Glassnode into Google Sheets. In this tutorial, we’ll show you how to connect the Glassnode REST API to Google Sheets in 5 steps:

  1. Install the Apipheny add-on
  2. Generate an API key
  3. Choose a Glassnode API endpoint
  4. Enter your Glassnode API request into Apipheny
  5. Run the Glassnode API request in your Google Sheet

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

Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new

Step 2.)  Generate an API key

After logging into your Glassnode account, click the username icon, then in the drop-down menu, click API:

Glassnode dashboard
Glassnode dashboard

In the next window, click the Generate Key button:

Glassnode API section
Glassnode API section

Your API key has been generated. Copy it to a safe location, because you’ll need it later.

Generated API key
Generated API key

Step 3.) Choose a Glassnode endpoint

In this section, we’ll show you how to browse the Glassnode API documentation to find the endpoint that retrieves the information you need. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.

First, open the GlassnodeAPI documentation page: https://docs.glassnode.com/

The menu on the left contains general information about the Glassnode API and a list of API endpoint categories:

Glassnode API documentation page
Glassnode API documentation page

If we click the Market category, a list of its endpoints will be displayed:

The Market category
The Market category

An example endpoint is Price, which returns the asset’s closing price in USD.

https://api.glassnode.com/v1/metrics/market/price_usd_close?a=btc

You can replace btc with any supported asset symbols from the documentation.

The endpoint’s documentation contains a short description of the endpoint’s purpose, its HTTP method (GET), the URI, a list of accepted parameters, example responses and a list of supported asset symbols:

The Price endpoint documentation
The Price endpoint documentation

Step 4.) Enter your Glassnode API request into Apipheny

After choosing an endpoint and getting your API URL, go back to your Google Sheet and make sure that the Apipheny add-on is open on the Import tab. With the Import tab open, enter these details into the add-on:

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 Glassnode API endpoint that you need. Now copy and paste your complete Glassnode API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).

For this example, we are using the Total Addresses endpoint, which returns the total number of unique addresses that ever appeared in a transaction of the native coin in the network. This is what the whole URL looks like:

https://api.glassnode.com/v1/metrics/addresses/count?a=btc

You can replace btc with any supported asset symbols from the documentation.

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

Header
Key:
X-Api-Key
Value:
api_key

Replace api_key with the value of the API key you generated previously, in Step 2.

Here’s what our API request looks like in Apipheny:

Glassnode API request entered into Apipheny
Glassnode API request entered into Apipheny

Step 5.) Run the Glassnode API request in your Google Sheet

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Glassnode API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

Glassnode data imported into Google Sheets
Glassnode data imported into Google Sheets

That’s it! You’ve successfully connected your Glassnode account to Google Sheets using the Glassnode API, Google Sheets API, and the Apipheny add-on.

After making a successful request to the Glassnode API, try querying a different Glassnode API endpoint, or try using one of the more advanced features in the Apipheny add-on.


Crypto API Tutorials:


API Tutorials


API Knowledge

What is an API?

What is an API URL?

What are parameters?

What is an endpoint?

What is an API key/token?

What is basic authentication?

What are headers?

What is a GET request?

What is a POST request?


Crypto API Tutorials: