This example demonstrates how to use the GrowwAPI NodeJS SDK to fetch live market data for symbols.
const quote = await groww.liveData.getQuote({
exchange: Exchange.NSE,
segment: Segment.CASH,
tradingSymbol: 'RELIANCE',
});
console.log('Quote:', quote);const ltp = await groww.liveData.getLTP({
segment: Segment.CASH,
exchangeSymbols: ['NSE_RELIANCE', 'NSE_TCS', 'NSE_WIPRO'],
});
console.log('LTP:', ltp);const ohlc = await groww.liveData.getOHLC({
segment: Segment.CASH,
exchangeSymbols: ['NSE_RELIANCE', 'NSE_TCS', 'NSE_WIPRO'],
});
console.log('OHLC:', ohlc);- Ensure you have initialized the SDK and set required environment variables.
- All methods are asynchronous and return strongly typed responses.
- For more details, refer to the API documentation.