- ⭐️ Coingecko API: use coupon code APIPHENY20 for 20% off a premium Coingecko API plan. Click here to signup.
- Crypto Tutorials: Binance | Bitfinex | Bitmex | BscScan | Cardano | Coinbase | Coingecko | Coinmarketcap | CoinAPI | Coinranking | Etherscan | | Glassnode | Huobi | LiveCoinWatch | Kraken | Kucoin | Magic Eden | Messari | Nomics | OpenSea | PancakeSwap | Rarible | Rarify | Solanart
- Best Crypto APIs: list of the best APIs for cryptocurrency traders and devs
How to integrate the Coinbase API with Google Sheets
Coinbaseis a secure platform that makes it easy to buy, sell, and store cryptocurrency like Bitcoin, Ethereum, and more. We can use the Coinbase API to import data from Coinase into Google Sheets. In this tutorial, we’ll show you how to connect theCoinbase APItoGoogle Sheetsin 4 steps:
- Install the Apipheny add-on
- Choose a Coinbase Endpoint
- Add your Coinbase API URL into the Apipheny add-on
- Run the Coinbase API request in your Google Sheet
Step 1.) Install and open the Apipheny add-on for Google Sheets
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
Step 2.) Choose a Coinbase API Endpoint
In this section, we’ll show you how to browse the Coinbase API documentation to find the API URL with an endpoint that retrieves the information you need from your account. If you already know your URL, or you want to use the same example URL as us, just skip to Step 3.
First, open the Coinbase API documentation page: https://developers.coinbase.com/api/v2
All Coinbase endpoint URLs are created by appending an endpoint-specific path to the root URL:
https://api.coinbase.com/v2/
Signed endpoints
Some Coinbase API endpoints require HMAC SHA256 and others don’t. This tutorial goes through examples that don’t require HMAC SHA256.
“Signed” Coinbase API endpoints that require HMAC SHA256 will not currently work with Apipheny, but endpoints that do not require HMAC SHA256 will work, such as the Get buy price endpoint we cover in the example below.
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:
An example of a signed endpoint is the List transactions endpoint:
You can tell if an endpoint is signed or not, because when you look at the documentation for that endpoint, you’ll see the “This endpoint doesn’t require authentication” phrase. The presence of this phrase means that the endpoint is public (not signed and doesn’t require an API key, a token or a signature).
Public endpoints
Public endpoints can be accessed without an API key and a signature.
As explained before, to identify the public endpoints, you have to look for those which have the phrase “This endpoint doesn’t require authentication” in their documentation.
The only category from the Coinbase API documentation that contains public endpoints, which require no API key, is Data Endpoints: https://developers.coinbase.com/api/v2#data-endpoints
An example public endpoint that requires no key is Get buy price, which gets the total price to buy one bitcoin or ether. It uses the GET method and the URL for this endpoint is:
https://api.coinbase.com/v2/prices/BTC-USD/buy
The endpoint’s documentation contains its HTTP method (GET), the URI, the cURL command and an example response:
Coinbase API pagination
Pagination is a process that is used to divide a large dataset into smaller chunks (pages). Usually the endpoints that return a list of resources support pagination.
Some of the Coinbasse API endpoints use the pagination option. This means you need to add some of these parameters at the end of the URL:
- limit – number of results per call. Accepted values: 0 – 100. Default is 25.
- starting_after – A cursor for use in pagination.
starting_after
is an resource ID that defines your place in the list. - ending_before – A cursor for use in pagination.
ending_before
is an resource ID that defines your place in the list. - order – Result order. Accepted values:
desc
(default),asc
.
Each endpoint that needs pagination will have in its documentation relevant information on which of these parameters you can use and how to do it.
Example:https://api.coinbase.com/v2/accounts/:account_id/sells?limit=50&order=asc
In the example above, the data set will be divided in sets of 50 records per page, in ascending order.
Step 3.) Add your Coinbase API URL into the Apipheny add-on
In this section, we’ll show you how to enter your Coinbase API request into Apipheny. This section explains how to enter a supported API request, one that doesn’t require an API key.
Back in your Google Sheet, make sure the Apipheny add-on is open, on the Import tab.
After you’ve found the endpoint you need in Step 2, copy the complete URL into the API URL Path field in the Apipheny add-on, followed by any GET parameters required for your query (see screenshot below).
Here’s the example URL endpoint we used, which doesn’t require an API key:
https://api.coinbase.com/v2/prices/currency_pair/buy
This API URL is the Get buy price endpoint, which returns the total price to buy one bitcoin or Ether. If you use this URL, don’t forget to replace currency_pair with a real value.
At the top of the add-on select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using GET.
Headers are not required for public endpoints, so you can leave the Headers section blank in Apipheny.
Step 4.) Run the Coinbase 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 Coinbase API data to be imported into your Google Sheet. Here’s what our request looked like when completed:
More Example Coinbase API Requests
– Get sell price, which gets the total price to sell one bitcoin or ether. It uses the GET method and its URL is:
https://api.coinbase.com/v2/prices/currency_pair/sell
Don’t forget to replace currency_pair with a real value.
To use this endpoint, just copy and paste this URL into Apipheny. After you enter the URL into the add-on, click the “Run” button at the bottom of the Apipheny add-on and the data will be imported into your Sheet, as shown in this screenshot:
– Get exchange rates which returns the current exchange rates. The default base currency is USD, but it can be defined as any supported currency. Returned rates will define the exchange rate for one unit of the base currency. It uses the GET method and its URL is:
https://api.coinbase.com/v2/exchange-rates
To use this endpoint, just copy and paste this URL into Apipheny. After you enter the URL into the add-on, click the “Run” button at the bottom of the Apipheny add-on and the data will be imported into your Sheet, as shown in this screenshot:
– Get currencies which lists all currencies known by Coinbase. It uses the GET method and its URL is:
https://api.coinbase.com/v2/currencies
To use this endpoint, just copy and paste this URL into Apipheny. After you enter the URL into the add-on, click the “Run” button at the bottom of the Apipheny add-on and the data will be imported into your Sheet, as shown in this screenshot:
That’s it! You’ve successfully learned how to connect your Coinbase account to Google Sheets using the Coinbase API, Google Sheets API, and the Apipheny add-on.
After making a successful request to the Coinbase API, try querying a different Coinbase API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:
- Save and schedule your Coinbase API request
- Make a POST request to the Coinbase API (if available)
- Use the custom =APIPHENY() function to call the Coinbase API request inside your spreadsheet
- Create an API request by referencing the value of a cell in your Coinbase API URL with three curly braces eg. {{{Sheet1!A1}}}
Our latest demo
Apipheny Feature Tutorials
Make a GET request
Make a POST request
Save requests for later
Schedule requests for automatic updates
Reference cell values in requests
=APIPHENY custom function
Create custom OAuth2.0 connections
Pagination automation
Stack multiple URLs in a single request
Run all saved requests at once
Modify your request settings
Import JSON Google Sheets
Install Apipheny Here
- ⭐️ Coingecko API: use coupon code APIPHENY20 for 20% off a premium Coingecko API plan. Click here to signup.
- Crypto Tutorials: Binance | Bitfinex | Bitmex | BscScan | Cardano | Coinbase | Coingecko | Coinmarketcap | CoinAPI | Coinranking | Etherscan | | Glassnode | Huobi | LiveCoinWatch | Kraken | Kucoin | Magic Eden | Messari | Nomics | OpenSea | PancakeSwap | Rarible | Rarify | Solanart
- Best Crypto APIs: list of the best APIs for cryptocurrency traders and devs
Popular API Tutorials
- Amazon Ads
- Ahrefs
- Airtable
- Alpha Vantage
- Asana
- Binance
- Clickup
- Coingecko
- Coinmarketcap
- Coinbase
- Constant Contact
- Discord
- Drift
- Etsy
- Eventbrite
- Facebook Graph
- Facebook Ads
- Figma
- Github
- Google SERP
- Hubspot
- Hunter
- Intercom
- JIRA
- Linkedin Ads
- Mailchimp
- Monday
- Minecraft
- Paypal
- Pipedrive
- Product Hunt
- Quickbooks
- Reddit Ads
- Riot Games
- Salesforce
- Shipstation
- Shopify
- Slack
- Snapchat
- Spotsnatch
- Spotify
- Square
- Squarespace
- Stripe
- SurveyMonkey
- Tableau
- TikTok
- Trello
- Twitch
- Typeform
- Videoask
- Weather Data
- Webflow
- Wikipedia
- Woocommerce
- WordPress
- Yelp
- Youtube
- Zendesk
- Zillow
- Zink
- Zoom
View All 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?
Import JSON to Google Sheets
Need website help? Hire an SEO Consultant.
share: