Agent SkillsHKUDS/Vibe-Trading › okx-market

okx-market

GitHub

提供OKX V5公开API接口,用于获取加密货币现货、合约等市场数据。无需认证,支持Python调用,涵盖行情、K线及资金费率等实时数据查询功能。

agent/src/skills/okx-market/SKILL.md HKUDS/Vibe-Trading

Trigger Scenarios

需要获取加密货币实时价格或行情数据 查询K线历史数据或交易对信息

Install

npx skills add HKUDS/Vibe-Trading --skill okx-market -g -y
More Options

Non-standard path

npx skills add https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/okx-market -g -y

Use without installing

npx skills use HKUDS/Vibe-Trading@okx-market

指定 Agent (Claude Code)

npx skills add HKUDS/Vibe-Trading --skill okx-market -a claude-code -g -y

安装 repo 全部 skill

npx skills add HKUDS/Vibe-Trading --all -g -y

预览 repo 内 skill

npx skills add HKUDS/Vibe-Trading --list

SKILL.md

Frontmatter
{
    "name": "okx-market",
    "category": "data-source",
    "description": "OKX cryptocurrency market data interface. Uses the OKX V5 REST API to retrieve spot, derivatives, index, and other crypto market data, including real-time prices, candlesticks, funding rates, open interest, and more. No authentication required, free to use."
}

OKX Market

Overview

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.

Quick Start

  • Install a Python runtime (Python 3.9+ recommended) and the required requests dependency.
pip install requests pandas
  • No account registration or token configuration is required. Market-data endpoints are fully open.
  • Review the endpoint documentation below and locate the interface you need.
  • Use Python code to retrieve data according to the documentation. Example for the spot ticker endpoint:
import requests
import pandas as pd

BASE_URL = "https://www.okx.com/api/v5"

# Get the latest BTC-USDT market quote
resp = requests.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}%")

Parameter Format Reference

  • Instrument format (instId):
    • Spot: BTC-USDT, ETH-USDT
    • Perpetual swap: BTC-USDT-SWAP, ETH-USDT-SWAP
    • Delivery futures: BTC-USDT-250328 (expiry date in YYMMDD)
    • Options: BTC-USD-250328-95000-C (expiry-strike-C/P)
    • Index: BTC-USD, ETH-USD
  • Candlestick interval (bar): 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 1W, 1M
  • Instrument type (instType): SPOT (spot), SWAP (perpetual), FUTURES (delivery), OPTION (option)
  • Timestamp: millisecond Unix timestamp (for example 1773763200000)
  • Response format: JSON. code=0 indicates success, and data is returned in the data field

Link convention: every link to references/ in this document is written with the skill-name prefix (for example okx-market/references/...). The read_file tool resolves paths rooted at skills/, so omitting the prefix makes the read fail. When adding new skill docs, always use the <skill-name>/references/... form.

Python Script Examples

Market Data Endpoint List

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

Version History

  • 0aa45a9 Current 2026-07-24 17:46

Same Skill Collection

agent/src/skills/adr-hshare/SKILL.md
agent/src/skills/akshare/SKILL.md
agent/src/skills/alpha-zoo/SKILL.md
agent/src/skills/ashare-pre-st-filter/SKILL.md
agent/src/skills/asset-allocation/SKILL.md
agent/src/skills/backtest-diagnose/SKILL.md
agent/src/skills/behavioral-finance/SKILL.md
agent/src/skills/candlestick/SKILL.md
agent/src/skills/ccxt/SKILL.md
agent/src/skills/chanlun/SKILL.md
agent/src/skills/commodity-analysis/SKILL.md
agent/src/skills/corporate-events/SKILL.md
agent/src/skills/correlation-analysis/SKILL.md
agent/src/skills/correlation-regime/SKILL.md
agent/src/skills/cross-market-strategy/SKILL.md
agent/src/skills/crypto-derivatives/SKILL.md
agent/src/skills/data-routing/SKILL.md
agent/src/skills/defi-yield/SKILL.md
agent/src/skills/dividend-analysis/SKILL.md
agent/src/skills/doc-reader/SKILL.md
agent/src/skills/earnings-forecast/SKILL.md
agent/src/skills/earnings-revision/SKILL.md
agent/src/skills/eastmoney/SKILL.md
agent/src/skills/edgar-sec-filings/SKILL.md
agent/src/skills/elliott-wave/SKILL.md
agent/src/skills/event-driven/SKILL.md
agent/src/skills/execution-model/SKILL.md
agent/src/skills/factor-research/SKILL.md
agent/src/skills/fund-analysis/SKILL.md
agent/src/skills/fundamental-filter/SKILL.md
agent/src/skills/geopolitical-risk/SKILL.md
agent/src/skills/global-macro/SKILL.md
agent/src/skills/harmonic/SKILL.md
agent/src/skills/hedging-strategy/SKILL.md
agent/src/skills/hk-connect-flow/SKILL.md
agent/src/skills/ichimoku/SKILL.md
agent/src/skills/investor-lenses/SKILL.md
agent/src/skills/liquidation-heatmap/SKILL.md
agent/src/skills/macro-analysis/SKILL.md
agent/src/skills/market-microstructure/SKILL.md
agent/src/skills/minute-analysis/SKILL.md
agent/src/skills/ml-strategy/SKILL.md
agent/src/skills/mootdx/SKILL.md
agent/src/skills/multi-factor/SKILL.md
agent/src/skills/onchain-analysis/SKILL.md
agent/src/skills/options-advanced/SKILL.md
agent/src/skills/options-payoff/SKILL.md
agent/src/skills/options-strategy/SKILL.md
agent/src/skills/pair-trading/SKILL.md

Metadata

Files
0
Version
9806936
Hash
c6935fcd
Indexed
2026-07-24 17:46

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 20:46
浙ICP备14020137号-1 $mapa de visitantes$