Crypto Portfolio Tracker with Google Sheets and CoinMarketCap API

·

Tracking your cryptocurrency investments doesn’t have to be complicated. With the right tools, you can build a powerful, real-time crypto portfolio tracker using nothing more than Google Sheets, Google Apps Script, and the CoinMarketCap API. This solution offers a simple yet effective way to monitor your holdings, calculate total portfolio value, and stay updated with live market prices—all in a familiar spreadsheet environment.

Whether you're a beginner or an experienced investor, this guide walks you through setting up your own automated crypto tracker step by step.


Why Use a Google Sheets Crypto Portfolio Tracker?

Spreadsheets are intuitive, widely accessible, and highly customizable. By combining Google Sheets with automation via Google Apps Script, you can create a dynamic dashboard that pulls live data from CoinMarketCap, giving you up-to-the-minute insights into your investments.

Key benefits include:

👉 Discover how to supercharge your crypto tracking strategy today.


How It Works: The Technology Behind the Tracker

This system uses three core components:

  1. Google Sheets: Acts as the user interface where you list your coins, amounts, and view live prices.
  2. Google Apps Script: A JavaScript-based scripting platform that automates tasks within Google Workspace.
  3. CoinMarketCap API: Provides real-time cryptocurrency pricing data.

The script fetches your listed cryptocurrencies from the sheet, queries CoinMarketCap for current USD values, and automatically updates the corresponding cells—giving you a live snapshot of your portfolio’s performance.


Step-by-Step Setup Guide

Follow these steps to set up your own crypto portfolio tracker:

1. Copy the Template

Start by making a personal copy of the Google Sheets template to your Google Drive. This ensures you have full editing rights.

2. Open Google Apps Script

In your copied spreadsheet, go to Extensions > Apps Script. This opens the scripting editor where you'll add the automation code.

3. Paste the Script

Copy the contents of the crypto_portfolio.gs file from the repository and paste them into the Apps Script editor. Replace any placeholder code if necessary.

4. Save and Authorize

Click the disk icon to save your project. Then, run any function (like updatePrices) for the first time. You’ll be prompted to authorize the script to access your Google Sheets data—follow the prompts to grant permission.

5. Add Your CoinMarketCap API Key

Visit CoinMarketCap’s API portal and sign up for a free account to get an API key. In the script, locate the line:

var apiKey = "YOUR_API_KEY";

Replace "YOUR_API_KEY" with your actual key (keep it in quotes).

6. Input Your Holdings

Go back to the spreadsheet and navigate to the Cryptocurrencies sheet. In columns A (Name), B (Symbol), and C (Amount), enter each cryptocurrency you own.

7. Run the Update Function

Back in Apps Script, select the updatePrices function from the dropdown and click Run. The script will fetch current prices and populate them in column E (or designated price column).


Core Features of This Tracker

✅ Real-Time Price Updates

The script pulls live USD prices directly from CoinMarketCap, ensuring your valuation is always current.

✅ Portfolio Value Calculation

Once prices are updated, formulas in the sheet automatically multiply price by amount held to show individual asset value and total portfolio worth.

✅ Fully Customizable Layout

You can rename sheets, add charts, color-code gains/losses, or even integrate fiat conversion—all within Google Sheets’ flexible interface.


Automating Price Updates

Manually running the script works, but automation makes it truly powerful.

To set up automatic updates:

  1. In Apps Script, click the clock icon (Triggers) on the left sidebar.
  2. Click Add Trigger.
  3. Set:

    • Function to run: updatePrices
    • Event source: Time-driven
    • Type: Minutes timer
    • Interval: Every 5 minutes

Click Save. Now your portfolio updates every five minutes without any action required.

⚠️ Note: The free tier of CoinMarketCap’s API has rate limits (e.g., 333 calls per day). Frequent polling may exceed this limit. Monitor usage or consider upgrading for higher limits.

👉 Learn how top traders manage their portfolios efficiently.


Frequently Asked Questions

Q: Is this method safe? Will my data be exposed?
A: Yes, it's secure. All data stays within your Google account. The API key is stored only in your private script—just avoid sharing it publicly.

Q: Can I track multiple currencies like EUR or BTC instead of USD?
A: Absolutely. Modify the API URL parameter &convert=USD to &convert=EUR or &convert=BTC depending on your preferred base currency.

Q: What happens if I hit the API rate limit?
A: The script will fail to fetch new data until the next reset period. To avoid this, reduce update frequency or upgrade to a paid CoinMarketCap plan.

Q: Can I add profit/loss calculations?
A: Yes! Add columns for purchase price and date, then use simple formulas like (Current Price - Buy Price) * Quantity to compute gains.

Q: Does this work on mobile?
A: Yes! The Google Sheets app syncs automatically, so your updated portfolio is available on any device.

Q: Can I track NFTs or stocks too?
A: Not directly through this script—but you can expand it using other APIs (like Alpha Vantage for stocks) in a similar fashion.


Best Practices & Recommendations

For advanced users, integrating conditional formatting (e.g., red/green for losses/gains) or time-stamped historical logs adds deeper insight.


Expand Your Financial Toolkit

While this Google Sheets tracker is excellent for basic monitoring, serious investors often pair it with dedicated platforms for enhanced analytics, tax reporting, and multi-wallet syncing.

👉 Explore advanced tools that complement your self-hosted crypto tracker.


Final Thoughts

Building a crypto portfolio tracker with Google Sheets and CoinMarketCap API empowers you with real-time insights while maintaining full control over your data. It's cost-effective, customizable, and scalable—perfect for both casual holders and active traders.

By automating updates and enhancing visualization, you turn a simple spreadsheet into a dynamic financial dashboard. And when paired with smart strategies and reliable tools, you're well-equipped to navigate the evolving crypto landscape with confidence.

Start building yours today—and take full command of your digital asset journey.