okx-market
What it does
This skill pulls crypto prices and market information from the OKX exchange. It is for anyone who wants current or past crypto data without setting up an account.
When to use it
- ✓When you want the latest price or 24-hour change for a coin on OKX.
- ✓When you need candlestick history for a spot, swap, or futures market.
- ✓When you want to check funding rates or open interest for a crypto contract.
Skill link
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/okx-market/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“What is the current price and 24-hour change for ETH on OKX?”
5 new skills a week. 1 minute to read.
How it works
It sends requests to OKX's public market data API, which needs no sign-in. It then turns the responses into tables that are easy to read or analyze.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
requestsdependency.
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 inYYMMDD) - Options:
BTC-USD-250328-95000-C(expiry-strike-C/P) - Index:
BTC-USD,ETH-USD
- Spot:
- 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=0indicates success, and data is returned in thedatafield
Link 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.
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 curre |
FAQ
Do I need an OKX account?
No. Market data endpoints are public, so no account or token is needed.
How do I name a trading pair?
Use the format BTC-USDT for spot, BTC-USDT-SWAP for perpetuals, and similar codes for futures and options.
Does it need special Python packages?
It needs requests and pandas, which are common Python libraries.
Details
Original description by the author
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.
repo: HKUDS/Vibe-Trading
Popularity
- GitHub stars
- 37k
- Ranking position
- #7535
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
vibe-trading
37kGives your agent a full finance research toolkit, covering backtests, factor analysis, options pricing and market data across many markets.
adr-hshare
37kShows your agent how to compare the price of a Chinese company listed in several markets, such as a US ADR and a Hong Kong share.
akshare
37kLets your agent pull free market data for Chinese and global stocks, futures, forex and economic indicators, with no API key needed.
alpha-zoo
37kLets your agent browse a library of ready-made stock factors and test how well a whole set of them predicts returns on a chosen market.
Similar skills
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
slacrawl
394kLets your agent search and count messages in a local Slack archive, check how fresh that archive is, and refresh it when needed.
goplaces
394kHelps your agent search for places, get their details and reviews, and resolve place names using Google Places, with JSON output for scripts.