| name | okx-market |
| 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. |
| category | data-source |
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"
resp = requests.get(f"{BASE_URL}/market/ticker", params={"instId": "BTC-USDT"})
data = resp.json()[][]
()