OKX API
Spot, swap, futures and options prices, candles, order book, trades, funding rates, open interest and options greeks from OKX.
View as Markdown| GET | /okx/ticker | Last price, best bid and ask and 24-hour statistics of one OKX instrument. |
| GET | /okx/tickers | Ticker of every OKX instrument of one type: SPOT, SWAP, FUTURES or OPTION. |
| GET | /okx/candles | OHLCV candles of one OKX instrument, newest first. Page back with cursor. |
| GET | /okx/orderBook | Order book of one OKX instrument: the best bids and asks, up to size levels each. |
| GET | /okx/trades | Most recent public trades of one OKX instrument, newest first. |
| GET | /okx/fundingRate | Current and next funding rate of one OKX perpetual swap. |
| GET | /okx/fundingRateHistory | Funding settlements of one OKX perpetual swap, newest first. Page back with cursor. |
| GET | /okx/historyCandles | OHLCV candles of one OKX instrument from the history, older than the newest page. Page back with cursor. |
| GET | /okx/instruments | Instruments of one product line: their base, quote and settlement currencies, contract sizes, tick and lot sizes and state. |
| GET | /okx/markPrice | Mark price of one instrument, or of every instrument of a product line when no symbol is given. |
| GET | /okx/openInterest | Open interest of one derivative instrument, or of every instrument of a product line when no symbol is given. |
| GET | /okx/priceLimit | Highest buy price and lowest sell price OKX accepts for one instrument right now. |
| GET | /okx/longShortRatio | Long/short account ratio of one coin across OKX, as a time series, newest first. |
| GET | /okx/openInterestVolume | Open interest and trading volume of one coin across OKX, as a time series, newest first. |
| GET | /okx/takerVolume | Taker sell and buy volume of one coin on contracts or spot across OKX, as a time series, newest first. |
| GET | /okx/indexTickers | Index prices and 24-hour statistics of OKX indices, for one quote currency or one index id. |
| GET | /okx/indexCandles | OHLC candles of one OKX index price, newest first. Page back with cursor. |
| GET | /okx/markPriceCandles | OHLC candles of the mark price of one OKX instrument, newest first. Page back with cursor. |
| GET | /okx/platformVolume | OKX trading volume of the last 24 hours across all its markets, in USD and CNY. |
| GET | /okx/optionSummary | Option contracts of one OKX underlying with mark volatility, Greeks and forward price. |
ticker
/v1/okx/tickerLast price, best bid and ask and 24-hour statistics of one OKX instrument.
Parameters
instIdstring required | Instrument id such as BTC-USDT, or an okx.com trade URL. e.g. BTC-USDT |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
16 fields
askPrice | string |
askSize | string |
bidPrice | string |
bidSize | string |
change | string |
changePercent | string |
high | string |
instType | string |
lastSize | string |
low | string |
open | string |
price | string |
symbol | string |
updatedAt | string |
volume | string |
volumeQuote24h | string |
curl "https://api.hoshime.com/v1/okx/ticker?instId=BTC-USDT" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/ticker?instId=BTC-USDT", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/ticker?instId=BTC-USDT", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": { "askPrice": "…", "askSize": "…", "bidPrice": "…", "bidSize": "…", "change": "…", "changePercent": "…", "high": "…", "instType": "…", "lastSize": "…", "low": "…", "open": "…", "price": "…", "symbol": "…", "updatedAt": "2026-11-06T09:41:00Z", "volume": "…", "volumeQuote24h": "…" }, "meta": { "cached": false, "endpoint": "ticker", "fetchedAt": "2026-11-06T09:41:00Z", "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
tickers
/v1/okx/tickersTicker of every OKX instrument of one type: SPOT, SWAP, FUTURES or OPTION.
Parameters
instTypestring required | Instrument type.SPOTSWAPFUTURESOPTIONe.g. SPOT |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
16 fields
askPrice | string |
askSize | string |
bidPrice | string |
bidSize | string |
change | string |
changePercent | string |
high | string |
instType | string |
lastSize | string |
low | string |
open | string |
price | string |
symbol | string |
updatedAt | string |
volume | string |
volumeQuote24h | string |
curl "https://api.hoshime.com/v1/okx/tickers?instType=SPOT" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/tickers?instType=SPOT", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/tickers?instType=SPOT", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "askPrice": "…", "askSize": "…", "bidPrice": "…", "bidSize": "…", "change": "…", "changePercent": "…", "high": "…", "instType": "…", "lastSize": "…", "low": "…", "open": "…", "price": "…", "symbol": "…", "updatedAt": "2026-11-06T09:41:00Z", "volume": "…", "volumeQuote24h": "…" } ], "meta": { "cached": false, "endpoint": "tickers", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
candles
/v1/okx/candlesOHLCV candles of one OKX instrument, newest first. Page back with cursor.
Parameters
instIdstring required | Instrument id such as BTC-USDT, or an okx.com trade URL. e.g. BTC-USDT |
barstring | Candle size.1m3m5m15m30m1H2H4H6H12H1D1W1Mdefault 1H |
limitinteger | Items per page, 1 to 300. default 100 |
cursorstring | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
8 fields
close | string |
confirmed | boolean |
high | string |
low | string |
open | string |
openedAt | string |
volume | string |
volumeQuote | string |
curl "https://api.hoshime.com/v1/okx/candles?instId=BTC-USDT" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/candles?instId=BTC-USDT", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/candles?instId=BTC-USDT", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "close": "…", "confirmed": false, "high": "…", "low": "…", "open": "…", "openedAt": "2026-11-06T09:41:00Z", "volume": "…", "volumeQuote": "…" } ], "meta": { "cached": false, "endpoint": "candles", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
orderBook
/v1/okx/orderBookOrder book of one OKX instrument: the best bids and asks, up to size levels each.
Parameters
instIdstring required | Instrument id such as BTC-USDT, or an okx.com trade URL. e.g. BTC-USDT |
depthinteger | Price levels per side, from 1 to 400. default 20 |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
10 fields
asks | Level[] |
orders | integer (int64) |
price | string |
size | string |
bids | Level[] |
orders | integer (int64) |
price | string |
size | string |
sequence | string |
updatedAt | string |
curl "https://api.hoshime.com/v1/okx/orderBook?instId=BTC-USDT" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/orderBook?instId=BTC-USDT", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/orderBook?instId=BTC-USDT", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": { "asks": [ { "orders": 0, "price": "…", "size": "…" } ], "bids": [ { "orders": 0, "price": "…", "size": "…" } ], "sequence": "…", "updatedAt": "2026-11-06T09:41:00Z" }, "meta": { "cached": false, "endpoint": "orderBook", "fetchedAt": "2026-11-06T09:41:00Z", "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
trades
/v1/okx/tradesMost recent public trades of one OKX instrument, newest first.
Parameters
instIdstring required | Instrument id such as BTC-USDT, or an okx.com trade URL. e.g. BTC-USDT |
limitinteger | Items per page, 1 to 500. default 100 |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
6 fields
id | string |
instId | string |
price | string |
side | string |
size | string |
tradedAt | string |
curl "https://api.hoshime.com/v1/okx/trades?instId=BTC-USDT" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/trades?instId=BTC-USDT", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/trades?instId=BTC-USDT", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "id": "abc123", "instId": "abc123", "price": "…", "side": "…", "size": "…", "tradedAt": "2026-11-06T09:41:00Z" } ], "meta": { "cached": false, "endpoint": "trades", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
fundingRate
/v1/okx/fundingRateCurrent and next funding rate of one OKX perpetual swap.
Parameters
instIdstring required | Swap instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. e.g. BTC-USDT-SWAP |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
8 fields
fundingAt | string |
fundingRate | string |
instId | string |
maxFundingRate | string |
minFundingRate | string |
nextFundingAt | string |
nextFundingRate | string |
updatedAt | string |
curl "https://api.hoshime.com/v1/okx/fundingRate?instId=BTC-USDT-SWAP" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/fundingRate?instId=BTC-USDT-SWAP", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/fundingRate?instId=BTC-USDT-SWAP", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": { "fundingAt": "2026-11-06T09:41:00Z", "fundingRate": "…", "instId": "abc123", "maxFundingRate": "…", "minFundingRate": "…", "nextFundingAt": "2026-11-06T09:41:00Z", "nextFundingRate": "…", "updatedAt": "2026-11-06T09:41:00Z" }, "meta": { "cached": false, "endpoint": "fundingRate", "fetchedAt": "2026-11-06T09:41:00Z", "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
fundingRateHistory
/v1/okx/fundingRateHistoryFunding settlements of one OKX perpetual swap, newest first. Page back with cursor.
Parameters
instIdstring required | Swap instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. e.g. BTC-USDT-SWAP |
limitinteger | Items per page, 1 to 100. default 100 |
cursorstring | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
6 fields
formulaType | string |
fundingRate | string |
instId | string |
method | string |
realizedRate | string |
settledAt | string |
curl "https://api.hoshime.com/v1/okx/fundingRateHistory?instId=BTC-USDT-SWAP" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/fundingRateHistory?instId=BTC-USDT-SWAP", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/fundingRateHistory?instId=BTC-USDT-SWAP", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "formulaType": "…", "fundingRate": "…", "instId": "abc123", "method": "…", "realizedRate": "…", "settledAt": "2026-11-06T09:41:00Z" } ], "meta": { "cached": false, "endpoint": "fundingRateHistory", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
historyCandles
/v1/okx/historyCandlesOHLCV candles of one OKX instrument from the history, older than the newest page. Page back with cursor.
Parameters
instIdstring required | Instrument id such as BTC-USDT, or an okx.com trade URL. e.g. BTC-USDT |
barstring | Candle size.1m3m5m15m30m1H2H4H6H12H1D1W1M3Mdefault 1He.g. 1D |
limitinteger | Items per page, 1 to 300. default 100 |
cursorstring | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
8 fields
close | string |
confirmed | boolean |
high | string |
low | string |
open | string |
openedAt | string |
volume | string |
volumeQuote | string |
curl "https://api.hoshime.com/v1/okx/historyCandles?instId=BTC-USDT&bar=1D" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/historyCandles?instId=BTC-USDT&bar=1D", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/historyCandles?instId=BTC-USDT&bar=1D", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "close": "…", "confirmed": false, "high": "…", "low": "…", "open": "…", "openedAt": "2026-11-06T09:41:00Z", "volume": "…", "volumeQuote": "…" } ], "meta": { "cached": false, "endpoint": "historyCandles", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
instruments
/v1/okx/instrumentsInstruments of one product line: their base, quote and settlement currencies, contract sizes, tick and lot sizes and state.
Parameters
instTypestring | Product line.SPOTMARGINSWAPFUTURESOPTIONdefault SWAPe.g. SWAP |
symbolstring | One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line. e.g. BTC-USDT-SWAP |
instFamilystring | Contract family, for FUTURES and OPTION. |
ulystring | Underlying, for FUTURES and OPTION, such as BTC-USD. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
17 fields
baseCcy | string |
ctMult | string |
ctType | string |
ctVal | string |
ctValCcy | string |
expiresAt | string |
instFamily | string |
instId | string |
instType | string |
listedAt | string |
lotSize | string |
minSize | string |
quoteCcy | string |
settleCcy | string |
state | string |
tickSize | string |
underlying | string |
curl "https://api.hoshime.com/v1/okx/instruments?instType=SWAP&symbol=BTC-USDT-SWAP" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/instruments?instType=SWAP&symbol=BTC-USDT-SWAP", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/instruments?instType=SWAP&symbol=BTC-USDT-SWAP", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "baseCcy": "…", "ctMult": "…", "ctType": "…", "ctVal": "…", "ctValCcy": "…", "expiresAt": "2026-11-06T09:41:00Z", "instFamily": "…", "instId": "abc123", "instType": "…", "listedAt": "2026-11-06T09:41:00Z", "lotSize": "…", "minSize": "…", "quoteCcy": "…", "settleCcy": "…", "state": "…", "tickSize": "…", "underlying": "…" } ], "meta": { "cached": false, "endpoint": "instruments", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
markPrice
/v1/okx/markPriceMark price of one instrument, or of every instrument of a product line when no symbol is given.
Parameters
instTypestring | Product line.MARGINSWAPFUTURESOPTIONdefault SWAPe.g. SWAP |
symbolstring | One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line. e.g. BTC-USDT-SWAP |
instFamilystring | Contract family, for FUTURES and OPTION. |
ulystring | Underlying, for FUTURES and OPTION. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
4 fields
instId | string |
instType | string |
markPrice | string |
updatedAt | string |
curl "https://api.hoshime.com/v1/okx/markPrice?instType=SWAP&symbol=BTC-USDT-SWAP" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/markPrice?instType=SWAP&symbol=BTC-USDT-SWAP", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/markPrice?instType=SWAP&symbol=BTC-USDT-SWAP", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "instId": "abc123", "instType": "…", "markPrice": "…", "updatedAt": "2026-11-06T09:41:00Z" } ], "meta": { "cached": false, "endpoint": "markPrice", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
openInterest
/v1/okx/openInterestOpen interest of one derivative instrument, or of every instrument of a product line when no symbol is given.
Parameters
instTypestring | Product line. Open interest is published for derivatives only.SWAPFUTURESOPTIONdefault SWAPe.g. SWAP |
symbolstring | One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line. e.g. BTC-USDT-SWAP |
instFamilystring | Contract family, for FUTURES and OPTION. |
ulystring | Underlying, for FUTURES and OPTION. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
6 fields
instId | string |
instType | string |
oi | string |
oiCcy | string |
oiUsd | string |
updatedAt | string |
curl "https://api.hoshime.com/v1/okx/openInterest?instType=SWAP&symbol=BTC-USDT-SWAP" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/openInterest?instType=SWAP&symbol=BTC-USDT-SWAP", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/openInterest?instType=SWAP&symbol=BTC-USDT-SWAP", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "instId": "abc123", "instType": "…", "oi": "…", "oiCcy": "…", "oiUsd": "…", "updatedAt": "2026-11-06T09:41:00Z" } ], "meta": { "cached": false, "endpoint": "openInterest", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
priceLimit
/v1/okx/priceLimitHighest buy price and lowest sell price OKX accepts for one instrument right now.
Parameters
symbolstring required | Instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. e.g. BTC-USDT-SWAP |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
5 fields
buyLimit | string |
enabled | boolean |
instId | string |
sellLimit | string |
updatedAt | string |
curl "https://api.hoshime.com/v1/okx/priceLimit?symbol=BTC-USDT-SWAP" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/priceLimit?symbol=BTC-USDT-SWAP", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/priceLimit?symbol=BTC-USDT-SWAP", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": { "buyLimit": "…", "enabled": false, "instId": "abc123", "sellLimit": "…", "updatedAt": "2026-11-06T09:41:00Z" }, "meta": { "cached": false, "endpoint": "priceLimit", "fetchedAt": "2026-11-06T09:41:00Z", "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
longShortRatio
/v1/okx/longShortRatioLong/short account ratio of one coin across OKX, as a time series, newest first.
Parameters
currencystring | Coin the series is measured in, such as BTC or ETH. default BTCe.g. BTC |
periodstring | Sampling interval.5m1H1Ddefault 1H |
startstring | Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
endstring | Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
2 fields
ratio | string |
startedAt | string |
curl "https://api.hoshime.com/v1/okx/longShortRatio?currency=BTC" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/longShortRatio?currency=BTC", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/longShortRatio?currency=BTC", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "ratio": "…", "startedAt": "2026-11-06T09:41:00Z" } ], "meta": { "cached": false, "endpoint": "longShortRatio", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
openInterestVolume
/v1/okx/openInterestVolumeOpen interest and trading volume of one coin across OKX, as a time series, newest first.
Parameters
currencystring | Coin the series is measured in, such as BTC or ETH. default BTCe.g. BTC |
periodstring | Sampling interval.5m1H1Ddefault 1H |
startstring | Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
endstring | Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
3 fields
openInterest | string |
startedAt | string |
volume | string |
curl "https://api.hoshime.com/v1/okx/openInterestVolume?currency=BTC" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/openInterestVolume?currency=BTC", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/openInterestVolume?currency=BTC", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "openInterest": "…", "startedAt": "2026-11-06T09:41:00Z", "volume": "…" } ], "meta": { "cached": false, "endpoint": "openInterestVolume", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
takerVolume
/v1/okx/takerVolumeTaker sell and buy volume of one coin on contracts or spot across OKX, as a time series, newest first.
Parameters
currencystring | Coin the series is measured in, such as BTC or ETH. default BTCe.g. BTC |
periodstring | Sampling interval.5m1H1Ddefault 1H |
startstring | Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
endstring | Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
instTypestring | Where the volume is measured.SPOTCONTRACTSdefault CONTRACTS |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
3 fields
buyVolume | string |
sellVolume | string |
startedAt | string |
curl "https://api.hoshime.com/v1/okx/takerVolume?currency=BTC" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/takerVolume?currency=BTC", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/takerVolume?currency=BTC", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "buyVolume": "…", "sellVolume": "…", "startedAt": "2026-11-06T09:41:00Z" } ], "meta": { "cached": false, "endpoint": "takerVolume", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
indexTickers
/v1/okx/indexTickersIndex prices and 24-hour statistics of OKX indices, for one quote currency or one index id.
Parameters
quoteCcystring | Quote currency such as USDT or USD. Give quoteCcy or instId. e.g. USDT |
instIdstring | Index id such as BTC-USD. Give quoteCcy or instId. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
8 fields
high24h | string |
indexPrice | string |
instId | string |
low24h | string |
open24h | string |
sodUtc0 | string |
sodUtc8 | string |
updatedAt | string |
curl "https://api.hoshime.com/v1/okx/indexTickers?quoteCcy=USDT" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/indexTickers?quoteCcy=USDT", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/indexTickers?quoteCcy=USDT", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "high24h": "…", "indexPrice": "…", "instId": "abc123", "low24h": "…", "open24h": "…", "sodUtc0": "…", "sodUtc8": "…", "updatedAt": "2026-11-06T09:41:00Z" } ], "meta": { "cached": false, "endpoint": "indexTickers", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
indexCandles
/v1/okx/indexCandlesOHLC candles of one OKX index price, newest first. Page back with cursor.
Parameters
instIdstring required | Index id such as BTC-USD. e.g. BTC-USD |
barstring | Candle size.1m3m5m15m30m1H2H4H6H12H1D1W1Mdefault 1H |
limitinteger | Items per page, 1 to 300. default 100 |
cursorstring | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
8 fields
close | string |
confirmed | boolean |
high | string |
low | string |
open | string |
openedAt | string |
volume | string |
volumeQuote | string |
curl "https://api.hoshime.com/v1/okx/indexCandles?instId=BTC-USD" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/indexCandles?instId=BTC-USD", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/indexCandles?instId=BTC-USD", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "close": "…", "confirmed": false, "high": "…", "low": "…", "open": "…", "openedAt": "2026-11-06T09:41:00Z", "volume": "…", "volumeQuote": "…" } ], "meta": { "cached": false, "endpoint": "indexCandles", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
markPriceCandles
/v1/okx/markPriceCandlesOHLC candles of the mark price of one OKX instrument, newest first. Page back with cursor.
Parameters
instIdstring required | Instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. e.g. BTC-USDT-SWAP |
barstring | Candle size.1m3m5m15m30m1H2H4H6H12H1D1W1Mdefault 1H |
limitinteger | Items per page, 1 to 300. default 100 |
cursorstring | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
8 fields
close | string |
confirmed | boolean |
high | string |
low | string |
open | string |
openedAt | string |
volume | string |
volumeQuote | string |
curl "https://api.hoshime.com/v1/okx/markPriceCandles?instId=BTC-USDT-SWAP" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/markPriceCandles?instId=BTC-USDT-SWAP", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/markPriceCandles?instId=BTC-USDT-SWAP", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "close": "…", "confirmed": false, "high": "…", "low": "…", "open": "…", "openedAt": "2026-11-06T09:41:00Z", "volume": "…", "volumeQuote": "…" } ], "meta": { "cached": false, "endpoint": "markPriceCandles", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
platformVolume
/v1/okx/platformVolumeOKX trading volume of the last 24 hours across all its markets, in USD and CNY.
Parameters
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
3 fields
updatedAt | string |
volumeCny | string |
volumeUsd | string |
curl "https://api.hoshime.com/v1/okx/platformVolume" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/platformVolume", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/platformVolume", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": { "updatedAt": "2026-11-06T09:41:00Z", "volumeCny": "…", "volumeUsd": "…" }, "meta": { "cached": false, "endpoint": "platformVolume", "fetchedAt": "2026-11-06T09:41:00Z", "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }
optionSummary
/v1/okx/optionSummaryOption contracts of one OKX underlying with mark volatility, Greeks and forward price.
Parameters
ulystring required | Underlying such as BTC-USD. e.g. BTC-USD |
expTimestring | Expiry as YYMMDD, such as 261107. Omit for every expiry. |
tunnelstring | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
proxystring | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
profileIdstring | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |
Response data
9 fields
delta | string |
forwardPrice | string |
gamma | string |
instId | string |
markVol | string |
theta | string |
underlying | string |
updatedAt | string |
vega | string |
curl "https://api.hoshime.com/v1/okx/optionSummary?uly=BTC-USD" \ -H "Authorization: Bearer $HOSHIME_TOKEN"
const res = await fetch("https://api.hoshime.com/v1/okx/optionSummary?uly=BTC-USD", { headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}`, }, }); const { data, meta } = await res.json();
import os, requests res = requests.get( "https://api.hoshime.com/v1/okx/optionSummary?uly=BTC-USD", headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"}, ) body = res.json()
{ "data": [ { "delta": "…", "forwardPrice": "…", "gamma": "…", "instId": "abc123", "markVol": "…", "theta": "…", "underlying": "…", "updatedAt": "2026-11-06T09:41:00Z", "vega": "…" } ], "meta": { "cached": false, "endpoint": "optionSummary", "fetchedAt": "2026-11-06T09:41:00Z", "pagination": { "nextCursor": "EpcDEgV…", "hasMore": true, "total": null }, "platform": "okx", "requestId": "req_2Xb9kQ…", "units": 1 } }