Google Sheets Cryptocurrency Market Cap

Google sheets cryptocurrency market cap

Get cryptocurrency price on your google sheets with Coinmarketcap API

With all of the activity lately on, I've started a Google Sheets doc to keep track of some metrics.

For those interested, I've created a script to allow the retrieval of certain information based on CMC's api.

function onEdit(e) {

function search(symbol, myArray) {
for (var i=0; i < myArray.length; i++) {
if (myArray[i].symbol == symbol) {
return myArray[i];
return myArray[0];

function cmc(symbol, key, rand) {
var url = "";

var response = UrlFetchApp.fetch(url);
var text = response.getContentText();

var obj_array = JSON.parse(text);
var obj = search(symbol, obj_array);
var value = obj[key];

return parseFloat(value);

Add the code above to the script editor under tools and the following function is now available:


The "A1" is needed as the third parameter because Google Sheets is weird with its caching and won't update the API get without that.

Here's a sample of all the Symbols and Descriptions you can get from this function:

So to get the current total supply of BTC, the function would be:


Hope this is useful!