Undecided Flow of Upstox API

Hello, Upstoxs i have successfully done login and access token is ben generated now i want is that real time data of all stocks , options with there detail .
guide me how can i do it using reactnative, node.
what are required steps to do.

To receive real-time stock updates, please subscribe to the Market Data Feed WebSocket.

Additionally, we have provided streamer functions in various programming languages for your convenience:

  1. Python SDK
  2. Node.js SDK
  3. Java SDK
  4. PHP SDK

Thank you.

Ok I will use Node SDK.
Thank You

After applying node js sdk and writing code.
here is the error which i faced just now
An error occurred while connecting to WebSocket: Error: Unauthorized
status: 401,
text: ‘{“status”:“error”,“errors”:}’,
method: ‘GET’,
path: ‘/v2/feed/market-data-feed/authorize’

const getMarketFeedUrl = async () => {
  return new Promise((resolve, reject) => {
    const apiInstance = new UpstoxClient.WebsocketApi(); // Create new Websocket API instance

    // Call the getMarketDataFeedAuthorize function from the API
    apiInstance.getMarketDataFeedAuthorize(
      apiVersion,
      (error, data, response) => {
        if (error) reject(error); // If there's an error, reject the promise
        else resolve(data.data.authorizedRedirectUri); // Else, resolve the promise with the authorized URL
      }
    );
  });
};

function for feedurl

As the error message indicates, your access token is invalid. Please regenerate your access token and try again.

For instructions on generating an access token, please refer to the API Documentation | Authentication.

Hello, websocket is connected and instrument_key is giving exact data at backend side .
i have the port :8080 while i want to throw this data at frontend using react how to do it i am unable to fetch websocket data to frontend.
i am using Node Js websockket should i use react js websocket?
@Pradeep_Jaiswar , @Ketan

You can give React.js a try. Check out this link for a sample working code: React WebSocket Example.

I am using node js sdk when i connect to websocket there is showing me error of ERROR WebSocket error: {“isTrusted”: false, “message”: “Expected HTTP 101 response but was ‘404 Not Found’”}
LOG WebSocket connection closed.
why is this error and i request u to please give me more info on websocket implementation

Like like in react websocket you provide MarketFeedData.js and orderFeedData.js .
So if i create files for placing orders, charts with same scenario of websocket will it work .
@Pradeep_Jaiswar @Ketan

Hello @vinod_mokashi,

If the place order code is implemented correctly as per the Example codes | Place Order, the order will be placed successfully.

listen carefully please, i need realtime chart using websocket react js . should i create another file of Chart applying same logic of websocket how i applied for marketfeed and placeorder.

@Ketan @Pradeep_Jaiswar

Hello .
I need guidance on websocket implementation process you gave just code and 1 file of market feed after that for placing order , accessing option chain, charts with that instruments keys .
How can be done.

It seems you want to place an order using the instrument keys obtained from the market feed.

The market feed provides data in JSON format, allowing you to use your preferred programming language to gather this information into a JSON object. This object will contain the instrument key, which you can then use for all your API calls.

Thank you.

I want to fetch Option chain ,Ohlc , historical candle of 1 minutes of multiple instruments keys.
How to do it for multiple instruments keys.???

Currently, we do not have a feature that allows retrieving historical candle, OHLC, and option chain data for multiple instrument keys in a single API call. At this time, you can only pass one instrument key at a time to these APIs. We have acknowledged your request and forwarded it to the appropriate team.

However, you can connect to the market feed WebSocket, which provides OHLC and option chain data for multiple instrument keys. For more details, please refer to Market Data Feed.

Thank you very much, i request upstox try to resolve it Asap.