The market data feed response requires decoding using protobuf, utilizing the provided proto file. You'll need to translate the Market Data Proto File into the appropriate format compatible with your specific programming language

Hi,
Assume I want to subscribe 500 Instrument.

I have initiated websocket to rec tick data of the 500 subscribed instrument

As per documentation “The market data feed response requires decoding using protobuf, utilizing the provided proto file. You’ll need to translate the Market Data Proto File into the appropriate format compatible with your specific programming language.”
here is the return

Instrument list key: [
  'NSE_FO|56785', 'NSE_FO|44897', 'NSE_FO|44896',
  'NSE_FO|44887', 'NSE_FO|44886', 'NSE_FO|44885',
  'NSE_FO|44884', 'NSE_FO|44889', 'NSE_FO|44888',
  'NSE_FO|44893', 'NSE_FO|44892', 'NSE_FO|44854',
  'NSE_FO|44853', 'NSE_FO|44852', 'NSE_FO|44858',
  'NSE_FO|44857', 'NSE_FO|44856', 'NSE_FO|44855',
  'NSE_FO|44859', 'NSE_FO|44861', 'NSE_FO|44860',
  'NSE_FO|44843', 'NSE_FO|44842', 'NSE_FO|44845',
  'NSE_FO|44844', 'NSE_FO|44875', 'NSE_FO|44874',
  'NSE_FO|44873', 'NSE_FO|44879', 'NSE_FO|44878',
  'NSE_FO|44883', 'NSE_FO|44882', 'NSE_FO|44881',
  'NSE_FO|44880', 'NSE_FO|44863', 'NSE_FO|44862',
  'NSE_FO|44869', 'NSE_FO|44868', 'NSE_FO|44867',
  'NSE_FO|44866', 'NSE_FO|44872', 'NSE_FO|44871',
  'NSE_FO|44870'
]
Received message: FeedResponse {
  feeds: {
    'NSE_FO|44854': Feed { ltpc: [LTPC] },
    'NSE_FO|44897': Feed { ltpc: [LTPC] },
    'NSE_FO|44853': Feed { ltpc: [LTPC] },
    'NSE_FO|44875': Feed { ltpc: [LTPC] },
    'NSE_FO|44896': Feed { ltpc: [LTPC] },
    'NSE_FO|44852': Feed { ltpc: [LTPC] },
    'NSE_FO|44874': Feed { ltpc: [LTPC] },
    'NSE_FO|44873': Feed { ltpc: [LTPC] },
    'NSE_FO|44858': Feed { ltpc: [LTPC] },
    'NSE_FO|44857': Feed { ltpc: [LTPC] },
    'NSE_FO|44879': Feed { ltpc: [LTPC] },
    'NSE_FO|44856': Feed { ltpc: [LTPC] },
    'NSE_FO|44878': Feed { ltpc: [LTPC] },
    'NSE_FO|44855': Feed { ltpc: [LTPC] },
    'NSE_FO|44859': Feed { ltpc: [LTPC] },
    'NSE_FO|56785': Feed { ltpc: [LTPC] },
    'NSE_FO|44861': Feed { ltpc: [LTPC] },
    'NSE_FO|44883': Feed { ltpc: [LTPC] },
    'NSE_FO|44860': Feed { ltpc: [LTPC] },
    'NSE_FO|44882': Feed { ltpc: [LTPC] },
    'NSE_FO|44881': Feed { ltpc: [LTPC] },
    'NSE_FO|44880': Feed { ltpc: [LTPC] },
    'NSE_FO|44887': Feed { ltpc: [LTPC] },
    'NSE_FO|44843': Feed { ltpc: [LTPC] },
    'NSE_FO|44886': Feed { ltpc: [LTPC] },
    'NSE_FO|44842': Feed { ltpc: [LTPC] },
    'NSE_FO|44885': Feed { ltpc: [LTPC] },
    'NSE_FO|44863': Feed { ltpc: [LTPC] },
    'NSE_FO|44884': Feed { ltpc: [LTPC] },
    'NSE_FO|44862': Feed { ltpc: [LTPC] },
    'NSE_FO|44869': Feed { ltpc: [LTPC] },
    'NSE_FO|44868': Feed { ltpc: [LTPC] },
    'NSE_FO|44889': Feed { ltpc: [LTPC] },
    'NSE_FO|44845': Feed { ltpc: [LTPC] },
    'NSE_FO|44867': Feed { ltpc: [LTPC] },
    'NSE_FO|44888': Feed { ltpc: [LTPC] },
    'NSE_FO|44844': Feed { ltpc: [LTPC] },
    'NSE_FO|44866': Feed { ltpc: [LTPC] },
    'NSE_FO|44872': Feed { ltpc: [LTPC] },
    'NSE_FO|44893': Feed { ltpc: [LTPC] },
    'NSE_FO|44871': Feed { ltpc: [LTPC] },
    'NSE_FO|44892': Feed { ltpc: [LTPC] },
    'NSE_FO|44870': Feed { ltpc: [LTPC] }
  },
  currentTs: Long { low: 1399965911, high: 407, unsigned: false }
}

