用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill get-crypto-price命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | get-crypto-price |
| description | Fetch current and historical crypto prices and compute ATH or ATL over common time windows. |
This short guide shows how to fetch current prices and at least 3 months of past price action using CoinGecko, Binance, and Coinbase public APIs. It also shows how to compute ATH (highest) and ATL (lowest) within time windows: 1 DAY, 1 WEEK, 1 MONTH.
BTCUSDT on Binance, bitcoin on CoinGecko).curl "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
curl "https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=usd&days=90"
Response contains prices array: [[timestamp_ms, price], ...].
Node.js: Fetch 90 days and compute ATH/ATL for 1d/7d/30d windows.
async function fetchCoinGeckoPrices(coinId = 'bitcoin', vs = 'usd', days = 90) {
const url = `https://api.coingecko.com/api/v3/coins/${coinId}/market_chart`;
const res = await fetch(`${url}?vs_currency=${vs}&days=${days}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
return data.prices; // array of [ts_ms, price]
}
function maxMinInWindow(prices, sinceMs) {
const window = prices.filter(([ts]) => ts >= sinceMs).map(([, p]) => p);
if (window.length === 0) return [null, null];
return [Math.max(...window), Math.min(...window)];
}
const prices = await fetchCoinGeckoPrices('bitcoin', 'usd', 90);
const nowMs = Date.now();
const windows = {
'1d': nowMs - 24 * 3600 * 1000,
'1w': nowMs - 7 * 24 * 3600 * 1000,
'1m': nowMs - 30 * 24 * 3600 * 1000,
};
for (const [name, since] of Object.entries(windows)) {
const [ath, atl] = maxMinInWindow(prices, since);
console.log(name, 'ATH:', ath, 'ATL:', atl);
}
Notes: CoinGecko returns sampled points (usually hourly) — good for these windows.
curl "https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT"
klines endpoint. Example: fetch daily candles for the last 1000 days or hourly for finer resolution.# daily candles for BTCUSDT (limit up to 1000 rows)
curl "https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1d&limit=1000"
Each kline row: [openTime, open, high, low, close, ...] where openTime is ms.
Node.js: Fetch hourly klines for last 90 days and compute ATH/ATL windows.
async function fetchBinanceKlines(symbol = 'BTCUSDT', interval = '1h', limit = 1000) {
const url = 'https://api.binance.com/api/v3/klines';
const params = new URLSearchParams({ symbol, interval, limit: String(limit) });
const res = await fetch(`${url}?${params}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return await res.json(); // array of arrays
}
// To cover ~90 days hourly: 24*90 = 2160 rows -> call twice with different startTimes or use 4h interval
const klines = await fetchBinanceKlines('BTCUSDT', '1h', 1000);
// For more than 1000 rows you'd loop with startTime using ms timestamps.
// Convert to list of [ts_ms, high, low]
const data = klines.map(row => [row[0], parseFloat(row[2]), parseFloat(row[3])]);
const nowMs = .();
() {
filtered = data.( ts >= sinceMs);
(filtered. === ) [, ];
highs = filtered.( h);
lows = filtered.( l);
[.(...highs), .(...lows)];
}
windows = {
: nowMs - * * ,
: nowMs - * * * ,
: nowMs - * * * ,
};
( [name, since] .(windows)) {
[ath, atl] = (data, since);
.(name, , ath, , atl);
}
Notes: Binance limit is 1000 max per request; for full 90 days hourly, page by startTime.
curl "https://api.coinbase.com/v2/prices/BTC-USD/spot"
curl "https://api.exchange.coinbase.com/products/BTC-USD/candles?granularity=3600&start=2025-11-01T00:00:00Z&end=2026-02-01T00:00:00Z"
Response: array of [time, low, high, open, close, volume]. Use similar filtering by timestamp to compute ATH/ATL.
General steps (applies to any data source that gives timestamped prices or OHLC candles):
high as candidate for ATH and low as candidate for ATL. If you only have sampled prices, use max/min of sampled values.Example with simple price points (Node.js):
// points = [[ts_ms, price], ...]
const sinceMs = Date.now() - 24 * 3600 * 1000; // 1 day
const windowPrices = points.filter(([ts]) => ts >= sinceMs).map(([, p]) => p);
if (windowPrices.length > 0) {
const ath = Math.max(...windowPrices);
const atl = Math.min(...windowPrices);
} else {
const ath = null;
const atl = null;
}
If using OHLC candles:
// candles = [[ts_ms, open, high, low, close], ...]
const window = candles.filter(c => c[0] >= sinceMs);
const ath = Math.max(...window.map(c => c[2]));
const atl = Math.min(...window.map(c => c[3]));
market_chart?days=90 for quick 90-day history.klines or Coinbase candles and repeat the same aggregation.If you want, I can add ready-to-run scripts for specific coins (BTC, ETH) and automate paginated Binance fetches to guarantee 90 days of hourly data.
Agent note: When producing human-friendly reports, agents should use the skills/generate-report skill to produce formatted outputs (markdown or PDF). See skills/generate-report/SKILL.md for examples and templates.
Example agent prompt:
Use the generate-report skill to create a short Bitcoin price report (current price, 24h change, 7d change) in markdown and PDF. Include source URLs.