zapi.
APIsPricingDocsMCP
APIsPricingDocsMCPSign in
zapi.
APIsPricingDocsMCP
APIsPricingDocsMCPSign in
On this page
  • Playground
  • Code examples
  • Full reference
  • Related APIs
Finance/OKX
Logo OKX

OKX

OKX v5 public market data: candles with archive fallback, order books, funding, open interest and the rubik analytics series.

Endpoints
15
Requests
315
Updated
7 hours ago
For LLMs
llms.txt
Endpoint health3 hours ago
  • bookspassing, 0.4s
  • candlespassing, 0.1s
  • funding-rate-historypassing, 0.1s
  • funding-ratepassing, 0.1s
  • history-candlespassing, 0.1s
+ 10 more endpointsShow less
  • instrumentspassing, 0.1s
  • long-short-ratiopassing, 0.1s
  • mark-pricepassing, 0.1s
  • open-interest-volumepassing, 0.3s
  • open-interestpassing, 0.1s
  • price-limitpassing, 0.1s
  • taker-volumepassing, 0.3s
  • tickerpassing, 0.1s
  • tickerspassing, 0.1s
  • tradespassing, 0.1s
15/15 passingdaily 01:00 WIB

Playground

15 endpoints
GET/v1/finance:okx/booksno cache2 paramschecking key…
Parameters
symbolstringrequired

Instrument ID, OKX's own form

countnumber

Levels per side. Default 20, max 400

·
Response
EXAMPLE
{
  "asks": [
    {
      "size": 116.79,
      "price": 71647.1,
      "orderCount": 15
    },
    {
      "size": 0.01,
      "price": 71647.4,
      "orderCount": 1
    },
    {
      "size": 0.01,
      "price": 71647.7,
      "orderCount": 1
    },
    {
      "size": 0.02,
      "price": 71647.8,
      "orderCount": 1
    },
    {
      "size": 0.32,
      "price": 71647.9,
      "orderCount": 2
    },
    {
      "size": 27.64,
      "price": 71648,
      "orderCount": 10
    }
  ],
  "bids": [
    {
      "size": 245.55,
      "price": 71647,
      "orderCount": 24
    },
    {
      "size": 0.01,
      "price": 71645.3,
      "orderCount": 1
    },
    {
      "size": 0.01,
      "price": 71645,
      "orderCount": 1
    },
    {
      "size": 2.8,
      "price": 71644.9,
      "orderCount": 2
    },
    {
      "size": 66.24,
      "price": 71644.8,
      "orderCount": 4
    },
    {
      "size": 17.47,
      "price": 71644.7,
      "orderCount": 2
    }
  ],
  "date": "2026-08-20T14:57:49.556Z",
  "time": 1787237869556,
  "symbol": "BTC-USDT-SWAP",
  "dataset": "books",
  "askCount": 20,
  "bidCount": 20,
  "provider": "okx",
  "sequence": 334874037257
}

Code examples

Books
zpi-sdkrecommended
// npm i zpi-sdk
import { ZpiClient } from "zpi-sdk";

const client = new ZpiClient({ apiKey: "zpi_xxxxxxxxxxxxxxxxxxxxxxxx" });

const data = await client.run("finance:okx", "books", {
  "symbol": "BTC-USDT-SWAP",
  "count": 20
});
console.log(data);
Full SDK reference →
request.sh
curl -X GET "https://api.zpi.web.id/v1/finance:okx/books?symbol=BTC-USDT-SWAP&count=20" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Full reference

15 endpoints · plain text
GETBooks/v1/finance:okx/booksOrder-book snapshot for one OKX instrument.

Parameters

