# Okx Market

OKX cryptocurrency market data interface.

- Repository: https://github.com/HKUDS/Vibe-Trading (37375 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add HKUDS/Vibe-Trading --skill okx-market -g -a claude-code -y`
Codex: `npx skills add HKUDS/Vibe-Trading --skill okx-market -g -a codex -y`
Cursor: `npx skills add HKUDS/Vibe-Trading --skill okx-market -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/Vibe-Trading --skill okx-market -g -a gemini-cli -y`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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.

```bash
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:

```python
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

The rest: https://github.com/HKUDS/Vibe-Trading/blob/HEAD/agent/src/skills/okx-market/SKILL.md
