← 返回 Skills 市场
u91win

Crypto Kline BTC加密货币K线数据-Binance

作者 u91win · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
313
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install crypto-kline-bn
功能描述
通过Binance API采集BTC等加密货币多周期K线数据,支持历史完整获取及代理配置。
使用说明 (SKILL.md)

Crypto K线采集器

通过Binance API采集加密货币K线数据的工具。

功能

  • 支持BTC、ETH等主流加密货币
  • 支持多种时间周期(1m, 5m, 15m, 30m, 1h, 4h, 6h, 12h, 1d, 1w)
  • 自动获取完整历史数据
  • 支持代理配置

使用方法

Python脚本(推荐)

# 采集BTC 1小时K线数据
python3 ~/.openclaw/workspace/skills/crypto-kline/scripts/crypto-kline.py --symbol BTCUSDT --interval 1h

# 采集ETH 4小时K线数据
python3 ~/.openclaw/workspace/skills/crypto-kline/scripts/crypto-kline.py --symbol ETHUSDT --interval 4h

# 采集并保存到指定数据库
python3 ~/.openclaw/workspace/skills/crypto-kline/scripts/crypto-kline.py --symbol BTCUSDT --interval 1h --db-path /path/to/db.db

参数说明

参数 说明 默认值
--symbol 交易对 (如 BTCUSDT, ETHUSDT) BTCUSDT
--interval K线周期 1h
--start-date 开始日期 (YYYY-MM-DD) 2024-01-01
--end-date 结束日期 (YYYY-MM-DD) 今天
--db-path 数据库路径 ~/.openclaw/workspace/data/{symbol}_{interval}_kline.db
--proxy HTTP代理 http://192.168.10.188:7897

支持的交易对

  • BTCUSDT, ETHUSDT, BNBUSDT, SOLUSDT, XRPUSDT
  • 以及其他Binance支持的USDT交易对

支持的时间周期

周期 说明
1m 1分钟
5m 5分钟
15m 15分钟
30m 30分钟
1h 1小时
4h 4小时
6h 6小时
12h 12小时
1d 1天
1w 1周

Node.js脚本

# 基本用法
node ~/.openclaw/workspace/skills/crypto-kline/scripts/binance-kline.js BTCUSDT 1h 100

# 指定日期范围
node ~/.openclaw/workspace/skills/crypto-kline/scripts/binance-kline.js BTCUSDT 1h 1000 --start 2024-01-01 --end 2025-01-01

数据库表结构

CREATE TABLE {symbol}_{interval}_kline (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    timestamp INTEGER,
    open_time TEXT,
    open REAL,
    high REAL,
    low REAL,
    close REAL,
    volume REAL,
    quote_volume REAL,
    created_at TEXT DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_timestamp ON {symbol}_{interval}_kline(timestamp);

示例

采集BTC 1小时数据并重采样为6小时

# 1. 采集1小时数据
python3 ~/.openclaw/workspace/skills/crypto-kline/scripts/crypto-kline.py --symbol BTCUSDT --interval 1h

# 2. 使用resample脚本转换为6小时
python3 ~/.openclaw/workspace/scripts/resample_1h_to_6h.py --input ~/.openclaw/workspace/data/btcusdt_1h_kline.db --output ~/.openclaw/workspace/data/btcusdt_6h_kline.db

注意事项

  • 需要网络访问Binance API
  • 建议使用代理以提高稳定性
  • 获取大量历史数据时会有请求频率限制
安全使用建议
This skill largely matches its description (fetches Binance klines and stores them locally), but it uses a default/hard-coded proxy (http://192.168.10.188:7897) in the Python script and promotes proxy use in the documentation. A proxy can see and tamper with your requests/responses, so do NOT use the bundled default proxy. Before installing or running: 1) Inspect the scripts locally (you already have them) and remove or change the --proxy default in crypto-kline.py or call it with --proxy '' (empty) to avoid using a proxy. 2) Prefer running without a proxy or specify a trusted proxy you control. 3) Be aware of the metadata mismatch: ensure node and python3 are available if you plan to use the Node script. 4) Note the SKILL.md references a resample script that is not included — don’t expect it to be present. If you need higher assurance, run the scripts in an isolated environment or sandbox and monitor outgoing network connections to confirm traffic only goes to api.binance.com (or your allowed endpoints).
功能分析
Type: OpenClaw Skill Name: crypto-kline-bn Version: 1.0.0 The skill bundle contains a SQL injection vulnerability in `scripts/crypto-kline.py`, where table names are constructed using f-strings from user-supplied arguments (`--symbol` and `--interval`) without sanitization. Additionally, both `SKILL.md` and `scripts/crypto-kline.py` include a hardcoded local network proxy (http://192.168.10.188:7897), which is atypical for a general-purpose tool and could lead to connection failures or unexpected routing in different environments. While the code's logic is consistent with its stated purpose of fetching Binance K-line data, these implementation flaws pose a security risk.
能力评估
Purpose & Capability
The code and SKILL.md implement Binance K-line fetching and local SQLite storage, which matches the name/description. However _meta.json declares required binaries (node, python3) while the registry metadata shown earlier listed none — a metadata inconsistency. The SKILL.md references an external resample script (resample_1h_to_6h.py) that is not included.
Instruction Scope
Instructions instruct running the included Python/Node scripts and storing DB files under ~/.openclaw/workspace — expected. But SKILL.md and the Python script strongly push using an HTTP proxy (examples and default --proxy), and SKILL.md recommends using a proxy for stability. The example resample script referenced is missing. The instruction set therefore implicitly directs network traffic through a specific proxy by default, which exceeds what is necessary for the stated task.
Install Mechanism
No install spec (instruction-only with bundled scripts). No remote downloads or archive extraction. Risk from installation is low.
Credentials
The skill declares no required environment variables, yet the Node script respects HTTPS_PROXY/ http_proxy env vars and the Python script hardcodes a default proxy (http://192.168.10.188:7897). A data-collection skill should not force or recommend an opaque proxy by default — that proxy can observe/modify requests/responses. No other credentials are requested, which is proportionate.
Persistence & Privilege
always is false and the skill does not request elevated or cross-skill privileges. It writes database files into ~/.openclaw/workspace/data which is consistent with its purpose.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install crypto-kline-bn
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /crypto-kline-bn 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of Crypto K线采集器. - 支持通过Binance API采集主流加密货币(如BTC、ETH等)K线数据 - 支持多种K线周期(1m至1w) - 自动获取完整历史K线,支持代理配置 - 提供Python和Node.js脚本采集与参数自定义 - 采集数据可保存至本地数据库,附带表结构说明 - 包含数据重采样推荐用法示例
元数据
Slug crypto-kline-bn
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Crypto Kline BTC加密货币K线数据-Binance 是什么?

通过Binance API采集BTC等加密货币多周期K线数据,支持历史完整获取及代理配置。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 313 次。

如何安装 Crypto Kline BTC加密货币K线数据-Binance?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install crypto-kline-bn」即可一键安装,无需额外配置。

Crypto Kline BTC加密货币K线数据-Binance 是免费的吗?

是的,Crypto Kline BTC加密货币K线数据-Binance 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Crypto Kline BTC加密货币K线数据-Binance 支持哪些平台?

Crypto Kline BTC加密货币K线数据-Binance 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Crypto Kline BTC加密货币K线数据-Binance?

由 u91win(@u91win)开发并维护,当前版本 v1.0.0。

💬 留言讨论