symbolstringrequired
Instrument ID, OKX's own form
countnumberoptional
Levels per side. Default 20, max 400

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/books?symbol=BTC-USDT-SWAP&count=20" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "asks": [
    {
      "size": 116.79,
      "price": 71647.1,
      "orderCount": 15
    },
    {
      "size": 0.01,
      "price": 71647.4,
      "orderCount": 1
    },
    {
      "size": 0.01,
      "price": 71647.7,
      "orderCount": 1
    },
    {
      "size": 0.02,
      "price": 71647.8,
      "orderCount": 1
    },
    {
      "size": 0.32,
      "price": 71647.9,
      "orderCount": 2
    },
    {
      "size": 27.64,
      "price": 71648,
      "orderCount": 10
    }
  ],
  "bids": [
    {
      "size": 245.55,
      "price": 71647,
      "orderCount": 24
    },
    {
      "size": 0.01,
      "price": 71645.3,
      "orderCount": 1
    },
    {
      "size": 0.01,
      "price": 71645,
      "orderCount": 1
    },
    {
      "size": 2.8,
      "price": 71644.9,
      "orderCount": 2
    },
    {
      "size": 66.24,
      "price": 71644.8,
      "orderCount": 4
    },
    {
      "size": 17.47,
      "price": 71644.7,
      "orderCount": 2
    }
  ],
  "date": "2026-08-20T14:57:49.556Z",
  "time": 1787237869556,
  "symbol": "BTC-USDT-SWAP",
  "dataset": "books",
  "askCount": 20,
  "bidCount": 20,
  "provider": "okx",
  "sequence": 334874037257
}
GETCandles/v1/finance:okx/candlesOHLCV candles for one OKX instrument, with the live-window trap guarded.

Parameters

symbolstringrequired
Instrument ID, OKX's own form
barenumoptional
Candle size. The utc suffix moves the daily cut to 00:00 UTC. Default 5m Values: 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 2D, 3D, 1W, 1M, 3M, 6Hutc, 12Hutc, 1Dutc, 2Dutc, 3Dutc, 1Wutc, 1Mutc, 3Mutc.
endstringoptional
Return candles older than this. Epoch ms/s or ISO date
countnumberoptional
Candles per page. Default 100, max 300 — the exchange silently clamps anything higher
pagenumberoptional
Page number, walking backwards in time. Default 1, max 20

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/candles?symbol=BTC-USDT-SWAP&bar=5m&end=2026-08-14T00%3A00%3A00Z&count=100&page=1" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "bar": "5m",
  "page": 1,
  "count": 100,
  "items": [
    {
      "low": 63660.1,
      "date": "2026-08-13T15:40:00.000Z",
      "high": 63731.3,
      "open": 63678.2,
      "close": 63695.1,
      "volume": 14417.99,
      "isClosed": true,
      "openTime": 1786635600000,
      "closeTime": 1786635899999,
      "volumeQuote": 9183713.97058,
      "volumeCurrency": 144.1799
    },
    {
      "low": 63594.3,
      "date": "2026-08-13T15:45:00.000Z",
      "high": 63695.2,
      "open": 63695.1,
      "close": 63602.4,
      "volume": 19226.23,
      "isClosed": true,
      "openTime": 1786635900000,
      "closeTime": 1786636199999,
      "volumeQuote": 12234135.96111,
      "volumeCurrency": 192.2623
    },
    {
      "low": 63558.4,
      "date": "2026-08-13T15:50:00.000Z",
      "high": 63658.8,
      "open": 63602.4,
      "close": 63589.9,
      "volume": 26785.7,
      "isClosed": true,
      "openTime": 1786636200000,
      "closeTime": 1786636499999,
      "volumeQuote": 17034946.38627,
      "volumeCurrency": 267.857
    }
  ],
  "symbol": "BTC-USDT-SWAP",
  "dataset": "candles",
  "hasMore": true,
  "nextPage": 2,
  "provider": "okx",
  "fromArchive": true
}
GETFunding Rate History/v1/finance:okx/funding-rate-historySettled funding for one OKX perpetual.

Parameters

