Crypto API Tutorials:
Blockchain.com is a popular crypto wallet and exchange and a full-stack crypto services platform. We can use the Blockchain.com API to import data from Blockchain.com into Google Sheets. In this tutorial, we’ll show you how to connect the Blockchain REST API to Google Sheets in 4 steps:
Apipheny is a free API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to API data sources, easily.
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.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
In this section, we’ll show you how to browse the Blockchain API documentation to find the endpoint that retrieves the data you need from the API. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 3.
First, open the Blockchain.com API documentation page: https://www.blockchain.com/api
This page contains multiple Blockchain APIs, each having one or more endpoints:
Many of these APIs don’t require authentication.
An example API is Simple Query API. Click the View Documentation button to see its endpoints:
The base URL for this API is:
https://blockchain.info/q/
An example endpoint is getdifficulty, which returns the current difficulty target, as a decimal number.
The endpoint’s documentation only contains a short description of the endpoint’s purpose.
The HTTP method is GET and the URL is:
https://blockchain.info/q/getdifficulty
The base URL for all Blockchain.com APIs is:
https://blockchain.info/
Once you have chosen an endpoint, 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 2, we explained how you can find the Blockchain REST API endpoint that you need. Now copy and paste your complete Blockchain API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).
Once you’ve entered your URL into Apipheny, just click the Run button to run your request and get the data back into your sheet.
Example 1.) Blockchain Data API – Single Address endpoint
This is what the whole URL of this endpoint looks like:
https://blockchain.info/rawaddr/bitcoin_address
If you’re following this example, don’t forget to replace bitcoin_address with a real bitcoin address, and then copy and paste the URL into Apipheny like this:
Once you enter the URL, next just click the Run button at the bottom of Apipheny and you’re request will be processed:
Example 2.) Exchange Rates API – Ticker endpoint
The URL of this endpoint is:
https://blockchain.info/ticker
Just copy and paste the URL into Apipheny and click the Run button to run your request:
That’s it! You’ve successfully connected the Blockchain.com API to Google Sheets using the Apipheny add-on.
After making a successful request to the Blockchain API, try querying a different Blockchain API endpoint, or try using one of the more advanced features in the Apipheny add-on.
Crypto API Tutorials:
Schedule requests for automatic updates
Reference cell values in requests
Stack multiple URLs in a single request
Crypto API Tutorials: