# Bybit โ€” Zapi reference > Bybit v5 market data: candles, 5-minute open interest and account ratios with cursor pagination, funding history and instrument specs. **Base URL:** `https://api.zpi.web.id` **Auth:** Send `x-api-key: YOUR_KEY` header on every request. Get a free key at https://zpi.web.id/dashboard/keys. **Response envelope:** `{ content, message, errors }` **Rate limit:** 60 req/min on free tier. **Related:** - Detail page: https://zpi.web.id/api/finance/bybit - Endpoint catalog: https://zpi.web.id/category/finance - Concise index: https://zpi.web.id/llms.txt - Full reference: https://zpi.web.id/llms-full.txt --- ## Bybit **Category:** finance ยท **Slug:** `bybit` **Detail page:** https://zpi.web.id/api/finance/bybit Bybit v5 market data: candles, 5-minute open interest and account ratios with cursor pagination, funding history and instrument specs. **Tags:** bybit, crypto, derivatives, open-interest, funding, klines ### Account Ratio Long/short account ratio for one Bybit derivatives contract. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/account-ratio` - **Cache TTL:** 30s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse) | query | no | Product line. The ratio is published for derivatives only | | `period` | enum(5min|15min|30min|1h|4h|1d) | query | no | Sampling interval. Default 5min | | `start` | string | query | no | Oldest point to include. Epoch ms/s or ISO date | | `end` | string | query | no | Newest point to include. Epoch ms/s or ISO date | | `count` | number | query | no | Points per page. Default 200, max 500 | | `page` | number | query | no | Page number. Default 1, max 20 | **cURL:** ```bash curl "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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("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", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.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", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Funding History Settled funding rates for one Bybit perpetual. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/funding-history` - **Cache TTL:** 60s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse) | query | no | Product line. Funding applies to perpetuals only | | `start` | string | query | no | Oldest settlement to include. Epoch ms/s or ISO date | | `end` | string | query | no | Newest settlement to include. Epoch ms/s or ISO date | | `count` | number | query | no | Settlements per page. Default 200, max 200 | | `page` | number | query | no | Page number, walking backwards in time. Default 1, max 20 | **cURL:** ```bash curl "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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("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", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.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", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Index Price Kline Index-price candles for one Bybit derivatives contract. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/index-price-kline` - **Cache TTL:** 30s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse) | query | no | Product line. Default linear | | `interval` | enum(1|3|5|15|30|60|120|240|360|720|D|W|M) | query | no | Candle size in minutes, or D/W/M. Default 5 | | `start` | string | query | no | Oldest candle to include. Epoch ms/s or ISO date | | `end` | string | query | no | Newest candle to include. Epoch ms/s or ISO date | | `count` | number | query | no | Candles per page. Default 200, max 1000 | | `page` | number | query | no | Page number, walking backwards in time. Default 1, max 20 | **cURL:** ```bash curl "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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("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", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.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", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Instruments Info Contract specifications: tick size, lot size, leverage, minimum notional. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/instruments-info` - **Cache TTL:** 600s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `category` | enum(linear|inverse|spot|option) | query | no | Product line. Default linear | | `symbol` | string | query | no | One symbol. Omit to list the whole product line | | `baseCoin` | string | query | no | Filter by base coin | | `status` | enum(Trading|PreLaunch|Delivering|Closed) | query | no | Filter by contract status | | `count` | number | query | no | Instruments per page. Default 500, max 1000 | | `page` | number | query | no | Page number. Default 1, max 20 | **cURL:** ```bash curl "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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/finance:bybit/instruments-info?category=linear&symbol=BTCUSDT&baseCoin=BTC&status=Trading&count=500&page=1", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/finance:bybit/instruments-info?category=linear&symbol=BTCUSDT&baseCoin=BTC&status=Trading&count=500&page=1", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Kline OHLCV candles for one Bybit spot or derivatives symbol. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/kline` - **Cache TTL:** 30s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse|spot) | query | no | Product line. Default linear | | `interval` | enum(1|3|5|15|30|60|120|240|360|720|D|W|M) | query | no | Candle size in minutes, or D/W/M. Default 5 | | `start` | string | query | no | Oldest candle to include. Epoch ms/s or ISO date | | `end` | string | query | no | Newest candle to include. Epoch ms/s or ISO date | | `count` | number | query | no | Candles per page. Default 200, max 1000 | | `page` | number | query | no | Page number, walking backwards in time. Default 1, max 20 | **cURL:** ```bash curl "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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("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", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.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", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Mark Price Kline Mark-price candles for one Bybit derivatives contract. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/mark-price-kline` - **Cache TTL:** 30s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse) | query | no | Product line. Default linear | | `interval` | enum(1|3|5|15|30|60|120|240|360|720|D|W|M) | query | no | Candle size in minutes, or D/W/M. Default 5 | | `start` | string | query | no | Oldest candle to include. Epoch ms/s or ISO date | | `end` | string | query | no | Newest candle to include. Epoch ms/s or ISO date | | `count` | number | query | no | Candles per page. Default 200, max 1000 | | `page` | number | query | no | Page number, walking backwards in time. Default 1, max 20 | **cURL:** ```bash curl "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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("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", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.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", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Open Interest Open-interest series for one Bybit derivatives contract, down to five minutes. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/open-interest` - **Cache TTL:** 30s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse) | query | no | Product line. Open interest is published for derivatives only | | `intervalTime` | enum(5min|15min|30min|1h|4h|1d) | query | no | Sampling interval. Default 5min | | `start` | string | query | no | Oldest point to include. Epoch ms/s or ISO date | | `end` | string | query | no | Newest point to include. Epoch ms/s or ISO date | | `count` | number | query | no | Points per page. Default 200, max 200 | | `page` | number | query | no | Page number. Default 1, max 20 | **cURL:** ```bash curl "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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("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", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.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", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Orderbook Order-book snapshot for one Bybit symbol. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/orderbook` **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse|spot|option) | query | no | Product line. Default linear | | `count` | number | query | no | Levels per side. Capped at 500 linear/inverse, 200 spot, 25 option | **cURL:** ```bash curl "https://api.zpi.web.id/v1/finance:bybit/orderbook?symbol=BTCUSDT&category=linear&count=50" \ -H "x-api-key: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/finance:bybit/orderbook?symbol=BTCUSDT&category=linear&count=50", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/finance:bybit/orderbook?symbol=BTCUSDT&category=linear&count=50", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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 } ``` --- ### Premium Index Kline Premium-index candles โ€” the basis Bybit funds against โ€” for one perpetual. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/premium-index-kline` - **Cache TTL:** 30s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear) | query | no | Product line. Premium index is published for linear contracts only | | `interval` | enum(1|3|5|15|30|60|120|240|360|720|D|W|M) | query | no | Candle size in minutes, or D/W/M. Default 5 | | `start` | string | query | no | Oldest candle to include. Epoch ms/s or ISO date | | `end` | string | query | no | Newest candle to include. Epoch ms/s or ISO date | | `count` | number | query | no | Candles per page. Default 200, max 1000 | | `page` | number | query | no | Page number, walking backwards in time. Default 1, max 20 | **cURL:** ```bash curl "https://api.zpi.web.id/v1/finance:bybit/premium-index-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: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/finance:bybit/premium-index-kline?symbol=BTCUSDT&category=linear&interval=5&start=2024-01-01T00%3A00%3A00Z&end=2024-01-02T00%3A00%3A00Z&count=200&page=1", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/finance:bybit/premium-index-kline?symbol=BTCUSDT&category=linear&interval=5&start=2024-01-01T00%3A00%3A00Z&end=2024-01-02T00%3A00%3A00Z&count=200&page=1", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "page": 1, "count": 200, "items": [ { "low": 0.0007237, "date": "2024-01-01T07:25:00.000Z", "high": 0.00076495, "open": 0.00062407, "close": 0.0007237, "openTime": 1704093900000, "closeTime": 1704094199999 }, { "low": 0.00071364, "date": "2024-01-01T07:30:00.000Z", "high": 0.00071474, "open": 0.0007237, "close": 0.00071364, "openTime": 1704094200000, "closeTime": 1704094499999 }, { "low": 0.0006734, "date": "2024-01-01T07:35:00.000Z", "high": 0.00072788, "open": 0.00071364, "close": 0.0006734, "openTime": 1704094500000, "closeTime": 1704094799999 }, { "low": 0.00064291, "date": "2024-01-01T07:40:00.000Z", "high": 0.00069613, "open": 0.0006734, "close": 0.00064291, "openTime": 1704094800000, "closeTime": 1704095099999 }, { "low": 0.00077388, "date": "2024-01-01T07:45:00.000Z", "high": 0.00077572, "open": 0.00064291, "close": 0.00077572, "openTime": 1704095100000, "closeTime": 1704095399999 }, { "low": 0.00071665, "date": "2024-01-01T07:50:00.000Z", "high": 0.00089258, "open": 0.00077572, "close": 0.00071665, "openTime": 1704095400000, "closeTime": 1704095699999 } ], "symbol": "BTCUSDT", "dataset": "premium-index-kline", "hasMore": true, "category": "linear", "interval": "5", "nextPage": 2, "provider": "bybit" } ``` --- ### Recent Trade Public prints for one Bybit symbol, newest first. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/recent-trade` - **Cache TTL:** 5s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `symbol` | string | query | yes | Trading symbol. Accepts BTCUSDT, BTC/USDT or btc-usdt | | `category` | enum(linear|inverse|spot|option) | query | no | Product line. Default linear | | `baseCoin` | string | query | no | Base coin, for option prints across a whole coin | | `count` | number | query | no | Prints to return. Default 100, max 1000 (spot caps at 60) | **cURL:** ```bash curl "https://api.zpi.web.id/v1/finance:bybit/recent-trade?symbol=BTCUSDT&category=linear&baseCoin=BTC&count=100" \ -H "x-api-key: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/finance:bybit/recent-trade?symbol=BTCUSDT&category=linear&baseCoin=BTC&count=100", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/finance:bybit/recent-trade?symbol=BTCUSDT&category=linear&baseCoin=BTC&count=100", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- ### Tickers 24h statistics for every Bybit symbol in one product line, or for one symbol. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/finance:bybit/tickers` - **Cache TTL:** 15s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `category` | enum(linear|inverse|spot|option) | query | no | Product line. Default linear | | `symbol` | string | query | no | One symbol. Omit to list the whole product line | | `baseCoin` | string | query | no | Filter by base coin. Required for option when no symbol is given | | `expDate` | string | query | no | Option expiry filter, Bybit's own DDMMMYY form | **cURL:** ```bash curl "https://api.zpi.web.id/v1/finance:bybit/tickers?category=linear&symbol=BTCUSDT&baseCoin=BTC&expDate=25DEC26" \ -H "x-api-key: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/finance:bybit/tickers?category=linear&symbol=BTCUSDT&baseCoin=BTC&expDate=25DEC26", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/finance:bybit/tickers?category=linear&symbol=BTCUSDT&baseCoin=BTC&expDate=25DEC26", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "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" } ``` --- _Generated: 2026-08-20T22:27:17.075Z_