symbolstringrequired
Perpetual instrument ID
endstringoptional
Return settlements older than this. Epoch ms/s or ISO date
countnumberoptional
Settlements per page. Default 100, max 100
pagenumberoptional
Page number, walking backwards in time. Default 1, max 20

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/funding-rate-history?symbol=BTC-USDT-SWAP&end=2026-08-01T00%3A00%3A00Z&count=100&page=1" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "page": 1,
  "count": 100,
  "items": [
    {
      "date": "2026-06-28T16:00:00.000Z",
      "time": 1782662400000,
      "method": "current_period",
      "symbol": "BTC-USDT-SWAP",
      "formulaType": "withRate",
      "fundingRate": 0.0000395436281002,
      "realizedRate": 0.0000395436281002
    },
    {
      "date": "2026-06-29T00:00:00.000Z",
      "time": 1782691200000,
      "method": "current_period",
      "symbol": "BTC-USDT-SWAP",
      "formulaType": "withRate",
      "fundingRate": 0.0000046598340778,
      "realizedRate": 0.0000046598340778
    },
    {
      "date": "2026-06-29T08:00:00.000Z",
      "time": 1782720000000,
      "method": "current_period",
      "symbol": "BTC-USDT-SWAP",
      "formulaType": "withRate",
      "fundingRate": 0.0000503634854124,
      "realizedRate": 0.0000503634854124
    }
  ],
  "symbol": "BTC-USDT-SWAP",
  "dataset": "funding-rate-history",
  "hasMore": true,
  "nextPage": 2,
  "provider": "okx"
}
GETFunding Rate/v1/finance:okx/funding-rateCurrent and next funding for one OKX perpetual, with the rate caps.

Parameters

symbolstringrequired
Perpetual instrument ID

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/funding-rate?symbol=BTC-USDT-SWAP" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "date": "2026-08-20T14:58:05.180Z",
  "time": 1787237885180,
  "method": "current_period",
  "symbol": "BTC-USDT-SWAP",
  "dataset": "funding-rate",
  "premium": -0.0005606459980755,
  "instType": "SWAP",
  "provider": "okx",
  "formulaType": "withRate",
  "fundingDate": "2026-08-20T16:00:00.000Z",
  "fundingRate": 0.0000694968722686,
  "fundingTime": 1787241600000,
  "impactValue": 20000,
  "interestRate": 0.0001,
  "maxFundingRate": 0.00375,
  "minFundingRate": -0.00375,
  "nextFundingDate": "2026-08-21T00:00:00.000Z",
  "nextFundingRate": null,
  "nextFundingTime": 1787270400000,
  "settlementState": "settled",
  "settledFundingRate": 0.0001,
  "previousFundingDate": "2026-08-20T08:00:00.000Z",
  "previousFundingTime": 1787212800000
}
GETHistory Candles/v1/finance:okx/history-candlesThe OKX candle ARCHIVE — the real backfill, 300 bars per call.

Parameters

symbolstringrequired
Instrument ID, OKX's own form
barenumoptional
Candle size. The utc suffix moves the daily cut to 00:00 UTC. Default 5m Values: 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 2D, 3D, 1W, 1M, 3M, 6Hutc, 12Hutc, 1Dutc, 2Dutc, 3Dutc, 1Wutc, 1Mutc, 3Mutc.
endstringoptional
Return candles older than this. Epoch ms/s or ISO date
countnumberoptional
Candles per page. Default 100, max 300 — the exchange silently clamps anything higher
pagenumberoptional
Page number, walking backwards in time. Default 1, max 20

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/history-candles?symbol=BTC-USDT-SWAP&bar=5m&end=2020-06-01T00%3A00%3A00Z&count=100&page=1" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "bar": "5m",
  "page": 1,
  "count": 100,
  "items": [
    {
      "low": 9463,
      "date": "2020-05-31T15:40:00.000Z",
      "high": 9481.1,
      "open": 9477,
      "close": 9463.2,
      "volume": 10297,
      "isClosed": true,
      "openTime": 1590939600000,
      "closeTime": 1590939899999,
      "volumeQuote": 975559.58625,
      "volumeCurrency": 102.97
    },
    {
      "low": 9455.4,
      "date": "2020-05-31T15:45:00.000Z",
      "high": 9472.8,
      "open": 9463.1,
      "close": 9461.4,
      "volume": 9213,
      "isClosed": true,
      "openTime": 1590939900000,
      "closeTime": 1590940199999,
      "volumeQuote": 871856.6235,
      "volumeCurrency": 92.13
    },
    {
      "low": 9450.1,
      "date": "2020-05-31T15:50:00.000Z",
      "high": 9478.3,
      "open": 9461.3,
      "close": 9476.7,
      "volume": 11532,
      "isClosed": true,
      "openTime": 1590940200000,
      "closeTime": 1590940499999,
      "volumeQuote": 1091236.57275,
      "volumeCurrency": 115.32
    }
  ],
  "symbol": "BTC-USDT-SWAP",
  "dataset": "history-candles",
  "hasMore": true,
  "nextPage": 2,
  "provider": "okx"
}
GETInstruments/v1/finance:okx/instrumentsContract specifications for one OKX product line: tick, lot, leverage, expiry.

