Access market analytics, top movers, sector data, and analyst ratings with the JavaScript SDK
const gainers = await client.analytics.getTopGainers(); gainers.forEach(stock => { console.log(`${stock.symbol}: +${stock.changePercent}%`); });
const losers = await client.analytics.getTopLosers();
const active = await client.analytics.getMostActive();
const techStocks = await client.analytics.getSectorTickers('Technology');
const sectors = await client.analytics.getSectorPerformance();
const ratings = await client.analytics.getAnalystRatings('AAPL');
const breadth = await client.analytics.getMarketBreadth(); console.log(`Advancers: ${breadth.advancers}`); console.log(`Decliners: ${breadth.decliners}`);
interface Stock { symbol: string; price: number; changePercent: number; volume: number; } interface MarketBreadth { advancers: number; decliners: number; unchanged: number; }
const gainers = await client.analytics.getTopGainers(); console.log('Top 5 Gainers:'); gainers.slice(0, 5).forEach(stock => { console.log(`${stock.symbol}: $${stock.price} (+${stock.changePercent}%)`); });
Was this page helpful?