Tracking cryptocurrency prices in real time is essential for traders, investors, and analysts. While many platforms offer live data, integrating that information directly into your workflow can save time and improve accuracy. One powerful—and free—way to do this is by using Google Sheets in combination with the CoinMarketCap API.
This guide walks you through setting up an automated system to pull live crypto prices from CoinMarketCap into Google Sheets using Apps Script. No third-party plugins or downloads required—just a few simple steps to bring real-time data straight into your spreadsheet.
Why Choose CoinMarketCap Over Other Platforms?
When automating crypto price tracking, many consider CoinGecko due to its open API. However, CoinGecko imposes strict IP rate-limiting, which often results in blocked access when making frequent calls via Google Sheets. This makes it unreliable for consistent data retrieval.
CoinMarketCap, on the other hand, offers a more stable solution through its Pro API, especially when authenticated with an API key. With proper usage, you can reliably fetch prices for multiple cryptocurrencies without hitting immediate limits—making it ideal for automated tracking in Google Sheets.
👉 Discover how to supercharge your crypto data analysis with advanced tools.
Step-by-Step: Set Up Real-Time Crypto Price Tracking
Follow these steps to connect CoinMarketCap's live pricing data directly to your Google Sheet.
Step 1: Register on CoinMarketCap and Get Your API Key
To access the CoinMarketCap Pro API, you need a free account and an API key:
- Go to CoinMarketCap Pro and sign up.
- After logging in, navigate to your account dashboard at https://pro.coinmarketcap.com/account.
- Generate your unique API Key (you’ll see it in a red box on the screen).
✅ Save this key securely—it grants access to live market data.
You're now ready to start pulling data programmatically.
Step 2: Create a Google Sheet and Open Apps Script
- Open Google Sheets and create a new blank spreadsheet.
- Click on Extensions > Apps Script to open the code editor.
This built-in scripting tool allows you to write custom JavaScript functions that interact with external APIs—perfect for fetching cryptocurrency prices.
The Core Code: Fetching Crypto Prices
Copy and paste the following code into the Apps Script editor:
function GetCryptoPrice(coins, apiKey) {
try {
let url = "https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest?slug=" + coins;
const requestOptions = {
method: 'GET',
headers: {
'X-CMC_PRO_API_KEY': apiKey
},
json: true,
};
let result = UrlFetchApp.fetch(url, requestOptions);
let jsonResult = JSON.parse(result.getContentText());
let priceList = coins.split(',');
Object.keys(jsonResult.data).forEach((coin) => {
let pair = [];
pair.push(
jsonResult.data[coin].symbol,
jsonResult.data[coin].quote.USD.price.toFixed(4)
);
const i = priceList.findIndex((ele) => ele === jsonResult.data[coin].slug);
priceList.splice(i, 1, pair);
});
Logger.log(priceList);
return priceList;
} catch(e) {
var msg = e.message;
Logger.log(msg);
}
}How It Works:
- The function
GetCryptoPrice()takes two inputs: a comma-separated list of coin slugs (likebitcoin,ethereum) and your API key. - It sends a GET request to CoinMarketCap’s Pro API.
- Parses the JSON response and extracts the symbol and USD price (rounded to 4 decimal places).
- Returns a formatted array that Google Sheets can display as a table.
👉 Automate your crypto tracking like a pro—see what’s possible with integrated financial tools.
Step 3: Test the Function
Before connecting to your sheet, test the function:
Add a test line at the bottom of your script:
GetCryptoPrice("ethereum,bitcoin", "your-api-key-here")- Replace
"your-api-key-here"with your actual CoinMarketCap API key. - Click Run (▶️) in the Apps Script editor.
💡 Note: The first time you run it, Google will ask for permissions. Allow all requested authorizations so the script can make external HTTP requests.
Once executed, check the Logs (View > Logs) to see if the prices were fetched successfully.
After testing, comment out the test line by adding // at the beginning:
// GetCryptoPrice("ethereum,bitcoin", "your-api-key-here")This prevents unnecessary API calls every time the script runs.
Step 4: Pull Data Into Google Sheets
Now it’s time to use your custom function directly in the sheet.
In any cell, enter:
=GetCryptoPrice("bitcoin,ethereum,litecoin", "your-api-key-here")Replace the coin slugs and API key accordingly.
📌 Pro Tip:
- Use official CoinMarketCap slugs (e.g.,
bitcoin, notbtc). You can find these in the URL of each coin's page. - You can request up to 12 coins per call. Staying within this limit helps avoid exceeding API rate caps.
Your sheet will now display two columns:
- Column A: Cryptocurrency symbol (e.g., BTC, ETH)
- Column B: Current USD price
Refresh the sheet manually (Ctrl+R or Cmd+R) to update prices.
Frequently Asked Questions (FAQ)
Q1: Is this method free to use?
Yes, CoinMarketCap offers a free tier with up to 333 API calls per day and 10 calls per minute. This is sufficient for personal tracking and small-scale monitoring.
Q2: Why am I getting an error saying “Invalid API Key”?
Double-check that:
- You’ve copied the correct API key from your CoinMarketCap account.
- There are no extra spaces or characters in the key field.
- Your account has been activated (check email confirmation).
Q3: Can I automate price updates without manual refreshing?
Yes! Use Time-Driven Triggers in Apps Script:
- In Apps Script, go to Triggers (clock icon).
- Set a time-based trigger to run
GetCryptoPriceevery 5–10 minutes. - Note: Frequent polling may hit rate limits—space out calls wisely.
Q4: What happens if I exceed the API limit?
CoinMarketCap will temporarily block further requests until the next window resets (usually within a minute). To avoid this, limit calls to once every few minutes unless you upgrade to a paid plan.
Q5: Can I get prices in currencies other than USD?
Yes! Modify the code to change .quote.USD.price to .quote.EUR.price, .quote.JPY.price, etc., depending on supported currencies in the API response.
Q6: Will this work for all cryptocurrencies?
Only those listed on CoinMarketCap and referenced by their correct slug name. For example, use binance-coin instead of bnb. Always verify slugs via the official website.
Final Thoughts
By combining Google Sheets and the CoinMarketCap Pro API, you’ve built a lightweight, customizable dashboard for tracking real-time cryptocurrency prices—all without complex software or subscriptions.
This setup is perfect for:
- Portfolio tracking
- Price alert systems (with added email triggers)
- Data logging for analysis
And once you master this foundation, you can expand it further—pulling in market cap, volume, or even historical trends.
Whether you're managing investments or analyzing market movements, having direct access to live data gives you a clear edge.
👉 Take your crypto analytics further—explore powerful trading and data tools today.
Core Keywords:
cryptocurrency price tracker, Google Sheets crypto, CoinMarketCap API, fetch crypto prices, real-time crypto data, automate crypto tracking, API integration Google Sheets