Parameters

instTypeenumoptional
Product line. Default SWAP Values: SPOT, MARGIN, SWAP, FUTURES, OPTION.
symbolstringoptional
One instrument ID. Omit to list the whole line
instFamilystringoptional
Contract family, for FUTURES and OPTION
ulystringoptional
Underlying, for FUTURES and OPTION

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/instruments?instType=SWAP&symbol=BTC-USDT-SWAP&instFamily=BTC-USDT&uly=BTC-USD" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 1,
  "items": [
    {
      "alias": null,
      "state": "live",
      "symbol": "BTC-USDT-SWAP",
      "lotSize": 0.01,
      "minSize": 0.01,
      "instType": "SWAP",
      "listDate": "2019-11-12T11:16:48.000Z",
      "listTime": 1573557408000,
      "ruleType": "normal",
      "tickSize": 0.1,
      "expiryDate": null,
      "expiryTime": null,
      "instFamily": "BTC-USDT",
      "optionType": null,
      "maxLeverage": 100,
      "strikePrice": null,
      "baseCurrency": null,
      "contractType": "linear",
      "maxLimitSize": 100000000,
      "contractValue": 0.01,
      "maxMarketSize": 35000,
      "quoteCurrency": null,
      "maxLimitAmount": 20000000,
      "settleCurrency": "USDT",
      "contractMultiplier": 1,
      "contractValueCurrency": "BTC"
    }
  ],
  "symbol": "BTC-USDT-SWAP",
  "dataset": "instruments",
  "instType": "SWAP",
  "provider": "okx"
}
GETLong Short Ratio/v1/finance:okx/long-short-ratioLong/short account ratio across an OKX coin.

Parameters

currencystringoptional
Coin the series is measured in. Default BTC
periodenumoptional
Sampling interval. Default 5m Values: 5m, 1H, 1D.
startstringoptional
Oldest point to include. Epoch ms/s or ISO date
endstringoptional
Newest point to include. Epoch ms/s or ISO date

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/long-short-ratio?currency=BTC&period=5m&start=2026-08-19T00%3A00%3A00Z&end=2026-08-20T00%3A00%3A00Z" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 289,
  "items": [
    {
      "date": "2026-08-19T00:00:00.000Z",
      "time": 1787097600000,
      "longShortRatio": 1.38
    },
    {
      "date": "2026-08-19T00:05:00.000Z",
      "time": 1787097900000,
      "longShortRatio": 1.38
    },
    {
      "date": "2026-08-19T00:10:00.000Z",
      "time": 1787098200000,
      "longShortRatio": 1.38
    },
    {
      "date": "2026-08-19T00:15:00.000Z",
      "time": 1787098500000,
      "longShortRatio": 1.35
    },
    {
      "date": "2026-08-19T00:20:00.000Z",
      "time": 1787098800000,
      "longShortRatio": 1.36
    },
    {
      "date": "2026-08-19T00:25:00.000Z",
      "time": 1787099100000,
      "longShortRatio": 1.36
    }
  ],
  "period": "5m",
  "dataset": "long-short-ratio",
  "currency": "BTC",
  "provider": "okx"
}
GETMark Price/v1/finance:okx/mark-priceMark price for OKX derivatives, one instrument or a whole product line.

