โ† Blog/Chrome Extension

Build a Crypto Price Ticker Chrome Extension with Live Prices and 24h Change

Learn how to build an advanced Crypto Price Ticker Chrome Extension using the free CoinGecko API. Shows live prices, 24h percentage change, color indicators, auto-refresh, and a favorites list.

๐Ÿ“… 2026-06-26โฑ 2 min read๐Ÿ“š Ebook #05

What Makes This Extension Advanced

The basic version fetches BNB and ETH prices. This advanced version adds:

  • โœ“24-hour price change with green (up) and red (down) color indicators
  • โœ“Favorite coins โ€” users can choose which tokens to track
  • โœ“Auto-refresh every 60 seconds so prices stay current
  • โœ“Add custom coins by CoinGecko ID

The CoinGecko API โ€” 100% Free

CoinGecko's public API requires no API key for basic usage. This endpoint returns price and 24h change for multiple coins at once:

https://api.coingecko.com/api/v3/simple/price
  ?ids=binancecoin,ethereum,bitcoin
  &vs_currencies=usd
  &include_24hr_change=true

Fetching and Displaying Price Data

async function fetchPrices(coinIds) {
  const ids = coinIds.join(',');
  const url = `https://api.coingecko.com/api/v3/simple/price?ids=${ids}&vs_currencies=usd&include_24hr_change=true`;

  const response = await fetch(url);
  const data     = await response.json();
  return data;
}

function renderCoin(name, price, change24h) {
  const isPositive = change24h >= 0;
  const changeClass = isPositive ? 'positive' : 'negative';
  const arrow = isPositive ? 'โ–ฒ' : 'โ–ผ';

  return `
    <div class="coin-row">
      <span class="coin-name">${name.toUpperCase()}</span>
      <span class="coin-price">$${price.toLocaleString()}</span>
      <span class="coin-change ${changeClass}">
        ${arrow} ${Math.abs(change24h).toFixed(2)}%
      </span>
    </div>
  `;
}

Auto-Refresh with setInterval

// Refresh prices every 60 seconds
let refreshInterval;

function startAutoRefresh() {
  fetchAndRender(); // Immediate first fetch
  refreshInterval = setInterval(fetchAndRender, 60000);
}

// Show countdown timer
let countdown = 60;
setInterval(() => {
  countdown--;
  if (countdown <= 0) countdown = 60;
  document.getElementById('refresh-timer').textContent = `Refreshes in ${countdown}s`;
}, 1000);

This is a preview. The full ebook includes adding/removing coins, searching by name, persistent favorites with chrome.storage, loading states, and error handling for failed API calls.

Ready to Build This Yourself?

This article is a preview. The full ebook has complete code, detailed explanations, troubleshooting tips, and bonus sections โ€” all in a downloadable PDF.

Buy Full Ebook โ€” $1.50 in $YFIN
Pay with $YFIN on BNB Smart Chain ยท 30% burned permanently