Crypto Price
name: crypto-price
by cscsxx606 · published 2026-03-22
$ claw add gh:cscsxx606/cscsxx606-crypto-price-pro---
name: crypto-price
description: 查询虚拟币实时价格和历史数据,支持生成趋势图、周报和邮件推送。当用户询问虚拟币价格、加密货币行情、需要币价分析报告或定时推送时使用此技能。
---
# Crypto Price
查询主流虚拟币实时价格、历史数据,生成趋势图和周报。
功能特性
使用方法
1. 查询当前价格
python3 skills/crypto-price/scripts/crypto_price.py <币种代码>**示例:**
python3 skills/crypto-price/scripts/crypto_price.py BTC
python3 skills/crypto-price/scripts/crypto_price.py ETH2. 查询历史价格
python3 skills/crypto-price/scripts/crypto_price.py <币种代码> --history <天数>**示例:**
python3 skills/crypto-price/scripts/crypto_price.py BTC --history 3
python3 skills/crypto-price/scripts/crypto_price.py ETH --history 73. 生成单币种趋势图
python3 skills/crypto-price/scripts/crypto_price.py <币种代码> --chart <天数>**示例:**
python3 skills/crypto-price/scripts/crypto_price.py BTC --chart 3
python3 skills/crypto-price/scripts/crypto_price.py ETH --chart 74. 生成多币种对比图
python3 skills/crypto-price/scripts/crypto_price.py BTC --compare <币种 1,币种 2,...> <天数>**示例:**
python3 skills/crypto-price/scripts/crypto_price.py BTC --compare BTC,ETH,SOL 3
python3 skills/crypto-price/scripts/crypto_price.py BTC --compare BTC,ETH,BNB,SOL,DOGE 75. 生成周报并发送邮件
# 配置环境变量(首次使用)
export EMAIL_SENDER="your_email@126.com"
export EMAIL_SENDER_NAME="Your Name"
export EMAIL_PASSWORD="your_smtp_password"
export EMAIL_RECIPIENT="recipient@example.com"
# 生成并发送周报
python3 skills/crypto-price/scripts/crypto_weekly_report.py**永久配置(添加到 ~/.zshrc):**
echo 'export EMAIL_SENDER="your_email@126.com"' >> ~/.zshrc
echo 'export EMAIL_SENDER_NAME="Your Name"' >> ~/.zshrc
echo 'export EMAIL_PASSWORD="your_smtp_password"' >> ~/.zshrc
echo 'export EMAIL_RECIPIENT="recipient@example.com"' >> ~/.zshrc
source ~/.zshrc**⚠️ 安全提示:**
支持的币种
| 代码 | 币种 | 代码 | 币种 |
|------|------|------|------|
| BTC | 比特币 | SOL | Solana |
| ETH | 以太坊 | XRP | 瑞波币 |
| USDT | 泰达币 | ADA | 艾达币 |
| BNB | 币安币 | DOGE | 狗狗币 |
| DOT | 波卡币 | MATIC | Polygon |
输出示例
当前价格
📊 BTC 价格信息
========================================
💵 美元价格: $73,246.00
💴 人民币价格: ¥505,100.00
📈 24h 涨跌: +1.97%
🏦 市值: $1.46T
========================================历史价格
📈 BTC 3 天历史价格
========================================
03-14: $70,965.28
03-15: $71,217.10
03-16: $72,681.91
========================================定时任务配置
每天上午 10 点发送周报
# 添加到 crontab
0 10 * * * cd /Users/admin/.openclaw/workspace && python3 skills/crypto-price/scripts/crypto_weekly_report.py或使用 OpenClaw cron:
openclaw cron add --schedule "0 10 * * *" --command "python3 skills/crypto-price/scripts/crypto_weekly_report.py"注意事项
1. **API 限制**: CoinGecko 免费 API 有速率限制(10-50 次/分钟)
2. **数据延迟**: 价格数据延迟约 1-5 分钟
3. **matplotlib**: 生成图表需要安装 matplotlib
4. **邮箱配置**: 邮件发送需要配置 126 邮箱 SMTP
依赖安装
# 安装 matplotlib(图表生成)
pip3 install matplotlib --break-system-packages --user
# 或
brew install python-matplotlib文件结构
crypto-price/
├── SKILL.md
└── scripts/
├── crypto_price.py # 主脚本(价格查询、图表生成)
└── crypto_weekly_report.py # 周报生成和邮件发送数据来源
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...