why dont you provide option chain with Nodejs sdk instead of simple nodejs . it would be better to deal with sdk option chain format
Hello @vinod_mokashi we do provide option chain in nodejs SDK.
Please refer the following code for option chain
let UpstoxClient = require('upstox-js-sdk');
let defaultClient = UpstoxClient.ApiClient.instance;
var OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = "access_token"
let apiInstance = new UpstoxClient.OptionsApi();
apiInstance.getPutCallOptionChain("NSE_INDEX|Nifty 50","2024-09-05",(error, data, response) => {
if (error) {
console.error(error);
} else {
console.log(JSON.stringify(data));
}
});
And for option contracts
let UpstoxClient = require('upstox-js-sdk');
let defaultClient = UpstoxClient.ApiClient.instance;
var OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = "access_token"
let apiInstance = new UpstoxClient.OptionsApi();
apiInstance.getOptionContracts("NSE_INDEX|Nifty 50","2024-09-05",(error, data, response) => {
if (error) {
console.error(error);
} else {
console.log(JSON.stringify(data));
}
});
Please note that this API has been recently introduced in the SDK, and documentation will soon be available in our Example Codes | Option Chain.
Thank you
Ohh thank you very much