OKX K-Line Data Skill for Openclaw

A specialized data extraction tool for retrieving comprehensive historical K-line candlestick data from the OKX exchange.

u91win
v1.0.0
Mar 11, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install crypto-kline-okx

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install crypto-kline-okx using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is OKX K-Line Data Skill?

The OKX K-Line Data Skill is a robust utility designed for developers and traders who need precise historical market data. It interfaces directly with the OKX exchange to pull candlestick information across a vast array of timeframes, ranging from 1-minute intervals to monthly aggregates.

By leveraging this skill within the Openclaw Skills ecosystem, users can automate the collection of price action data for popular pairs like BTC-USDT, ETH-USDT, and SOL-USDT. It effectively bypasses standard API volume limitations through a sophisticated timestamp-based pagination system, allowing for the reconstruction of deep historical price archives for backtesting or algorithmic analysis.

OKX K-Line Data Skill Use Cases

  • Backtesting trading strategies using high-resolution historical price data.
  • Building custom cryptocurrency dashboards with real-time and historical candle updates.
  • Conducting technical analysis research across different timeframes like 4h, 1d, or 1w.
  • Archiving market data for specific events or periods by using pagination to reach deep historical records.

How OKX K-Line Data Skill Works

  1. The user specifies a trading pair, timeframe, and the desired number of records via a CLI command.
  2. The skill sends a request to the OKX API to fetch the specified candlestick data.
  3. If specific historical dates are required, the skill utilizes the --after or --before parameters to anchor the query to a millisecond timestamp.
  4. The system processes the response, handling the OKX 100-record limit per request through sequential pagination.
  5. Structured market data is returned to the user for immediate analysis or storage.

OKX K-Line Data Skill Setup

To get started with this skill, ensure you have Node.js installed and access to the script directory. Run the following commands to query data:

# Fetch the last 30 daily candles for BTC
node scripts/okx-kline.js BTC-USDT 1d 30

# Fetch historical ETH data using a timestamp
node scripts/okx-kline.js ETH-USDT 4h 100 --after=1743500000000

OKX K-Line Data Skill Data Schema & Taxonomy

The skill returns structured market data organized by the following taxonomy:

Parameter Description Valid Values
Trading Pair The crypto/fiat pair BTC-USDT, ETH-USDT, SOL-USDT, etc.
Timeframe The candle interval 1m, 5m, 15m, 1h, 4h, 1d, 1w, 1M
Limit Number of records Default 100, Maximum 100 per request
Timestamp Pagination anchor Millisecond Unix timestamps (e.g., 1743500000000)

OKX K-Line Data Skill Advanced Features

  • Multi-timeframe support for complex trend analysis across 11 different intervals.
  • Advanced pagination logic using --after (older data) and --before (newer data) flags.
  • Comprehensive spot market coverage including major altcoins like ONDO, PEPE, and DOGE.
  • Seamless integration with Openclaw Skills workflows for automated data pipelines.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*