Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 2.42 KB

File metadata and controls

68 lines (47 loc) · 2.42 KB

PeatioSdk.KApi

All URIs are relative to http://localhost:8000/api/v2

Method HTTP request Description
getV2K GET /k Get OHLC(k line) of specific market.

getV2K

getV2K(market, opts)

Get OHLC(k line) of specific market.

Get OHLC(k line) of specific market.

Example

var PeatioSdk = require('peatio-sdk');
var defaultClient = PeatioSdk.ApiClient.instance;

// Configure OAuth2 access token for authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new PeatioSdk.KApi();

var market = "market_example"; // String | Unique market id. It's always in the form of xxxyyy, where xxx is the base currency code, yyy is the quote currency code, e.g. 'btcusd'. All available markets can be found at /api/markets.

var opts = { 
  'limit': 30, // Number | Limit the number of returned data points, default to 30.
  'period': 1, // Number | Time period of K line, default to 1. You can choose between 1, 5, 15, 30, 60, 120, 240, 360, 720, 1440, 4320, 10080
  'timestamp': 56 // Number | An integer represents the seconds elapsed since Unix epoch. If set, only k-line data after that time will be returned.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getV2K(market, opts, callback);

Parameters

Name Type Description Notes
market String Unique market id. It's always in the form of xxxyyy, where xxx is the base currency code, yyy is the quote currency code, e.g. 'btcusd'. All available markets can be found at /api/markets.
limit Number Limit the number of returned data points, default to 30. [optional] [default to 30]
period Number Time period of K line, default to 1. You can choose between 1, 5, 15, 30, 60, 120, 240, 360, 720, 1440, 4320, 10080 [optional] [default to 1]
timestamp Number An integer represents the seconds elapsed since Unix epoch. If set, only k-line data after that time will be returned. [optional]

Return type

null (empty response body)

Authorization

jwt

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json