Parameters

instTypeenumoptional
Product line. Default SWAP Values: MARGIN, SWAP, FUTURES, OPTION.
symbolstringoptional
One instrument ID. Omit to list the whole line
instFamilystringoptional
Contract family, for FUTURES and OPTION

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/mark-price?instType=SWAP&symbol=BTC-USDT-SWAP&instFamily=BTC-USDT" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 1,
  "items": [
    {
      "date": "2026-08-20T14:58:34.087Z",
      "time": 1787237914087,
      "symbol": "BTC-USDT-SWAP",
      "instType": "SWAP",
      "markPrice": 71637.9
    }
  ],
  "symbol": "BTC-USDT-SWAP",
  "dataset": "mark-price",
  "instType": "SWAP",
  "provider": "okx"
}
GETOpen Interest Volume/v1/finance:okx/open-interest-volumeOpen interest and trading volume across an OKX coin, as a series.

Parameters

currencystringoptional
Coin the series is measured in. Default BTC
periodenumoptional
Sampling interval. Default 5m Values: 5m, 1H, 1D.
startstringoptional
Oldest point to include. Epoch ms/s or ISO date
endstringoptional
Newest point to include. Epoch ms/s or ISO date

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/open-interest-volume?currency=BTC&period=5m&start=2026-08-19T00%3A00%3A00Z&end=2026-08-20T00%3A00%3A00Z" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 289,
  "items": [
    {
      "date": "2026-08-19T00:00:00.000Z",
      "time": 1787097600000,
      "volume": 4625681.3003,
      "openInterest": 2734863303.818
    },
    {
      "date": "2026-08-19T00:05:00.000Z",
      "time": 1787097900000,
      "volume": 19376638.5103,
      "openInterest": 2732066244.4829
    },
    {
      "date": "2026-08-19T00:10:00.000Z",
      "time": 1787098200000,
      "volume": 21160767.9023,
      "openInterest": 2736080690.2392
    },
    {
      "date": "2026-08-19T00:15:00.000Z",
      "time": 1787098500000,
      "volume": 18460955.7031,
      "openInterest": 2735382416.5911
    },
    {
      "date": "2026-08-19T00:20:00.000Z",
      "time": 1787098800000,
      "volume": 17187939.4254,
      "openInterest": 2735341157.5042
    },
    {
      "date": "2026-08-19T00:25:00.000Z",
      "time": 1787099100000,
      "volume": 8980848.8529,
      "openInterest": 2734355299.2411
    }
  ],
  "period": "5m",
  "dataset": "open-interest-volume",
  "currency": "BTC",
  "provider": "okx"
}
GETOpen Interest/v1/finance:okx/open-interestOpen interest for OKX derivatives — a live snapshot, not a series.

Parameters

instTypeenumoptional
Product line. Open interest is published for derivatives only Values: SWAP, FUTURES, OPTION.
symbolstringoptional
One instrument ID. Omit to list the whole line
instFamilystringoptional
Contract family, for FUTURES and OPTION

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/open-interest?instType=SWAP&symbol=BTC-USDT-SWAP&instFamily=BTC-USDT" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 1,
  "items": [
    {
      "date": "2026-08-20T14:58:47.103Z",
      "time": 1787237927103,
      "symbol": "BTC-USDT-SWAP",
      "instType": "SWAP",
      "openInterest": 3014259.4000000125,
      "openInterestUsd": 2159463662.310409,
      "openInterestBase": 30142.59400000013
    }
  ],
  "symbol": "BTC-USDT-SWAP",
  "dataset": "open-interest",
  "instType": "SWAP",
  "provider": "okx"
}
GETPrice Limit/v1/finance:okx/price-limitThe band OKX will accept orders inside for one instrument, right now.

Parameters

