Bybit v5 market data: candles, 5-minute open interest and account ratios with cursor pagination, funding history and instrument specs.
account-ratiopassing, 9.8sfunding-historypassing, 9.4sindex-price-klinepassing, 10.1sinstruments-infopassing, 9.4sklinepassing, 9.8smark-price-klinepassing, 9.6sopen-interestpassing, 9.4sorderbookpassing, 9.4spremium-index-klinepassing, 9.4srecent-tradepassing, 9.5stickerspassing, 9.5s/v1/finance:bybit/account-ratio30s cache7 paramschecking key…// npm i zpi-sdk
import { ZpiClient } from "zpi-sdk";
const client = new ZpiClient({ apiKey: "zpi_xxxxxxxxxxxxxxxxxxxxxxxx" });
const data = await client.run("finance:bybit", "account-ratio", {
"symbol": "BTCUSDT",
"category": "linear",
"period": "5min",
"start": "2020-07-20T00:00:00Z",
"end": "2020-07-21T00:00:00Z",
"count": 200,
"page": 1
});
console.log(data);curl -X GET "https://api.zpi.web.id/v1/finance:bybit/account-ratio?symbol=BTCUSDT&category=linear&period=5min&start=2020-07-20T00%3A00%3A00Z&end=2020-07-21T00%3A00%3A00Z&count=200&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"/v1/finance:bybit/account-ratioLong/short account ratio for one Bybit derivatives contract.symbolstringrequiredcategoryenumoptionalperiodenumoptionalstartstringoptionalendstringoptionalcountnumberoptionalpagenumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/account-ratio?symbol=BTCUSDT&category=linear&period=5min&start=2020-07-20T00%3A00%3A00Z&end=2020-07-21T00%3A00%3A00Z&count=200&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"page": 1,
"count": 7,
"items": [
{
"date": "2020-07-20T07:50:00.000Z",
"time": 1595231400000,
"longRatio": 0.4685,
"shortRatio": 0.5315
},
{
"date": "2020-07-20T08:00:00.000Z",
"time": 1595232000000,
"longRatio": 0.4685,
"shortRatio": 0.5315
},
{
"date": "2020-07-20T08:05:00.000Z",
"time": 1595232300000,
"longRatio": 0.4677,
"shortRatio": 0.5323
},
{
"date": "2020-07-20T08:10:00.000Z",
"time": 1595232600000,
"longRatio": 0.4675,
"shortRatio": 0.5325
},
{
"date": "2020-07-20T08:15:00.000Z",
"time": 1595232900000,
"longRatio": 0.4673,
"shortRatio": 0.5327
},
{
"date": "2020-07-20T08:20:00.000Z",
"time": 1595233200000,
"longRatio": 0.4667,
"shortRatio": 0.5333
}
],
"period": "5min",
"symbol": "BTCUSDT",
"dataset": "account-ratio",
"hasMore": false,
"category": "linear",
"nextPage": null,
"provider": "bybit"
}/v1/finance:bybit/funding-historySettled funding rates for one Bybit perpetual.symbolstringrequiredcategoryenumoptionalstartstringoptionalendstringoptionalcountnumberoptionalpagenumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/funding-history?symbol=BTCUSDT&category=linear&start=2024-01-01T00%3A00%3A00Z&end=2024-02-01T00%3A00%3A00Z&count=200&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"page": 1,
"count": 94,
"items": [
{
"date": "2024-01-01T00:00:00.000Z",
"time": 1704067200000,
"symbol": "BTCUSDT",
"fundingRate": 0.00043294
},
{
"date": "2024-01-01T08:00:00.000Z",
"time": 1704096000000,
"symbol": "BTCUSDT",
"fundingRate": 0.00049955
},
{
"date": "2024-01-01T16:00:00.000Z",
"time": 1704124800000,
"symbol": "BTCUSDT",
"fundingRate": 0.00037274
},
{
"date": "2024-01-02T00:00:00.000Z",
"time": 1704153600000,
"symbol": "BTCUSDT",
"fundingRate": 0.00057167
},
{
"date": "2024-01-02T08:00:00.000Z",
"time": 1704182400000,
"symbol": "BTCUSDT",
"fundingRate": 0.00049958
},
{
"date": "2024-01-02T16:00:00.000Z",
"time": 1704211200000,
"symbol": "BTCUSDT",
"fundingRate": 0.00066228
}
],
"symbol": "BTCUSDT",
"dataset": "funding-history",
"hasMore": false,
"category": "linear",
"nextPage": null,
"provider": "bybit"
}/v1/finance:bybit/index-price-klineIndex-price candles for one Bybit derivatives contract.symbolstringrequiredcategoryenumoptionalintervalenumoptionalstartstringoptionalendstringoptionalcountnumberoptionalpagenumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/index-price-kline?symbol=BTCUSDT&category=linear&interval=5&start=2024-01-01T00%3A00%3A00Z&end=2024-01-02T00%3A00%3A00Z&count=200&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"page": 1,
"count": 200,
"items": [
{
"low": 42453.92,
"date": "2024-01-01T07:25:00.000Z",
"high": 42499.55,
"open": 42453.93,
"close": 42488.6,
"openTime": 1704093900000,
"closeTime": 1704094199999
},
{
"low": 42480.89,
"date": "2024-01-01T07:30:00.000Z",
"high": 42499.63,
"open": 42488.6,
"close": 42496.4,
"openTime": 1704094200000,
"closeTime": 1704094499999
},
{
"low": 42495.62,
"date": "2024-01-01T07:35:00.000Z",
"high": 42500.68,
"open": 42496.4,
"close": 42496.58,
"openTime": 1704094500000,
"closeTime": 1704094799999
},
{
"low": 42447.82,
"date": "2024-01-01T07:40:00.000Z",
"high": 42496.7,
"open": 42496.58,
"close": 42447.84,
"openTime": 1704094800000,
"closeTime": 1704095099999
},
{
"low": 42433.58,
"date": "2024-01-01T07:45:00.000Z",
"high": 42471.21,
"open": 42447.84,
"close": 42465.28,
"openTime": 1704095100000,
"closeTime": 1704095399999
},
{
"low": 42462.72,
"date": "2024-01-01T07:50:00.000Z",
"high": 42472.22,
"open": 42465.28,
"close": 42472.22,
"openTime": 1704095400000,
"closeTime": 1704095699999
}
],
"symbol": "BTCUSDT",
"dataset": "index-price-kline",
"hasMore": true,
"category": "linear",
"interval": "5",
"nextPage": 2,
"provider": "bybit"
}/v1/finance:bybit/instruments-infoContract specifications: tick size, lot size, leverage, minimum notional.categoryenumoptionalsymbolstringoptionalbaseCoinstringoptionalstatusenumoptionalcountnumberoptionalpagenumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/instruments-info?category=linear&symbol=BTCUSDT&baseCoin=BTC&status=Trading&count=500&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"page": 1,
"count": 1,
"items": [
{
"status": "Trading",
"symbol": "BTCUSDT",
"qtyStep": 0.001,
"baseCoin": "BTC",
"maxPrice": 1999999.8,
"minPrice": 0.1,
"tickSize": 0.1,
"quoteCoin": "USDT",
"launchDate": "2020-03-15T00:00:00.000Z",
"launchTime": 1584230400000,
"priceScale": 2,
"settleCoin": "USDT",
"copyTrading": "both",
"maxLeverage": 150,
"maxOrderQty": 1500,
"minLeverage": 1,
"minOrderQty": 0.001,
"contractType": "LinearPerpetual",
"leverageStep": 0.01,
"minNotionalValue": 5,
"unifiedMarginTrade": true,
"fundingIntervalMinutes": 480
}
],
"symbol": "BTCUSDT",
"dataset": "instruments-info",
"hasMore": false,
"baseCoin": "BTC",
"category": "linear",
"nextPage": null,
"provider": "bybit"
}/v1/finance:bybit/klineOHLCV candles for one Bybit spot or derivatives symbol.symbolstringrequiredcategoryenumoptionalintervalenumoptionalstartstringoptionalendstringoptionalcountnumberoptionalpagenumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/kline?symbol=BTCUSDT&category=linear&interval=5&start=2020-03-26T00%3A00%3A00Z&end=2020-03-27T00%3A00%3A00Z&count=200&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"page": 1,
"count": 200,
"items": [
{
"low": 6619.5,
"date": "2020-03-26T07:25:00.000Z",
"high": 6632,
"open": 6629,
"close": 6619.5,
"volume": 15.827,
"openTime": 1585207500000,
"turnover": 104766.8265,
"closeTime": 1585207799999
},
{
"low": 6607,
"date": "2020-03-26T07:30:00.000Z",
"high": 6624.5,
"open": 6619.5,
"close": 6616,
"volume": 22.794,
"openTime": 1585207800000,
"turnover": 150805.104,
"closeTime": 1585208099999
},
{
"low": 6612,
"date": "2020-03-26T07:35:00.000Z",
"high": 6620.5,
"open": 6616,
"close": 6620.5,
"volume": 12.181,
"openTime": 1585208100000,
"turnover": 80644.3105,
"closeTime": 1585208399999
},
{
"low": 6597,
"date": "2020-03-26T07:40:00.000Z",
"high": 6625.5,
"open": 6620.5,
"close": 6599.5,
"volume": 21.644,
"openTime": 1585208400000,
"turnover": 142839.578,
"closeTime": 1585208699999
},
{
"low": 6570.5,
"date": "2020-03-26T07:45:00.000Z",
"high": 6606,
"open": 6599.5,
"close": 6578.5,
"volume": 11.15,
"openTime": 1585208700000,
"turnover": 73350.275,
"closeTime": 1585208999999
},
{
"low": 6561.5,
"date": "2020-03-26T07:50:00.000Z",
"high": 6593,
"open": 6578.5,
"close": 6564.5,
"volume": 13.005,
"openTime": 1585209000000,
"turnover": 85371.3225,
"closeTime": 1585209299999
}
],
"symbol": "BTCUSDT",
"dataset": "kline",
"hasMore": true,
"category": "linear",
"interval": "5",
"nextPage": 2,
"provider": "bybit"
}/v1/finance:bybit/mark-price-klineMark-price candles for one Bybit derivatives contract.symbolstringrequiredcategoryenumoptionalintervalenumoptionalstartstringoptionalendstringoptionalcountnumberoptionalpagenumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/mark-price-kline?symbol=BTCUSDT&category=linear&interval=5&start=2024-01-01T00%3A00%3A00Z&end=2024-01-02T00%3A00%3A00Z&count=200&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"page": 1,
"count": 200,
"items": [
{
"low": 42487.62,
"date": "2024-01-01T07:25:00.000Z",
"high": 42533,
"open": 42487.62,
"close": 42522.2,
"openTime": 1704093900000,
"closeTime": 1704094199999
},
{
"low": 42511.3,
"date": "2024-01-01T07:30:00.000Z",
"high": 42531.8,
"open": 42522.2,
"close": 42529.18,
"openTime": 1704094200000,
"closeTime": 1704094499999
},
{
"low": 42526.9,
"date": "2024-01-01T07:35:00.000Z",
"high": 42531.8,
"open": 42529.18,
"close": 42527.94,
"openTime": 1704094500000,
"closeTime": 1704094799999
},
{
"low": 42480.43,
"date": "2024-01-01T07:40:00.000Z",
"high": 42528.09,
"open": 42527.94,
"close": 42480.47,
"openTime": 1704094800000,
"closeTime": 1704095099999
},
{
"low": 42466.13,
"date": "2024-01-01T07:45:00.000Z",
"high": 42505.71,
"open": 42480.47,
"close": 42501.2,
"openTime": 1704095100000,
"closeTime": 1704095399999
},
{
"low": 42498.3,
"date": "2024-01-01T07:50:00.000Z",
"high": 42508.95,
"open": 42501.2,
"close": 42508.83,
"openTime": 1704095400000,
"closeTime": 1704095699999
}
],
"symbol": "BTCUSDT",
"dataset": "mark-price-kline",
"hasMore": true,
"category": "linear",
"interval": "5",
"nextPage": 2,
"provider": "bybit"
}/v1/finance:bybit/open-interestOpen-interest series for one Bybit derivatives contract, down to five minutes.symbolstringrequiredcategoryenumoptionalintervalTimeenumoptionalstartstringoptionalendstringoptionalcountnumberoptionalpagenumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/open-interest?symbol=BTCUSDT&category=linear&intervalTime=5min&start=2021-01-01T00%3A00%3A00Z&end=2021-01-02T00%3A00%3A00Z&count=200&page=1" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"page": 1,
"count": 200,
"items": [
{
"date": "2021-01-01T07:25:00.000Z",
"time": 1609485900000,
"openInterest": 5793.644,
"singleOpenInterest": 2896.822
},
{
"date": "2021-01-01T07:30:00.000Z",
"time": 1609486200000,
"openInterest": 5796.766,
"singleOpenInterest": 2898.383
},
{
"date": "2021-01-01T07:35:00.000Z",
"time": 1609486500000,
"openInterest": 5798.12,
"singleOpenInterest": 2899.06
},
{
"date": "2021-01-01T07:40:00.000Z",
"time": 1609486800000,
"openInterest": 5791.412,
"singleOpenInterest": 2895.706
},
{
"date": "2021-01-01T07:45:00.000Z",
"time": 1609487100000,
"openInterest": 5797.316,
"singleOpenInterest": 2898.658
},
{
"date": "2021-01-01T07:50:00.000Z",
"time": 1609487400000,
"openInterest": 5793.28,
"singleOpenInterest": 2896.64
}
],
"symbol": "BTCUSDT",
"dataset": "open-interest",
"hasMore": true,
"category": "linear",
"nextPage": 2,
"provider": "bybit",
"intervalTime": "5min"
}/v1/finance:bybit/orderbookOrder-book snapshot for one Bybit symbol.symbolstringrequiredcategoryenumoptionalcountnumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/orderbook?symbol=BTCUSDT&category=linear&count=50" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"asks": [
{
"size": 0.008,
"price": 71673
},
{
"size": 0.001,
"price": 71673.1
},
{
"size": 0.001,
"price": 71673.3
},
{
"size": 0.002,
"price": 71674.3
},
{
"size": 0.001,
"price": 71674.4
},
{
"size": 0.001,
"price": 71675.9
}
],
"bids": [
{
"size": 3.018,
"price": 71672.9
},
{
"size": 0.003,
"price": 71672.8
},
{
"size": 0.002,
"price": 71672.3
},
{
"size": 0.187,
"price": 71672.2
},
{
"size": 0.211,
"price": 71672.1
},
{
"size": 0.001,
"price": 71671.8
}
],
"date": "2026-08-20T14:57:20.202Z",
"time": 1787237840202,
"symbol": "BTCUSDT",
"dataset": "orderbook",
"askCount": 50,
"bidCount": 50,
"category": "linear",
"provider": "bybit",
"sequence": 781164197698,
"updateId": 12245928,
"matchTime": 1787237840201
}/v1/finance:bybit/recent-tradePublic prints for one Bybit symbol, newest first.symbolstringrequiredcategoryenumoptionalbaseCoinstringoptionalcountnumberoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/recent-trade?symbol=BTCUSDT&category=linear&baseCoin=BTC&count=100" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"count": 100,
"items": [
{
"date": "2026-08-20T14:57:33.967Z",
"side": "buy",
"size": 0.002,
"time": 1787237853967,
"price": 71674.8,
"symbol": "BTCUSDT",
"tradeId": "0a0b76bb-31f3-539a-9eaf-d37e0da8a02b",
"sequence": 781164742798,
"isRpiTrade": false,
"isBlockTrade": false
},
{
"date": "2026-08-20T14:57:33.967Z",
"side": "buy",
"size": 0.001,
"time": 1787237853967,
"price": 71674.6,
"symbol": "BTCUSDT",
"tradeId": "71d042e0-a857-54fa-af9c-7452955f1613",
"sequence": 781164742798,
"isRpiTrade": false,
"isBlockTrade": false
},
{
"date": "2026-08-20T14:57:33.967Z",
"side": "buy",
"size": 0.001,
"time": 1787237853967,
"price": 71674.6,
"symbol": "BTCUSDT",
"tradeId": "612bd809-c5db-5825-93a6-d3eac112a6cb",
"sequence": 781164742798,
"isRpiTrade": false,
"isBlockTrade": false
},
{
"date": "2026-08-20T14:57:33.967Z",
"side": "buy",
"size": 0.001,
"time": 1787237853967,
"price": 71674,
"symbol": "BTCUSDT",
"tradeId": "e2c32389-61ca-550d-8327-2c6be2be11a2",
"sequence": 781164742798,
"isRpiTrade": false,
"isBlockTrade": false
},
{
"date": "2026-08-20T14:57:33.967Z",
"side": "buy",
"size": 0.001,
"time": 1787237853967,
"price": 71673.9,
"symbol": "BTCUSDT",
"tradeId": "d156d3ce-b4aa-5df5-b588-2d30c3665845",
"sequence": 781164742798,
"isRpiTrade": false,
"isBlockTrade": false
},
{
"date": "2026-08-20T14:57:33.967Z",
"side": "buy",
"size": 0.001,
"time": 1787237853967,
"price": 71673.9,
"symbol": "BTCUSDT",
"tradeId": "6459f602-e6f7-5645-95ca-22ecdead988e",
"sequence": 781164742798,
"isRpiTrade": false,
"isBlockTrade": false
}
],
"symbol": "BTCUSDT",
"dataset": "recent-trade",
"category": "linear",
"provider": "bybit"
}/v1/finance:bybit/tickers24h statistics for every Bybit symbol in one product line, or for one symbol.categoryenumoptionalsymbolstringoptionalbaseCoinstringoptionalexpDatestringoptionalcurl -X GET "https://api.zpi.web.id/v1/finance:bybit/tickers?category=linear&symbol=BTCUSDT&baseCoin=BTC&expDate=25DEC26" \
-H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"{
"count": 1,
"items": [
{
"symbol": "BTCUSDT",
"askSize": 1.792,
"bidSize": 3.434,
"askPrice": 71633.8,
"bidPrice": 71633.7,
"lastPrice": 71633.6,
"markPrice": 71626.4,
"volume24h": 183471.735,
"indexPrice": 71668,
"fundingRate": 0.00001089,
"lowPrice24h": 65854.9,
"prevPrice1h": 71684,
"turnover24h": 12762875219.2838,
"highPrice24h": 72516.8,
"openInterest": 55984.216,
"prevPrice24h": 65897.8,
"nextFundingDate": "2026-08-20T16:00:00.000Z",
"nextFundingTime": 1787241600000,
"openInterestValue": 4009947848.9,
"priceChangePct24h": 0.08704
}
],
"symbol": "BTCUSDT",
"dataset": "tickers",
"baseCoin": "BTC",
"category": "linear",
"provider": "bybit"
}