Skip to content

OKX API

20 endpointsFinance & CryptoGlobalsocial:read

Spot, swap, futures and options prices, candles, order book, trades, funding rates, open interest and options greeks from OKX.

View as Markdown
GET/okx/tickerLast price, best bid and ask and 24-hour statistics of one OKX instrument.
GET/okx/tickersTicker of every OKX instrument of one type: SPOT, SWAP, FUTURES or OPTION.
GET/okx/candlesOHLCV candles of one OKX instrument, newest first. Page back with cursor.
GET/okx/orderBookOrder book of one OKX instrument: the best bids and asks, up to size levels each.
GET/okx/tradesMost recent public trades of one OKX instrument, newest first.
GET/okx/fundingRateCurrent and next funding rate of one OKX perpetual swap.
GET/okx/fundingRateHistoryFunding settlements of one OKX perpetual swap, newest first. Page back with cursor.
GET/okx/historyCandlesOHLCV candles of one OKX instrument from the history, older than the newest page. Page back with cursor.
GET/okx/instrumentsInstruments of one product line: their base, quote and settlement currencies, contract sizes, tick and lot sizes and state.
GET/okx/markPriceMark price of one instrument, or of every instrument of a product line when no symbol is given.
GET/okx/openInterestOpen interest of one derivative instrument, or of every instrument of a product line when no symbol is given.
GET/okx/priceLimitHighest buy price and lowest sell price OKX accepts for one instrument right now.
GET/okx/longShortRatioLong/short account ratio of one coin across OKX, as a time series, newest first.
GET/okx/openInterestVolumeOpen interest and trading volume of one coin across OKX, as a time series, newest first.
GET/okx/takerVolumeTaker sell and buy volume of one coin on contracts or spot across OKX, as a time series, newest first.
GET/okx/indexTickersIndex prices and 24-hour statistics of OKX indices, for one quote currency or one index id.
GET/okx/indexCandlesOHLC candles of one OKX index price, newest first. Page back with cursor.
GET/okx/markPriceCandlesOHLC candles of the mark price of one OKX instrument, newest first. Page back with cursor.
GET/okx/platformVolumeOKX trading volume of the last 24 hours across all its markets, in USD and CNY.
GET/okx/optionSummaryOption contracts of one OKX underlying with mark volatility, Greeks and forward price.

ticker

GET/v1/okx/ticker

Last price, best bid and ask and 24-hour statistics of one OKX instrument.

scope social:read1 unit

Parameters

instId
string
required
Instrument id such as BTC-USDT, or an okx.com trade URL.
e.g. BTC-USDT
tunnel
string
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.
proxy
string
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.
profileId
string
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
askPricestring
askSizestring
bidPricestring
bidSizestring
changestring
changePercentstring
highstring
instTypestring
lastSizestring
lowstring
openstring
pricestring
symbolstring
updatedAtstring
volumestring
volumeQuote24hstring
curl "https://api.hoshime.com/v1/okx/ticker?instId=BTC-USDT" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/tickers

Ticker of every OKX instrument of one type: SPOT, SWAP, FUTURES or OPTION.

scope social:read1 unitpaginated

Parameters

instType
string
required
Instrument type.
SPOTSWAPFUTURESOPTION
e.g. SPOT
tunnel
string
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.
proxy
string
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.
profileId
string
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
askPricestring
askSizestring
bidPricestring
bidSizestring
changestring
changePercentstring
highstring
instTypestring
lastSizestring
lowstring
openstring
pricestring
symbolstring
updatedAtstring
volumestring
volumeQuote24hstring
curl "https://api.hoshime.com/v1/okx/tickers?instType=SPOT" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/candles

OHLCV candles of one OKX instrument, newest first. Page back with cursor.

scope social:read1 unitcached 1 minpaginated

Parameters

instId
string
required
Instrument id such as BTC-USDT, or an okx.com trade URL.
e.g. BTC-USDT
bar
string
Candle size.
1m3m5m15m30m1H2H4H6H12H1D1W1M
default 1H
limit
integer
Items per page, 1 to 300.
default 100
cursor
string
meta.pagination.nextCursor of the previous page. Omit it for the first page.
tunnel
string
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.
proxy
string
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.
profileId
string
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
closestring
confirmedboolean
highstring
lowstring
openstring
openedAtstring
volumestring
volumeQuotestring
curl "https://api.hoshime.com/v1/okx/candles?instId=BTC-USDT" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/orderBook

Order book of one OKX instrument: the best bids and asks, up to size levels each.

scope social:read1 unit

Parameters

instId
string
required
Instrument id such as BTC-USDT, or an okx.com trade URL.
e.g. BTC-USDT
depth
integer
Price levels per side, from 1 to 400.
default 20
tunnel
string
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.
proxy
string
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.
profileId
string
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
asksLevel[]
ordersinteger (int64)
pricestring
sizestring
bidsLevel[]
ordersinteger (int64)
pricestring
sizestring
sequencestring
updatedAtstring
curl "https://api.hoshime.com/v1/okx/orderBook?instId=BTC-USDT" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/trades

Most recent public trades of one OKX instrument, newest first.

scope social:read1 unitpaginated

Parameters

instId
string
required
Instrument id such as BTC-USDT, or an okx.com trade URL.
e.g. BTC-USDT
limit
integer
Items per page, 1 to 500.
default 100
tunnel
string
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.
proxy
string
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.
profileId
string
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
idstring
instIdstring
pricestring
sidestring
sizestring
tradedAtstring
curl "https://api.hoshime.com/v1/okx/trades?instId=BTC-USDT" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/fundingRate

Current and next funding rate of one OKX perpetual swap.

scope social:read1 unitcached 5 min

Parameters

instId
string
required
Swap instrument id such as BTC-USDT-SWAP, or an okx.com trade URL.
e.g. BTC-USDT-SWAP
tunnel
string
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.
proxy
string
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.
profileId
string
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
fundingAtstring
fundingRatestring
instIdstring
maxFundingRatestring
minFundingRatestring
nextFundingAtstring
nextFundingRatestring
updatedAtstring
curl "https://api.hoshime.com/v1/okx/fundingRate?instId=BTC-USDT-SWAP" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/fundingRateHistory

Funding settlements of one OKX perpetual swap, newest first. Page back with cursor.

scope social:read1 unitcached 10 minpaginated

Parameters

instId
string
required
Swap instrument id such as BTC-USDT-SWAP, or an okx.com trade URL.
e.g. BTC-USDT-SWAP
limit
integer
Items per page, 1 to 100.
default 100
cursor
string
meta.pagination.nextCursor of the previous page. Omit it for the first page.
tunnel
string
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.
proxy
string
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.
profileId
string
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
formulaTypestring
fundingRatestring
instIdstring
methodstring
realizedRatestring
settledAtstring
curl "https://api.hoshime.com/v1/okx/fundingRateHistory?instId=BTC-USDT-SWAP" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/historyCandles

OHLCV candles of one OKX instrument from the history, older than the newest page. Page back with cursor.

scope social:read1 unitcached 1 hpaginated

Parameters

instId
string
required
Instrument id such as BTC-USDT, or an okx.com trade URL.
e.g. BTC-USDT
bar
string
Candle size.
1m3m5m15m30m1H2H4H6H12H1D1W1M3M
default 1He.g. 1D
limit
integer
Items per page, 1 to 300.
default 100
cursor
string
meta.pagination.nextCursor of the previous page. Omit it for the first page.
tunnel
string
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.
proxy
string
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.
profileId
string
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
closestring
confirmedboolean
highstring
lowstring
openstring
openedAtstring
volumestring
volumeQuotestring
curl "https://api.hoshime.com/v1/okx/historyCandles?instId=BTC-USDT&bar=1D" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/instruments

Instruments of one product line: their base, quote and settlement currencies, contract sizes, tick and lot sizes and state.

scope social:read1 unitcached 1 hpaginated

Parameters

instType
string
Product line.
SPOTMARGINSWAPFUTURESOPTION
default SWAPe.g. SWAP
symbol
string
One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line.
e.g. BTC-USDT-SWAP
instFamily
string
Contract family, for FUTURES and OPTION.
uly
string
Underlying, for FUTURES and OPTION, such as BTC-USD.
tunnel
string
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.
proxy
string
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.
profileId
string
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
baseCcystring
ctMultstring
ctTypestring
ctValstring
ctValCcystring
expiresAtstring
instFamilystring
instIdstring
instTypestring
listedAtstring
lotSizestring
minSizestring
quoteCcystring
settleCcystring
statestring
tickSizestring
underlyingstring
curl "https://api.hoshime.com/v1/okx/instruments?instType=SWAP&symbol=BTC-USDT-SWAP" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/markPrice

Mark price of one instrument, or of every instrument of a product line when no symbol is given.

scope social:read1 unitpaginated

Parameters

instType
string
Product line.
MARGINSWAPFUTURESOPTION
default SWAPe.g. SWAP
symbol
string
One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line.
e.g. BTC-USDT-SWAP
instFamily
string
Contract family, for FUTURES and OPTION.
uly
string
Underlying, for FUTURES and OPTION.
tunnel
string
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.
proxy
string
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.
profileId
string
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
instIdstring
instTypestring
markPricestring
updatedAtstring
curl "https://api.hoshime.com/v1/okx/markPrice?instType=SWAP&symbol=BTC-USDT-SWAP" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/openInterest

Open interest of one derivative instrument, or of every instrument of a product line when no symbol is given.

scope social:read1 unitpaginated

Parameters

instType
string
Product line. Open interest is published for derivatives only.
SWAPFUTURESOPTION
default SWAPe.g. SWAP
symbol
string
One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line.
e.g. BTC-USDT-SWAP
instFamily
string
Contract family, for FUTURES and OPTION.
uly
string
Underlying, for FUTURES and OPTION.
tunnel
string
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.
proxy
string
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.
profileId
string
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
instIdstring
instTypestring
oistring
oiCcystring
oiUsdstring
updatedAtstring
curl "https://api.hoshime.com/v1/okx/openInterest?instType=SWAP&symbol=BTC-USDT-SWAP" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/priceLimit

Highest buy price and lowest sell price OKX accepts for one instrument right now.

scope social:read1 unit

Parameters

symbol
string
required
Instrument id such as BTC-USDT-SWAP, or an okx.com trade URL.
e.g. BTC-USDT-SWAP
tunnel
string
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.
proxy
string
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.
profileId
string
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
buyLimitstring
enabledboolean
instIdstring
sellLimitstring
updatedAtstring
curl "https://api.hoshime.com/v1/okx/priceLimit?symbol=BTC-USDT-SWAP" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/longShortRatio

Long/short account ratio of one coin across OKX, as a time series, newest first.

scope social:read1 unitcached 5 minpaginated

Parameters

currency
string
Coin the series is measured in, such as BTC or ETH.
default BTCe.g. BTC
period
string
Sampling interval.
5m1H1D
default 1H
start
string
Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date.
end
string
Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date.
tunnel
string
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.
proxy
string
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.
profileId
string
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
ratiostring
startedAtstring
curl "https://api.hoshime.com/v1/okx/longShortRatio?currency=BTC" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/openInterestVolume

Open interest and trading volume of one coin across OKX, as a time series, newest first.

scope social:read1 unitcached 5 minpaginated

Parameters

currency
string
Coin the series is measured in, such as BTC or ETH.
default BTCe.g. BTC
period
string
Sampling interval.
5m1H1D
default 1H
start
string
Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date.
end
string
Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date.
tunnel
string
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.
proxy
string
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.
profileId
string
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
openIntereststring
startedAtstring
volumestring
curl "https://api.hoshime.com/v1/okx/openInterestVolume?currency=BTC" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/takerVolume

