upstox-nodejs

UpstoxClient.MarketHolidaysAndTimingsApi

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

Method HTTP request Description
getExchangeTimings GET /v2/market/timings/{date} Get Exchange Timings on particular date
getHoliday GET /v2/market/holidays/{date} Get Holiday on particular date
getHolidays GET /v2/market/holidays Get Holiday list of current year
getMarketStatus GET /v2/market/status/{exchange} Get Market status for particular exchange

getExchangeTimings

GetExchangeTimingResponse getExchangeTimings(_date)

Get Exchange Timings on particular date

This API provides the functionality to retrieve the exchange timings on particular date

Example

import {UpstoxClient} from 'upstox-js-sdk';

let apiInstance = new UpstoxClient.MarketHolidaysAndTimingsApi();
let _date = "_date_example"; // String | 

apiInstance.getExchangeTimings(_date, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
_date String    

Return type

GetExchangeTimingResponse

Authorization

No authorization required

HTTP request headers

getHoliday

GetHolidayResponse getHoliday(_date)

Get Holiday on particular date

This API provides the functionality to retrieve the holiday on particular date

Example

import {UpstoxClient} from 'upstox-js-sdk';

let apiInstance = new UpstoxClient.MarketHolidaysAndTimingsApi();
let _date = "_date_example"; // String | 

apiInstance.getHoliday(_date, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
_date String    

Return type

GetHolidayResponse

Authorization

No authorization required

HTTP request headers

getHolidays

GetHolidayResponse getHolidays()

Get Holiday list of current year

This API provides the functionality to retrieve the holiday list of current year

Example

import {UpstoxClient} from 'upstox-js-sdk';

let apiInstance = new UpstoxClient.MarketHolidaysAndTimingsApi();
apiInstance.getHolidays((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

This endpoint does not need any parameter.

Return type

GetHolidayResponse

Authorization

No authorization required

HTTP request headers

getMarketStatus

GetMarketStatusResponse getMarketStatus(exchange)

Get Market status for particular exchange

This API provides the functionality to retrieve the market status for particular exchange

Example

import {UpstoxClient} from 'upstox-js-sdk';
let defaultClient = UpstoxClient.ApiClient.instance;

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

let apiInstance = new UpstoxClient.MarketHolidaysAndTimingsApi();
let exchange = "exchange_example"; // String | 

apiInstance.getMarketStatus(exchange, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
exchange String    

Return type

GetMarketStatusResponse

Authorization

OAUTH2

HTTP request headers