symbolstringrequired
Instrument ID, OKX's own form

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/price-limit?symbol=BTC-USDT-SWAP" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "date": "2026-08-20T14:58:53.307Z",
  "time": 1787237933307,
  "symbol": "BTC-USDT-SWAP",
  "dataset": "price-limit",
  "enabled": true,
  "buyLimit": 72046,
  "instType": "SWAP",
  "provider": "okx",
  "sellLimit": 71328.7
}
GETTaker Volume/v1/finance:okx/taker-volumeTaker buy and sell volume across an OKX coin.

Parameters

currencystringoptional
Coin the series is measured in. Default BTC
instTypeenumoptional
Where the volume is measured. Default CONTRACTS Values: SPOT, CONTRACTS.
periodenumoptional
Sampling interval. Default 5m Values: 5m, 1H, 1D.
startstringoptional
Oldest point to include. Epoch ms/s or ISO date
endstringoptional
Newest point to include. Epoch ms/s or ISO date

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/taker-volume?currency=BTC&instType=CONTRACTS&period=5m&start=2026-08-19T00%3A00%3A00Z&end=2026-08-20T00%3A00%3A00Z" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 289,
  "items": [
    {
      "date": "2026-08-19T00:00:00.000Z",
      "time": 1787097600000,
      "buyVolume": 1157482.2695,
      "sellVolume": 3468199.0308
    },
    {
      "date": "2026-08-19T00:05:00.000Z",
      "time": 1787097900000,
      "buyVolume": 4028628.1914,
      "sellVolume": 15347874.6106
    },
    {
      "date": "2026-08-19T00:10:00.000Z",
      "time": 1787098200000,
      "buyVolume": 4554562.4544,
      "sellVolume": 16606205.4479
    },
    {
      "date": "2026-08-19T00:15:00.000Z",
      "time": 1787098500000,
      "buyVolume": 2839560.0399,
      "sellVolume": 15621395.6632
    },
    {
      "date": "2026-08-19T00:20:00.000Z",
      "time": 1787098800000,
      "buyVolume": 5391706.8318,
      "sellVolume": 11793019.5104
    },
    {
      "date": "2026-08-19T00:25:00.000Z",
      "time": 1787099100000,
      "buyVolume": 5629821.6608,
      "sellVolume": 3351027.1921
    }
  ],
  "period": "5m",
  "dataset": "taker-volume",
  "currency": "BTC",
  "provider": "okx"
}
GETTicker/v1/finance:okx/tickerLive 24h snapshot for one OKX instrument.

Parameters

symbolstringrequired
Instrument ID, OKX's own form

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/ticker?symbol=BTC-USDT-SWAP" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "date": "2026-08-20T14:59:12.768Z",
  "time": 1787237952768,
  "low24h": 65856.4,
  "symbol": "BTC-USDT-SWAP",
  "askSize": 64.45,
  "bidSize": 1072.36,
  "dataset": "ticker",
  "high24h": 72492.9,
  "open24h": 65894.6,
  "askPrice": 71728,
  "bidPrice": 71727.9,
  "instType": "SWAP",
  "lastSize": 0.09,
  "openUtc0": 69307.9,
  "openUtc8": 68530,
  "provider": "okx",
  "lastPrice": 71727.9,
  "volume24h": 22525952.7,
  "volumeCurrency24h": 225259.527
}
GETTickers/v1/finance:okx/tickersLive 24h snapshot for every OKX instrument in one product line.

Parameters

instTypeenumoptional
Product line. Default SWAP Values: SPOT, MARGIN, SWAP, FUTURES, OPTION.
instFamilystringoptional
Contract family, for FUTURES and OPTION
ulystringoptional
Underlying, for FUTURES and OPTION

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/tickers?instType=SWAP&instFamily=BTC-USDT&uly=BTC-USD" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 1,
  "items": [
    {
      "date": "2026-08-20T14:59:22.766Z",
      "time": 1787237962766,
      "low24h": 65856.4,
      "symbol": "BTC-USDT-SWAP",
      "askSize": 194.64,
      "bidSize": 419.76,
      "high24h": 72492.9,
      "open24h": 65894.6,
      "askPrice": 71740.2,
      "bidPrice": 71740.1,
      "instType": "SWAP",
      "lastSize": 0.6,
      "openUtc0": 69307.9,
      "openUtc8": 68530,
      "lastPrice": 71740.2,
      "volume24h": 22527583.84,
      "volumeCurrency24h": 225275.8384
    }
  ],
  "dataset": "tickers",
  "instType": "SWAP",
  "provider": "okx"
}
GETTrades/v1/finance:okx/tradesRecent public prints for one OKX instrument, newest first.

