CoinMarketCap API and Google Sheets
A Cryptowatch alternative for importing coin prices into your spreadsheet.
A few days ago the Cryptowatch API stopped working for me in my Google sheet I use to track my portfolio. When I went to their site, I found out they no longer allow you to import crypto currency prices into Google Sheets with the free plan. So, instead of getting upset, I went out into the web looking for an alternative free solution.
It took some time and frustration to get what I needed but in the end I came up with this straightforward implementation with the CoinMarketCap API. If you want to do the same, follow these easy steps and enjoy!
- Go to CoinMarketCap account and sign up or log in.
- Go to https://coinmarketcap.com/api to create a free API key.
- Click the button that says “GET YOUR API KEY NOW”.
- Fill in the sign up API form.
- Go to your email. There should be an email from CoinMarketCap API team. Click the verify button in the email:
- After clicking you will get sent to your API dashboard. Leave the dashboard open in your browser tab, you will need to copy the key later on.
- In a new tab, go to this Google Sheet I created and make a copy.
- Go to Extensions > Apps Script. Apps Script will open in a new tab.
- Go back to your tab with the CoinMarketCap API dashboard and copy your API key.
- Paste your API key on line 12 in Apps Script where it says YOUR_API_KEY_GOES_HERE.
- Click Run.
- A permissions window will pop open the first time you run this. Click Review permissions.
- Choose your account.
- Click advanced.
- Allow access if you trust the code I wrote. If you don’t you can get the code here and review it, or rewrite it, or whatever…just make sure you get the vaccine and wear a mask.
- Boom! Done. Now go back to the Google Sheet to savor and edit as necessary.
- Update Column B with Coin tickers you want to follow.
- Bonus! If you want the prices to update every time you check the little checkbox or make an edit. Go to Triggers in Apps Script and create a new trigger. Set Event type to on change.
- And finally, send a tip to my wallet. Be cool.
Send BTC tips to: bc1qj3n3tppat8jtugl950l37s0l2k6ufj39wn2ah5
Send ETH tips to: 0xbd984B05d00b27372bcf9F74013711455239ABe1