here to the ltp of those should I need to loop to all one by one??

It means in all tick I need to loop 500 times here in my ex, is it correct??

If yes then its a huge process in each ticker just to extract the ltp.

if no please suggest the way to do in node js

Also Stuck in another issue while trying to use node sdk

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 = 'eyJ0eXAiOiJKV1QiLCJrZXlfaWQiOiJza192MS4wIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiIyQkNDRlUiLCJqdGkiOiI2ODQ2ODBlOGZmNjkzZTA0NGQyMzBhMTQiLCJpc011bHRpQ2xpZW50IjpmYWxzZSwiaXNQbHVzUGxhbiI6dHJ1ZSwiaWF0IjoxNzQ5NDUwOTg0LCJpc3MiOiJ1ZGFwaS1nYXRld2F5LXNlcnZpY2UiLCJleHAiOjE3NDk1MDY0MDB9.tdhE-83DKtkyktchwh56Wb9_CentYqIFyU4iWc78cKc';

let apiInstance = new UpstoxClient.ExpiredInstrumentApi();
let instrumentKey = "NSE_INDEX|Nifty 50"; // String | Instrument Key of asset

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

here i am getting issue. I am using esmodule because of indicator is only support es module.

dhiraj@Dhirajs-MacBook-Pro multi-user-algo % node getExpiries.js
file:///opt/homebrew/var/www/TGA-Algo/multi-user-algo/getExpiries.js:1
import { UpstoxClient } from 'upstox-js-sdk';
         ^^^^^^^^^^^^
SyntaxError: Named export 'UpstoxClient' not found. The requested module 'upstox-js-sdk' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'upstox-js-sdk';
const { UpstoxClient } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)
dhiraj@Dhirajs-MacBook-Pro multi-user-algo % 

Here is my package.json

"dependencies": {
    "@debut/indicators": "^1.3.22",
    "axios": "^1.9.0",
    "crypto-js": "^4.2.0",
    "dotenv": "^16.5.0",
    "express": "^5.1.0",
    "fs-extra": "^11.3.0",
    "moment": "^2.30.1",
    "node-fetch": "^3.3.2",
    "otplib": "^12.0.1",
    "path": "^0.12.7",
    "protobufjs": "^7.5.1",
    "rxjs": "^7.8.2",
    "serve-index": "^1.9.1",
    "speakeasy": "^2.0.0",
    "upstox-js-sdk": "^2.17.0",
    "ws": "^8.18.2"
  },

@MAHESWARI_31155756 If you’re subscribing to the LTPC mode, you can refer to the response structure provided here.

Yes, you should use a HashMap to manage data for each instrument, rather than iterating over them one by one.

To resolve your syntax error, you can refer to the CommonJS syntax example below.

Thank you for your response and I resolve the error.

I have another doubt in doc.

for websocket - v3

which step to follow as suggestion.

or