Crypto API Tutorials:
Kraken offers a feature-rich trading platform for individual cryptocurrency enthusiasts as well as large trading firms. We can use the Kraken API to import data from Kraken into Google Sheets. In this tutorial, we’ll show you how to connect the Kraken REST API to Google Sheets in 4 steps:
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.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
An endpoint is an API URL that returns the specific data you want from Kraken. In this section we’ll show you how to browse the Kraken API documentation to find the URL that returns the specific data you need. If you’d like to see specific examples of URLs you can use, just skip to the next section.
To browse endpoint URLs and query requirements, go the Kraken API documentation page here: https://docs.kraken.com/rest/
All Kraken endpoint URLs are created by appending an endpoint-specific path to the root URL:
https://api.kraken.com
In this tutorial, we will discuss two types of endpoints available from the Kraken API:
This tutorial covers how to use the public endpoints that do not require authentication. The only category from the Kraken API documentation that has public endpoints which require no API key is Market Data (https://docs.kraken.com/rest/#tag/Market-Data).
Signed Kraken API endpoints that require HMAC SHA256 will not currently work with Apipheny, but endpoints that do not require HMAC SHA256 will work. Some Kraken API endpoints require HMAC SHA256 and others don’t. The reason signed endpoints don’t currently work with our app is because they require an additional parameter called signature, a keyed HMAC SHA256 signature with your secretKey as the key, and a concatenation of all the query’s parameters as the value passed to the HMAC operation. Signed endpoints also require a timeStamp parameter, populated with the request’s millisecond timestamp. You can tell if an endpoint is signed or not because when you look at the documentation for that endpoint, in the Authorization section it will say API-Key AND API-Sign, as seen in the screenshot below:
Once you’ve looked through the Kraken API documentation and chosen a public endpoint you want to use, you can go ahead and enter the URL into Apipheny and run your request. In the next section, we’ll cover making a request in more detail, along with some example requests.
Now 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, POST, PUT, etc.) 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 Kraken REST API endpoint that you need. Now copy and paste your complete Kraken 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 Get Asset Info endpoint which retrieves information about the assets that are available for deposit, withdrawal, trading and staking. This is what the whole URL looks like:
https://api.kraken.com/0/public/Assets
Headers: The Headers section of Apipheny should be left blank.
Just enter your API URL into Apipheny like this:
The Get Recent Trades endpoint returns the last 1000 trades by default. The URL for this endpoint is:
https://api.kraken.com/0/public/Trades?pair=XBTUSD
The Get System Status endpoint which returns the current system status or trading mode. The URL for this endpoint is:
https://api.kraken.com/0/public/SystemStatus
Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Kraken API data to be imported into your Google Sheet. Here’s what our request looked like when completed:
That’s it! You’ve successfully connected your Kraken account to Google Sheets using the Kraken API, Google Sheets API, and the Apipheny add-on.
After making a successful request to the Kraken API, try querying a different Kraken API endpoint, or try using one of the more advanced features in the Apipheny add-on.
Crypto API Tutorials:
Crypto API Tutorials: