# OKX API

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

Category: Finance & Crypto. Region: Global. 20 endpoints at `https://api.hoshime.com/v1/okx/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/okx
## GET /v1/okx/ticker

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

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Instrument id such as BTC-USDT, or an okx.com trade URL. (e.g. BTC-USDT) |
| `tunnel` | string | no | 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 | no | 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 | no | 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 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)

```bash
curl "https://api.hoshime.com/v1/okx/ticker?instId=BTC-USDT" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/tickers

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

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instType` | string | yes | Instrument type. (one of SPOT, SWAP, FUTURES, OPTION; e.g. SPOT) |
| `tunnel` | string | no | 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 | no | 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 | no | 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 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)

```bash
curl "https://api.hoshime.com/v1/okx/tickers?instType=SPOT" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/candles

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

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Instrument id such as BTC-USDT, or an okx.com trade URL. (e.g. BTC-USDT) |
| `bar` | string | no | Candle size. (one of 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 1W, 1M; default 1H) |
| `limit` | integer | no | Items per page, 1 to 300. (default 100) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `close` (string), `confirmed` (boolean), `high` (string), `low` (string), `open` (string), `openedAt` (string), `volume` (string), `volumeQuote` (string)

```bash
curl "https://api.hoshime.com/v1/okx/candles?instId=BTC-USDT" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/orderBook

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

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Instrument id such as BTC-USDT, or an okx.com trade URL. (e.g. BTC-USDT) |
| `depth` | integer | no | Price levels per side, from 1 to 400. (default 20) |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `asks` (Level[]), `asks[].orders` (integer (int64)), `asks[].price` (string), `asks[].size` (string), `bids` (Level[]), `bids[].orders` (integer (int64)), `bids[].price` (string), `bids[].size` (string), `sequence` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/orderBook?instId=BTC-USDT" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/trades

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

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Instrument id such as BTC-USDT, or an okx.com trade URL. (e.g. BTC-USDT) |
| `limit` | integer | no | Items per page, 1 to 500. (default 100) |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `id` (string), `instId` (string), `price` (string), `side` (string), `size` (string), `tradedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/trades?instId=BTC-USDT" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/fundingRate

Current and next funding rate of one OKX perpetual swap.

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Swap instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. (e.g. BTC-USDT-SWAP) |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `fundingAt` (string), `fundingRate` (string), `instId` (string), `maxFundingRate` (string), `minFundingRate` (string), `nextFundingAt` (string), `nextFundingRate` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/fundingRate?instId=BTC-USDT-SWAP" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/fundingRateHistory

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

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Swap instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. (e.g. BTC-USDT-SWAP) |
| `limit` | integer | no | Items per page, 1 to 100. (default 100) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `formulaType` (string), `fundingRate` (string), `instId` (string), `method` (string), `realizedRate` (string), `settledAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/fundingRateHistory?instId=BTC-USDT-SWAP" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/historyCandles

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

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Instrument id such as BTC-USDT, or an okx.com trade URL. (e.g. BTC-USDT) |
| `bar` | string | no | Candle size. (one of 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 1W, 1M, 3M; default 1H; e.g. 1D) |
| `limit` | integer | no | Items per page, 1 to 300. (default 100) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `close` (string), `confirmed` (boolean), `high` (string), `low` (string), `open` (string), `openedAt` (string), `volume` (string), `volumeQuote` (string)

```bash
curl "https://api.hoshime.com/v1/okx/historyCandles?instId=BTC-USDT&bar=1D" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## 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:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instType` | string | no | Product line. (one of SPOT, MARGIN, SWAP, FUTURES, OPTION; default SWAP; e.g. SWAP) |
| `symbol` | string | no | One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line. (e.g. BTC-USDT-SWAP) |
| `instFamily` | string | no | Contract family, for FUTURES and OPTION. |
| `uly` | string | no | Underlying, for FUTURES and OPTION, such as BTC-USD. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 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)

