← 返回
数据分析 中文

UPBIT market data get skill

Fetch market data from Upbit via CLI commands including pairs, candles, trades, tickers, orderbooks, and watchlist with JSON output.
通过 CLI 命令从 Upbit 获取市场数据,包括交易对、K线、交易、行情、订单簿和自选列表,输出 JSON。
kuns9
数据分析 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 1,204
下载
💾 16
安装
1
版本
#latest

概述

Upbit Market Data Skill

A CLI-based OpenClaw skill that fetches quotation/market data from the Upbit Open API.

This skill is designed to be executed via OpenClaw exec (run-once). It supports:

  • Trading pair (market) list
  • Candles (second/minute/day/week/month/year)
  • Recent trades
  • Tickers (by trading pairs / by quote currency)
  • Orderbooks
  • Watchlist tickers (from config)

All responses are JSON:

  • Success → stdout: { "ok": true, "result": ... }
  • Error → stderr: { "ok": false, "error": { ... } } and exit code 1

Requirements

  • Node.js 18+ (uses built-in fetch)
  • NPM

Installation

npm install

Configuration (JSON)

Create config/config.json.

Example:

{
  "upbit": {
    "baseUrl": "https://api.upbit.com",
    "accessKey": "",
    "secretKey": ""
  },
  "watchlist": ["KRW-BTC", "KRW-ETH", "KRW-SOL"]
}

Config path override

Default path:

  • config/config.json

Override at runtime:

node skill.js tickers --markets=KRW-BTC --config=./config/config.json

CLI Grammar

General format:

node skill.js <command> [subcommand] [--option=value]

Rules:

  1. is required.
  2. [subcommand] is optional and MUST NOT start with --.
  3. Options must be provided as --key=value or --key value.
  4. Outputs are always JSON.

STRICT MODE (Recommended for OpenClaw)

OpenClaw/LLM agents may reorder arguments when generating CLI calls. To prevent confusion, enable strict mode.

Enable strict mode

Add --strict=true to the command:

node skill.js tickers --markets=KRW-BTC,KRW-ETH --strict=true

Strict mode rules (hard requirements)

When --strict=true:

  1. Candle type MUST appear immediately after candles:
    • node skill.js candles minutes --market=KRW-ETH --unit=5 --strict=true
    • node skill.js candles --market=KRW-ETH minutes --unit=5 --strict=true
  2. Candle type MUST NOT be passed as an option (do not use --type= in strict mode).
  3. For non-candles commands, subcommand must be omitted.
  4. Any unexpected positional arguments (extra words not starting with --) will cause an error.

Why strict mode helps:

  • It forces a single canonical command shape, making it far harder for OpenClaw/LLM to generate ambiguous or reordered invocations.

Commands

1) List trading pairs (markets)

node skill.js pairs --details=true --strict=true

2) Candles (CRITICAL STRUCTURE)

Candles require a candle type immediately after candles.

Canonical structure

node skill.js candles <type> --market=<MARKET> [options]

Where MUST be one of:

  • seconds
  • minutes
  • days
  • weeks
  • months
  • years

⚠️ is NOT passed as --unit.

⚠️ must appear immediately after candles.

Minutes candles (5-minute example)

node skill.js candles minutes --market=KRW-ETH --unit=5 --count=100 --strict=true

Allowed minute units:

1, 3, 5, 10, 15, 30, 60, 240

Other candles

node skill.js candles seconds --market=KRW-BTC --count=200 --strict=true
node skill.js candles days    --market=KRW-BTC --count=50  --strict=true
node skill.js candles weeks   --market=KRW-BTC --count=30  --strict=true
node skill.js candles months  --market=KRW-BTC --count=12  --strict=true
node skill.js candles years   --market=KRW-BTC --count=5   --strict=true

Incorrect examples (DO NOT USE)

# ❌ type passed as option
node skill.js candles --unit=minutes --market=KRW-ETH

# ❌ type after options
node skill.js candles --market=KRW-ETH minutes --unit=5

3) Recent trades

node skill.js trades --market=KRW-BTC --count=50 --strict=true

4) Tickers by trading pairs

node skill.js tickers --markets=KRW-BTC,KRW-ETH,KRW-SOL --strict=true

5) Tickers by quote currency

node skill.js quote-tickers --quote=KRW,BTC --strict=true

6) Orderbooks

node skill.js orderbook --markets=KRW-BTC --level=100000 --count=15 --strict=true

7) Watchlist tickers (from config)

node skill.js watchlist --strict=true

Error handling & rate limits

Upbit may respond with:

  • 429: Too Many Requests
  • 418: Request blocked
  • 400: Bad request

The skill passes Upbit error payloads (when present) under error.upbit.

Reference:

https://docs.upbit.com/kr/reference/rest-api-guide

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-29 06:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,093
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,594
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 56,997