返回 Skill 列表
extension
分类: 开发与工程无需 API Key

getCriptoPrice

通过公共API(如CoinGecko)获取加密资产(例如:BTC、ETH)的最新USD价格。当用户询问某种加密资产的价格时使用。

person作者: jakexiaohubgithub

getCriptoPrice

This skill provides a simple, reliable way to fetch a crypto spot price in USD.

What it does

  • Input: a crypto asset symbol (e.g., BTC) or CoinGecko id (e.g., bitcoin)
  • Output: JSON with the normalized price payload

How to run (script)

Use the bundled script:

node scripts/getCriptoPrice.mjs BTC
# or
node scripts/getCriptoPrice.mjs bitcoin

Output format

{
  "ok": true,
  "asset": {
    "input": "BTC",
    "coingecko_id": "bitcoin",
    "symbol": "btc",
    "name": "Bitcoin"
  },
  "currency": "usd",
  "price": 12345.67,
  "ts": "2026-02-14T03:03:00.000Z",
  "source": "coingecko"
}

Notes

  • Uses CoinGecko's public endpoints; no API key required.
  • If you later want higher rate limits/latency guarantees, swap the data source (e.g., Coinbase, Kraken, Binance) and keep the same output schema.