Get Premium Index Price Kline
Query for historical premium index klines. Charts are returned in groups based on the requested interval.
Covers: USDT and USDC perpetual
HTTP Request
GET /v5/market/premium-index-price-kline
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
category | false | string | Product type. linear |
symbol | true | string | Symbol name, like BTCUSDT , uppercase only |
interval | true | string | Kline interval |
start | false | integer | The start timestamp (ms) |
end | false | integer | The end timestamp (ms) |
limit | false | integer | Limit for data size per page. [1 , 1000 ]. Default: 200 |
Response Parameters
Parameter | Type | Comments |
---|---|---|
category | string | Product type |
symbol | string | Symbol name |
list | array |
|
> list[0] | string | Start time of the candle (ms) |
> list[1] | string | Open price |
> list[2] | string | Highest price |
> list[3] | string | Lowest price |
> list[4] | string | Close price. Is the last traded price when the candle is not closed |
Request Example
- HTTP
- Python
- Go
- Java
- Node.js
GET /v5/market/premium-index-price-kline?category=linear&symbol=BTCUSDT&interval=D&start=1652112000000&end=1652544000000 HTTP/1.1
Host: api-testnet.bybit.com
from pybit.unified_trading import HTTP
session = HTTP()
print(session.get_premium_index_price_kline(
category="linear",
symbol="BTCUSDT",
inverval="D",
start=1652112000000,
end=1652544000000,
))
import (
"context"
"fmt"
bybit "github.com/wuhewuhe/bybit.go.api"
)
client := bybit.NewBybitHttpClient("", "", bybit.WithBaseURL(bybit.TESTNET))
params := map[string]interface{}{"category": "spot", "symbol": "BTCUSDT", "interval": "1"}
client.NewUtaBybitServiceWithParams(params).GetPremiumIndexPriceKline(context.Background())
import com.bybit.api.client.domain.CategoryType;
import com.bybit.api.client.domain.market.*;
import com.bybit.api.client.domain.market.request.MarketDataRequest;
import com.bybit.api.client.service.BybitApiClientFactory;
var client = BybitApiClientFactory.newInstance().newAsyncMarketDataRestClient();
var marketKLineRequest = MarketDataRequest.builder().category(CategoryType.LINEAR).symbol("BTCUSDT").marketInterval(MarketInterval.WEEKLY).build();
client.getPremiumIndexPriceLinesData(marketKLineRequest, System.out::println);
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
});
client
.getPremiumIndexPriceKline({
category: 'linear',
symbol: 'BTCUSDT',
interval: 'D',
start: 1652112000000,
end: 1652544000000,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Response Example
{
"retCode": 0,
"retMsg": "OK",
"result": {
"symbol": "BTCUSDT",
"category": "linear",
"list": [
[
"1652486400000",
"-0.000587",
"-0.000344",
"-0.000480",
"-0.000344"
],
[
"1652400000000",
"-0.000989",
"-0.000561",
"-0.000587",
"-0.000587"
]
]
},
"retExtInfo": {},
"time": 1672765216291
}