```bash
curl "https://api.hoshime.com/v1/okx/instruments?instType=SWAP&symbol=BTC-USDT-SWAP" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/markPrice

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

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instType` | string | no | Product line. (one of MARGIN, SWAP, FUTURES, OPTION; default SWAP; e.g. SWAP) |
| `symbol` | string | no | One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line. (e.g. BTC-USDT-SWAP) |
| `instFamily` | string | no | Contract family, for FUTURES and OPTION. |
| `uly` | string | no | Underlying, for FUTURES and OPTION. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `instId` (string), `instType` (string), `markPrice` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/markPrice?instType=SWAP&symbol=BTC-USDT-SWAP" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## 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:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instType` | string | no | Product line. Open interest is published for derivatives only. (one of SWAP, FUTURES, OPTION; default SWAP; e.g. SWAP) |
| `symbol` | string | no | One instrument id, such as BTC-USDT-SWAP. Omit it to list the whole line. (e.g. BTC-USDT-SWAP) |
| `instFamily` | string | no | Contract family, for FUTURES and OPTION. |
| `uly` | string | no | Underlying, for FUTURES and OPTION. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `instId` (string), `instType` (string), `oi` (string), `oiCcy` (string), `oiUsd` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/openInterest?instType=SWAP&symbol=BTC-USDT-SWAP" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/priceLimit

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

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `symbol` | string | yes | Instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. (e.g. BTC-USDT-SWAP) |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `buyLimit` (string), `enabled` (boolean), `instId` (string), `sellLimit` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/priceLimit?symbol=BTC-USDT-SWAP" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/longShortRatio

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

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `currency` | string | no | Coin the series is measured in, such as BTC or ETH. (default BTC; e.g. BTC) |
| `period` | string | no | Sampling interval. (one of 5m, 1H, 1D; default 1H) |
| `start` | string | no | Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
| `end` | string | no | Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `ratio` (string), `startedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/longShortRatio?currency=BTC" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/openInterestVolume

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

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `currency` | string | no | Coin the series is measured in, such as BTC or ETH. (default BTC; e.g. BTC) |
| `period` | string | no | Sampling interval. (one of 5m, 1H, 1D; default 1H) |
| `start` | string | no | Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
| `end` | string | no | Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `openInterest` (string), `startedAt` (string), `volume` (string)

```bash
curl "https://api.hoshime.com/v1/okx/openInterestVolume?currency=BTC" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## 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:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `currency` | string | no | Coin the series is measured in, such as BTC or ETH. (default BTC; e.g. BTC) |
| `period` | string | no | Sampling interval. (one of 5m, 1H, 1D; default 1H) |
| `start` | string | no | Oldest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
| `end` | string | no | Newest point to include: epoch milliseconds or seconds, an RFC 3339 time or a date. |
| `instType` | string | no | Where the volume is measured. (one of SPOT, CONTRACTS; default CONTRACTS) |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `buyVolume` (string), `sellVolume` (string), `startedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/takerVolume?currency=BTC" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/indexTickers

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

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `quoteCcy` | string | no | Quote currency such as USDT or USD. Give quoteCcy or instId. (e.g. USDT) |
| `instId` | string | no | Index id such as BTC-USD. Give quoteCcy or instId. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `high24h` (string), `indexPrice` (string), `instId` (string), `low24h` (string), `open24h` (string), `sodUtc0` (string), `sodUtc8` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/okx/indexTickers?quoteCcy=USDT" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/indexCandles

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

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Index id such as BTC-USD. (e.g. BTC-USD) |
| `bar` | string | no | Candle size. (one of 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 1W, 1M; default 1H) |
| `limit` | integer | no | Items per page, 1 to 300. (default 100) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `close` (string), `confirmed` (boolean), `high` (string), `low` (string), `open` (string), `openedAt` (string), `volume` (string), `volumeQuote` (string)

```bash
curl "https://api.hoshime.com/v1/okx/indexCandles?instId=BTC-USD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/markPriceCandles

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

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instId` | string | yes | Instrument id such as BTC-USDT-SWAP, or an okx.com trade URL. (e.g. BTC-USDT-SWAP) |
| `bar` | string | no | Candle size. (one of 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 1W, 1M; default 1H) |
| `limit` | integer | no | Items per page, 1 to 300. (default 100) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `close` (string), `confirmed` (boolean), `high` (string), `low` (string), `open` (string), `openedAt` (string), `volume` (string), `volumeQuote` (string)

```bash
curl "https://api.hoshime.com/v1/okx/markPriceCandles?instId=BTC-USDT-SWAP" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/platformVolume

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

Scope: `social:read` · Units: 1 · Cached: 1 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `updatedAt` (string), `volumeCny` (string), `volumeUsd` (string)

```bash
curl "https://api.hoshime.com/v1/okx/platformVolume" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/okx/optionSummary

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

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `uly` | string | yes | Underlying such as BTC-USD. (e.g. BTC-USD) |
| `expTime` | string | no | Expiry as YYMMDD, such as 261107. Omit for every expiry. |
| `tunnel` | string | no | 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 | no | 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 | no | 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 fields: `delta` (string), `forwardPrice` (string), `gamma` (string), `instId` (string), `markVol` (string), `theta` (string), `underlying` (string), `updatedAt` (string), `vega` (string)

```bash
curl "https://api.hoshime.com/v1/okx/optionSummary?uly=BTC-USD" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
