Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Latest commit

 

History

History
118 lines (80 loc) · 2.84 KB

KlineApi.md

File metadata and controls

118 lines (80 loc) · 2.84 KB

BybitApi.KlineApi

All URIs are relative to https://api.bybit.com

Method HTTP request Description
klineGet GET /v2/public/kline/list Query historical kline.
klineMarkPrice GET /v2/public/mark-price-kline Query mark price kline.

klineGet

Object klineGet(symbol, interval, from, opts)

Query historical kline.

Example

var BybitApi = require('bybit_api');

var apiInstance = new BybitApi.KlineApi();

var symbol = "symbol_example"; // String | Contract type.

var interval = "interval_example"; // String | Kline interval.

var from = 8.14; // Number | from timestamp.

var opts = { 
  'limit': 8.14 // Number | Contract type.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.klineGet(symbol, interval, from, opts, callback);

Parameters

Name Type Description Notes
symbol String Contract type.
interval String Kline interval.
from Number from timestamp.
limit Number Contract type. [optional]

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

klineMarkPrice

Object klineMarkPrice(symbol, interval, from, opts)

Query mark price kline.

Example

var BybitApi = require('bybit_api');

var apiInstance = new BybitApi.KlineApi();

var symbol = "symbol_example"; // String | Contract type.

var interval = "interval_example"; // String | Data refresh interval

var from = 56; // Number | From timestamp in seconds

var opts = { 
  'limit': 56 // Number | Limit for data size, max size is 1000. Default size is 500
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.klineMarkPrice(symbol, interval, from, opts, callback);

Parameters

Name Type Description Notes
symbol String Contract type.
interval String Data refresh interval
from Number From timestamp in seconds
limit Number Limit for data size, max size is 1000. Default size is 500 [optional]

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json