Query real-time cryptocurrency prices and market data using the free CoinGecko API.
python3 scripts/crypto-price.py get bitcoin
python3 scripts/crypto-price.py get ethereum cny
python3 scripts/crypto-price.py top 10
python3 scripts/crypto-price.py search solana
search Search for cryptocurrencies by name or symbol.
Example:
python3 scripts/crypto-price.py search bitcoin
# Output: BTC - Bitcoin, ID: bitcoin
get [currency] Get price for a specific cryptocurrency.
coin_id: The CoinGecko ID (e.g., bitcoin, ethereum, solana)currency: Optional, defaults to 'usd'. Supported: usd, cny, eur, jpy, gbp, krw, etc.Example:
python3 scripts/crypto-price.py get bitcoin cny
# Output: 💰 BITCOIN
# 价格: ¥460,123.45
# 24h 涨跌: 🟢 +5.23%
top [limit] [currency]View top cryptocurrencies by market cap.
limit: Number of coins to show (1-100), default 10currency: Optional, defaults to 'usd'Example:
python3 scripts/crypto-price.py top 5 cny
# Shows top 5 coins with prices in CNY
Use the search command to find the correct coin_id:
python3 scripts/crypto-price.py search "binance"
# Output: BNB - BNB, ID: binancecoin
Popular coin IDs:
共 1 个版本