crypto-tracker

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Crypto Tracker

加密货币追踪器

Track cryptocurrency prices, set price/percentage alerts, and search coins using the free CoinGecko API (no API key required).
追踪加密货币价格,设置价格/涨跌幅提醒,还可通过免费的CoinGecko API搜索币种(无需API密钥)。

Quick Commands

快速命令

Check Prices

查看价格

bash
undefined
bash
undefined

Single coin

Single coin

uv run {baseDir}/scripts/crypto.py price bitcoin
uv run {baseDir}/scripts/crypto.py price bitcoin

Multiple coins

Multiple coins

uv run {baseDir}/scripts/crypto.py price bitcoin ethereum solana
uv run {baseDir}/scripts/crypto.py price bitcoin ethereum solana

With more details (market cap, volume)

With more details (market cap, volume)

uv run {baseDir}/scripts/crypto.py price bitcoin --detailed
undefined
uv run {baseDir}/scripts/crypto.py price bitcoin --detailed
undefined

Search Coins

搜索币种

bash
undefined
bash
undefined

Find coin ID by name/symbol

Find coin ID by name/symbol

uv run {baseDir}/scripts/crypto.py search doge uv run {baseDir}/scripts/crypto.py search cardano
undefined
uv run {baseDir}/scripts/crypto.py search doge uv run {baseDir}/scripts/crypto.py search cardano
undefined

Manage Alerts

管理提醒

bash
undefined
bash
undefined

Set price threshold alert

Set price threshold alert

uv run {baseDir}/scripts/crypto.py alert <user_id> bitcoin above 100000 uv run {baseDir}/scripts/crypto.py alert <user_id> ethereum below 3000
uv run {baseDir}/scripts/crypto.py alert <user_id> bitcoin above 100000 uv run {baseDir}/scripts/crypto.py alert <user_id> ethereum below 3000

Set percentage change alert (24h)

Set percentage change alert (24h)

uv run {baseDir}/scripts/crypto.py alert <user_id> bitcoin change 5 # ±5% uv run {baseDir}/scripts/crypto.py alert <user_id> solana drop 10 # -10% uv run {baseDir}/scripts/crypto.py alert <user_id> ethereum rise 15 # +15%
uv run {baseDir}/scripts/crypto.py alert <user_id> bitcoin change 5 # ±5% uv run {baseDir}/scripts/crypto.py alert <user_id> solana drop 10 # -10% uv run {baseDir}/scripts/crypto.py alert <user_id> ethereum rise 15 # +15%

List user's alerts

List user's alerts

uv run {baseDir}/scripts/crypto.py alerts <user_id>
uv run {baseDir}/scripts/crypto.py alerts <user_id>

Remove an alert

Remove an alert

uv run {baseDir}/scripts/crypto.py alert-rm <alert_id>
uv run {baseDir}/scripts/crypto.py alert-rm <alert_id>

Check all alerts (for cron/heartbeat)

Check all alerts (for cron/heartbeat)

uv run {baseDir}/scripts/crypto.py check-alerts
undefined
uv run {baseDir}/scripts/crypto.py check-alerts
undefined

Coin Aliases

币种别名

Common symbols are automatically resolved:
  • btc
    → bitcoin
  • eth
    → ethereum
  • sol
    → solana
  • doge
    → dogecoin
  • ada
    → cardano
  • xrp
    → ripple
  • dot
    → polkadot
  • matic
    → polygon
  • link
    → chainlink
  • avax
    → avalanche-2
  • ltc
    → litecoin
常用符号会自动解析:
  • btc
    → bitcoin
  • eth
    → ethereum
  • sol
    → solana
  • doge
    → dogecoin
  • ada
    → cardano
  • xrp
    → ripple
  • dot
    → polkadot
  • matic
    → polygon
  • link
    → chainlink
  • avax
    → avalanche-2
  • ltc
    → litecoin

Alert Types

提醒类型

TypeExampleTriggers When
above
alert user btc above 100000
Price >= $100,000
below
alert user eth below 3000
Price <= $3,000
change
alert user btc change 5
24h change >= ±5%
drop
alert user sol drop 10
24h change <= -10%
rise
alert user eth rise 15
24h change >= +15%
类型示例触发条件
above
alert user btc above 100000
价格 >= 100,000美元
below
alert user eth below 3000
价格 <= 3,000美元
change
alert user btc change 5
24小时涨跌幅 >= ±5%
drop
alert user sol drop 10
24小时涨跌幅 <= -10%
rise
alert user eth rise 15
24小时涨跌幅 >= +15%

Cron Integration

Cron集成

Check alerts periodically (e.g., every 15 minutes):
bash
uv run {baseDir}/scripts/crypto.py check-alerts --json-output
Returns triggered alerts with user IDs for notification.
定期检查提醒(例如每15分钟一次):
bash
uv run {baseDir}/scripts/crypto.py check-alerts --json-output
返回触发的提醒及对应的用户ID,用于发送通知。

Data Storage

数据存储

Alerts stored in
{baseDir}/data/alerts.json
with:
  • Per-user alert tracking
  • Cooldown between repeat notifications (default: 1 hour)
  • Last triggered timestamp
提醒存储在
{baseDir}/data/alerts.json
中,包含:
  • 按用户维度追踪提醒
  • 重复通知冷却时间(默认1小时)
  • 上次触发时间戳

Notes

注意事项

  • CoinGecko free tier: ~10-30 requests/minute (no API key needed)
  • 15,000+ coins supported
  • Use
    --json-output
    flag for machine-readable output
  • CoinGecko免费套餐:每分钟约10-30次请求(无需API密钥)
  • 支持超过15000种币种
  • 使用
    --json-output
    参数可获取机器可读的输出