Glanceway Glanceway
Alle Quellen

CoinGecko Crypto Markets

Finanzen

Top cryptocurrencies by market cap from CoinGecko

@codytseng #crypto #finance #markets

Install and configure this source

  1. Install Glanceway and open it on your Mac before using the install link above.
  2. Choose Install in Glanceway. If the browser cannot open the app, download the .gwsrc file and import it through source management.
  3. Complete the required fields below, save, and choose a refresh interval. Check the source after its first successful fetch.

Configuration checklist

  • CURRENCY — Optional. Display currency for prices
  • ORDER — Optional. How to sort the coin list

The current source retrieves up to 250 market assets and offers currency and sorting settings. It has no individual coin-ID selector or API-key field. Provider access rules and rate limits still apply.

Example settings

CURRENCY: usd
ORDER: market_cap_desc

If items are missing

  • Verify the field names, list entries, and credentials against the current version’s configuration table. Sample values below are examples, not active credentials.
  • Check network access and upstream service availability. Authentication failures and rate limits can prevent a refresh; use a slower interval when the provider limits requests.
  • An empty result can also mean there are no matching items. Fetched content and update timing depend on the provider and source implementation.

Konfiguration

Name Schlüssel Typ Erforderlich Standard Beschreibung
Currency CURRENCY select Nein usd Display currency for prices
usdeurgbpjpycny
Sort Order ORDER select Nein market_cap_desc How to sort the coin list
market_cap_descvolume_desc

Quellcode

id: codytseng/coingecko-crypto
version: 1.1.0
name: CoinGecko Crypto Markets
description: Top cryptocurrencies by market cap from CoinGecko
author: codytseng
author_url: https://github.com/codytseng
category: Finance
tags:
  - crypto
  - finance
  - markets

config:
  - key: CURRENCY
    name: Currency
    type: select
    required: false
    default: usd
    description: Display currency for prices
    options:
      - usd
      - eur
      - gbp
      - jpy
      - cny
  - key: ORDER
    name: Sort Order
    type: select
    required: false
    default: market_cap_desc
    description: How to sort the coin list
    options:
      - market_cap_desc
      - volume_desc
function currencySymbol(currency) {
  switch (currency) {
    case "usd":
      return "$";
    case "eur":
      return "\u20AC";
    case "gbp":
      return "\u00A3";
    case "jpy":
      return "\u00A5";
    case "cny":
      return "\u00A5";
    default:
      return "";
  }
}

module.exports = async (api) => {
  const currency = api.config.get("CURRENCY") || "usd";
  const order = api.config.get("ORDER") || "market_cap_desc";

  async function fetchData() {
    const url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=${currency}&order=${order}&per_page=250&sparkline=false`;

    const response = await api.fetch(url);

    if (!response.ok || !response.json) {
      throw new Error(`Failed to fetch CoinGecko market data (HTTP ${response.status})`);
    }

    const now = Date.now();
    const items = response.json.map((item, i) => {
      const change = item.price_change_percentage_24h;
      const changeStr =
        change != null
          ? ` ${change > 0 ? "+" : ""}${change.toFixed(2)}%`
          : "";

      return {
        id: item.id,
        title: `${item.name} (${item.symbol.toUpperCase()})`,
        subtitle: `${currencySymbol(currency)}${item.current_price.toLocaleString("en-US")}${changeStr}`,
        tickerText: `${item.symbol.toUpperCase()} ${currencySymbol(currency)}${item.current_price.toLocaleString("en-US")}${changeStr}`,
        url: `https://www.coingecko.com/en/coins/${item.id}`,
        timestamp: now - i,
      };
    });

    api.emit(items);
  }

  await fetchData();

  return {
    refresh: fetchData,
  };
};
id: codytseng/coingecko-crypto
version: 1.0.0
name: CoinGecko Crypto Markets
description: Top cryptocurrencies by market cap from CoinGecko
author: codytseng
author_url: https://github.com/codytseng
category: Finance
tags:
  - crypto
  - finance
  - markets

config:
  - key: CURRENCY
    name: Currency
    type: select
    required: false
    default: usd
    description: Display currency for prices
    options:
      - usd
      - eur
      - gbp
      - jpy
      - cny
  - key: ORDER
    name: Sort Order
    type: select
    required: false
    default: market_cap_desc
    description: How to sort the coin list
    options:
      - market_cap_desc
      - volume_desc
function currencySymbol(currency) {
  switch (currency) {
    case "usd":
      return "$";
    case "eur":
      return "\u20AC";
    case "gbp":
      return "\u00A3";
    case "jpy":
      return "\u00A5";
    case "cny":
      return "\u00A5";
    default:
      return "";
  }
}

module.exports = async (api) => {
  const currency = api.config.get("CURRENCY") || "usd";
  const order = api.config.get("ORDER") || "market_cap_desc";

  async function fetchData() {
    const url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=${currency}&order=${order}&per_page=250&sparkline=false`;

    const response = await api.fetch(url);

    if (!response.ok || !response.json) {
      throw new Error(`Failed to fetch CoinGecko market data (HTTP ${response.status})`);
    }

    const now = Date.now();
    const items = response.json.map((item, i) => {
      const change = item.price_change_percentage_24h;
      const changeStr =
        change != null
          ? ` ${change > 0 ? "+" : ""}${change.toFixed(2)}%`
          : "";

      return {
        id: item.id,
        title: `${item.name} (${item.symbol.toUpperCase()})`,
        subtitle: `${currencySymbol(currency)}${item.current_price.toLocaleString("en-US")}${changeStr}`,
        url: `https://www.coingecko.com/en/coins/${item.id}`,
        timestamp: now - i,
      };
    });

    api.emit(items);
  }

  await fetchData();

  return {
    refresh: fetchData,
  };
};

Ähnliche Quellen