Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
hkuds avatar

Okx Market

  • 2 installs
  • 29.6k repo stars
  • Updated August 4, 2026
  • hkuds/vibe-trading

Query OKX V5 public REST API for spot, swap, futures, and options market data like prices, candlesticks, funding rates, and open interest.

About

Provides an interface to the OKX V5 public REST API for retrieving crypto spot, derivatives, and index market data via Python. A developer uses it to pull real-time prices, candlesticks, funding rates, and open interest without authentication.

  • Public market-data endpoints, no API key or account required
  • Covers spot, perpetual swaps, futures, options, and index data

Okx Market by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #870 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hkuds/vibe-trading --skill okx-market

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars29.6k
Last updatedAugust 4, 2026
Repositoryhkuds/vibe-trading

What it does

Query OKX V5 public REST API for spot, swap, futures, and options market data like prices, candlesticks, funding rates, and open interest.

Files

SKILL.mdMarkdownGitHub ↗

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

Python Script Examples

  • Market data retrieval example
  • Candlestick data retrieval example

Market Data Endpoint List

IDEndpoint PathTitle (Detailed Documentation)CategoryDescription
1/market/tickerSingle TickerSpot MarketRetrieve the latest market data for a single trading instrument, including last price, bid/ask, 24h volume, and more
2/market/tickersBatch TickersSpot MarketRetrieve all market data for a given instrument class (SPOT/SWAP/FUTURES/OPTION) in batch
3/market/candlesCandlestick DataSpot MarketRetrieve candlestick (OHLCV) data with multiple supported intervals
4/market/tradesRecent TradesSpot MarketRetrieve recent trade-level details
5/public/instrumentsInstrument ListSpot MarketRetrieve metadata for all tradable instruments, including minimum order size and price precision
6/market/booksOrder Book DepthSpot MarketRetrieve bid/ask order book depth data
7/public/funding-rateFunding RateDerivatives MarketRetrieve current and historical funding rates for perpetual contracts
8/public/funding-rate-historyHistorical Funding RateDerivatives MarketRetrieve historical funding-rate data for perpetual contracts
9/public/mark-priceMark PriceDerivatives MarketRetrieve mark prices for derivatives, used for PnL and liquidation calculations
10/public/open-interestOpen InterestDerivatives MarketRetrieve open-interest data for derivatives
11/public/price-limitPrice LimitDerivatives MarketRetrieve the current maximum and minimum price limits for derivatives
12/market/index-tickersIndex TickersIndex MarketRetrieve index price market data
13/market/index-candlesIndex CandlesIndex MarketRetrieve index candlestick data

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.