Taker sell and buy volume of one coin on contracts or spot across OKX, as a time series, newest first.

scope social:read1 unitcached 5 minpaginated

Parameters

currency
string
Coin the series is measured in, such as BTC or ETH.
default BTCe.g. BTC
period
string
Sampling interval.
5m1H1D
default 1H
start
string
Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date.
end
string
Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date.
instType
string
Where the volume is measured.
SPOTCONTRACTS
default CONTRACTS
tunnel
string
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.
proxy
string
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.
profileId
string
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
buyVolumestring
sellVolumestring
startedAtstring
curl "https://api.hoshime.com/v1/okx/takerVolume?currency=BTC" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/indexTickers

Index prices and 24-hour statistics of OKX indices, for one quote currency or one index id.

scope social:read1 unitpaginated

Parameters

quoteCcy
string
Quote currency such as USDT or USD. Give quoteCcy or instId.
e.g. USDT
instId
string
Index id such as BTC-USD. Give quoteCcy or instId.
tunnel
string
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.
proxy
string
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.
profileId
string
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
high24hstring
indexPricestring
instIdstring
low24hstring
open24hstring
sodUtc0string
sodUtc8string
updatedAtstring
curl "https://api.hoshime.com/v1/okx/indexTickers?quoteCcy=USDT" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/indexCandles

OHLC candles of one OKX index price, newest first. Page back with cursor.

scope social:read1 unitcached 1 minpaginated

Parameters

instId
string
required
Index id such as BTC-USD.
e.g. BTC-USD
bar
string
Candle size.
1m3m5m15m30m1H2H4H6H12H1D1W1M
default 1H
limit
integer
Items per page, 1 to 300.
default 100
cursor
string
meta.pagination.nextCursor of the previous page. Omit it for the first page.
tunnel
string
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.
proxy
string
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.
profileId
string
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
closestring
confirmedboolean
highstring
lowstring
openstring
openedAtstring
volumestring
volumeQuotestring
curl "https://api.hoshime.com/v1/okx/indexCandles?instId=BTC-USD" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/markPriceCandles

OHLC candles of the mark price of one OKX instrument, newest first. Page back with cursor.

scope social:read1 unitcached 1 minpaginated

Parameters

instId
string
required
Instrument id such as BTC-USDT-SWAP, or an okx.com trade URL.
e.g. BTC-USDT-SWAP
bar
string
Candle size.
1m3m5m15m30m1H2H4H6H12H1D1W1M
default 1H
limit
integer
Items per page, 1 to 300.
default 100
cursor
string
meta.pagination.nextCursor of the previous page. Omit it for the first page.
tunnel
string
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.
proxy
string
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.
profileId
string
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
closestring
confirmedboolean
highstring
lowstring
openstring
openedAtstring
volumestring
volumeQuotestring
curl "https://api.hoshime.com/v1/okx/markPriceCandles?instId=BTC-USDT-SWAP" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/platformVolume

OKX trading volume of the last 24 hours across all its markets, in USD and CNY.

scope social:read1 unitcached 1 min

Parameters

tunnel
string
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.
proxy
string
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.
profileId
string
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
updatedAtstring
volumeCnystring
volumeUsdstring
curl "https://api.hoshime.com/v1/okx/platformVolume" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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

GET/v1/okx/optionSummary

Option contracts of one OKX underlying with mark volatility, Greeks and forward price.

scope social:read1 unitpaginated

Parameters

uly
string
required
Underlying such as BTC-USD.
e.g. BTC-USD
expTime
string
Expiry as YYMMDD, such as 261107. Omit for every expiry.
tunnel
string
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.
proxy
string
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.
profileId
string
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
deltastring
forwardPricestring
gammastring
instIdstring
markVolstring
thetastring
underlyingstring
updatedAtstring
vegastring
curl "https://api.hoshime.com/v1/okx/optionSummary?uly=BTC-USD" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "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
  }
}
esc
↑↓ move↵ open