Parameters

symbolstringrequired
Instrument ID, OKX's own form
countnumberoptional
Prints to return. Default 100, max 500

Request

curl -X GET "https://api.zpi.web.id/v1/finance:okx/trades?symbol=BTC-USDT-SWAP&count=100" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"

Example response

{
  "count": 100,
  "items": [
    {
      "date": "2026-08-20T14:59:27.499Z",
      "side": "sell",
      "size": 0.04,
      "time": 1787237967499,
      "price": 71745,
      "symbol": "BTC-USDT-SWAP",
      "tradeId": "2846741966"
    },
    {
      "date": "2026-08-20T14:59:27.145Z",
      "side": "sell",
      "size": 0.07,
      "time": 1787237967145,
      "price": 71745,
      "symbol": "BTC-USDT-SWAP",
      "tradeId": "2846741965"
    },
    {
      "date": "2026-08-20T14:59:27.127Z",
      "side": "sell",
      "size": 2.59,
      "time": 1787237967127,
      "price": 71745,
      "symbol": "BTC-USDT-SWAP",
      "tradeId": "2846741964"
    },
    {
      "date": "2026-08-20T14:59:26.979Z",
      "side": "buy",
      "size": 3.29,
      "time": 1787237966979,
      "price": 71745.1,
      "symbol": "BTC-USDT-SWAP",
      "tradeId": "2846741963"
    },
    {
      "date": "2026-08-20T14:59:26.963Z",
      "side": "buy",
      "size": 0.03,
      "time": 1787237966963,
      "price": 71745.1,
      "symbol": "BTC-USDT-SWAP",
      "tradeId": "2846741962"
    },
    {
      "date": "2026-08-20T14:59:26.963Z",
      "side": "buy",
      "size": 0.01,
      "time": 1787237966963,
      "price": 71745.1,
      "symbol": "BTC-USDT-SWAP",
      "tradeId": "2846741961"
    }
  ],
  "symbol": "BTC-USDT-SWAP",
  "dataset": "trades",
  "provider": "okx"
}

Related APIs

More in finance

Pluang

finance/pluang

Data pasar Pluang lintas aset: order book, running trade, tradebook dan ringkasan broker per saham IDX, plus saham Amerika, emas, kripto, sinyal analis dan berita.

23.3K calls·1d cache

Binance Vision

finance/binance-vision

Binance's public bulk archive: klines, 5-minute open-interest and long/short metrics, funding, book depth and liquidations, back to 2017.

4.7K calls·1d cache

TradingView

finance/tradingview

Screener, charts, technical indicators, fundamentals, news and the macro calendar across 16 markets — Indonesian equities, US equities, crypto, forex and futures.

52.7K calls·1d cache

Stockbit

finance/stockbit

Data saham IDX dari Stockbit: harga, chart intraday, profil emiten, diskusi komunitas, dan kamus investasi.

17.5K calls·1d cache

Yahoo Finance

finance/yahoo-finance

Global quotes, fundamentals, statements, options, earnings, ownership and analyst coverage. Jakarta listings via the .JK suffix.

12.7K calls·5m cache

IDX (Bursa Efek Indonesia)

finance/idx

Data Bursa Efek Indonesia: ringkasan saham & indeks, top movers, broker, emiten, laporan keuangan, berita, dan passthrough ke ratusan endpoint /primary/.

75.6K calls·1d cache
Browse APIsPricingDocsMCP serverGet an API key
zapi.One key, one response shape.
TermsPrivacyCookiesAUPRefunds© 2026