Retrieves cryptocurrency market data from OKX V5 REST API including spot, derivatives, index prices, candlesticks, funding rates, and open interest. No authentication required.
Ships in vibe-trading-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The OKX V5 REST API provides comprehensive cryptocurrency market data covering spot, perpetual swaps, delivery futures, options, and more. All market-data endpoints are public and can be called directly without authentication. The data comes from OKX, the world's second-largest cryptocurrency exchange.
requests dependency.pip install requests pandas
from src.data_gateway.reads import public_http_get
import pandas as pd
BASE_URL = "https://www.okx.com/api/v5"
# Get the latest BTC-USDT market quote
resp = public_http_get(f"{BASE_URL}/market/ticker", params={"instId": "BTC-USDT"})
data = resp.json()["data"][0]
print(f"BTC last price: {data['last']} 24h change: {float(data['last'])/float(data['open24h'])*100-100:.2f}%")
instId):
BTC-USDT, ETH-USDTBTC-USDT-SWAP, ETH-USDT-SWAPBTC-USDT-250328 (expiry date in YYMMDD)BTC-USD-250328-95000-C (expiry-strike-C/P)BTC-USD, ETH-USDbar): 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 1W, 1MinstType): SPOT (spot), SWAP (perpetual), FUTURES (delivery), OPTION (option)1773763200000)code=0 indicates success, and data is returned in the data fieldLink convention: every link to
references/in this document is written relative to this document (for examplereferences/...) — the form GitHub resolves when someone opens the file in a browser. Theread_filetool resolves the same string against the skill that owns it, so the agent and a human reader reach one file. When adding new skill docs, always use the relative form, and keep reference paths unique across skills: a path two skills both carry is reported as ambiguous rather than guessed.
| ID | Endpoint Path | Title (Detailed Documentation) | Category | Description |
|---|---|---|---|---|
| 1 | /market/ticker | Single Ticker | Spot Market | Retrieve the latest market data for a single trading instrument, including last price, bid/ask, 24h volume, and more |
| 2 | /market/tickers | Batch Tickers | Spot Market | Retrieve all market data for a given instrument class (SPOT/SWAP/FUTURES/OPTION) in batch |
| 3 | /market/candles | Candlestick Data | Spot Market | Retrieve candlestick (OHLCV) data with multiple supported intervals |
| 4 | /market/trades | Recent Trades | Spot Market | Retrieve recent trade-level details |
| 5 | /public/instruments | Instrument List | Spot Market | Retrieve metadata for all tradable instruments, including minimum order size and price precision |
| 6 | /market/books | Order Book Depth | Spot Market | Retrieve bid/ask order book depth data |
| 7 | /public/funding-rate | Funding Rate | Derivatives Market | Retrieve current and historical funding rates for perpetual contracts |
| 8 | /public/funding-rate-history | Historical Funding Rate | Derivatives Market | Retrieve historical funding-rate data for perpetual contracts |
| 9 | /public/mark-price | Mark Price | Derivatives Market | Retrieve mark prices for derivatives, used for PnL and liquidation calculations |
| 10 | /public/open-interest | Open Interest | Derivatives Market | Retrieve open-interest data for derivatives |
| 11 | /public/price-limit | Price Limit | Derivatives Market | Retrieve the current maximum and minimum price limits for derivatives |
| 12 | /market/index-tickers | Index Tickers | Index Market | Retrieve index price market data |
| 13 | /market/index-candles | Index Candles | Index Market | Retrieve index candlestick data |
references/合约行情/历史资金费率.md (opens in a new tab)references/合约行情/持仓量.md (opens in a new tab)references/合约行情/标记价格.md (opens in a new tab)references/合约行情/资金费率.md (opens in a new tab)references/合约行情/限价.md (opens in a new tab)references/指数行情/指数K线.md (opens in a new tab)references/指数行情/指数行情.md (opens in a new tab)references/现货行情/K线数据.md (opens in a new tab)references/现货行情/交易产品列表.md (opens in a new tab)references/现货行情/单个行情.md (opens in a new tab)references/现货行情/批量行情.md (opens in a new tab)references/现货行情/最近成交.md (opens in a new tab)references/现货行情/深度数据.md (opens in a new tab)scripts/candle_data_example.py (opens in a new tab)scripts/market_data_example.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/hkuds-vibe-trading-skills:okx-marketfrom vibe-trading-skills
Generated from the plugin's indexed repository (hkuds/vibe-trading) — no native marketplace selected
npx claudepluginhub p/hkuds-vibe-trading-skills89 skills in this plugin
/adr-hshareADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment./akshareAKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance./alpha-zooBrowse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.Other plugins' skills for the same job