Get Trending Themes
GET/v1/stockmarket/sectors/trending
Curated thematic baskets (AI, Semiconductors, EV & Battery…) ranked by today's move, each with its leading names. Themes are **curated editorial groupings**, not GICS sectors — a company can belong to several, and membership lives in ``theme_registry`` tagged ``source: "curated"``. For each theme we aggregate the *delayed / end-of-day* quotes of the members we cover: - ``change_pct`` — the basket's combined move. Cap-weighted when every covered constituent has a market cap, otherwise equal-weighted; ``weighting`` says which. (Weights may mix listing currencies for a cross-listed theme — an accepted approximation; the moves themselves are currency-agnostic.) - ``change_pct_1m`` / ``change_pct_1y`` — the same cap-weighted basket over 1-month and 1-year windows (close-to-close, anchored to the latest data date); ``null`` when a window can't be computed. - ``count`` vs ``members_total`` — covered constituents with a move vs the curated registry size, so the coverage gap is visible, not hidden. - ``members`` — the FULL covered roster (every ``count`` constituent), best-24h-move first; ``top_movers`` is the same list capped at the leaders. Each row carries its own ``exchange``/``currency`` so ASX names render in A$, plus ``tags`` — a curated, many-to-many sub-category *within* the theme (e.g. "Chips" vs "Labs" within ``ai``; "Gold" vs "Bitcoin" within ``store-of-value``). Only themes with a taxonomy defined populate it; ``[]`` elsewhere is an honest "not curated yet", not a per-row omission. The list key is ``sectors`` to match the shape ALFRED's ``/api/sectors`` proxy already consumes.
Price
$0.01/ callEdge cache
3600s
Uptime 24h
99.65%
p95
2.70s
MCP tool
stockmarket_sectors-trending
Parameters
No parameters.
Code
# 1. No key, no payment: the gateway answers 402 with the price
curl -i "https://api.realtimeapi.ai/v1/stockmarket/sectors/trending"
# 2. Pay: retry with a signed x402 payment (any x402 client builds this header)
curl "https://api.realtimeapi.ai/v1/stockmarket/sectors/trending" -H "PAYMENT-SIGNATURE: $X402_PAYMENT"// npm i @x402/fetch @x402/core @x402/evm viem
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = x402Client.fromConfig({ schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(PRIVATE_KEY)) }] });
const pay = wrapFetchWithPayment(fetch, client);
const data = await (await pay("https://api.realtimeapi.ai/v1/stockmarket/sectors/trending")).json();
console.log(data);# pip install x402 eth-account requests
from eth_account import Account
from x402.clients.requests import x402_requests
session = x402_requests(Account.from_key(PRIVATE_KEY))
print(session.get("https://api.realtimeapi.ai/v1/stockmarket/sectors/trending").json())curl "https://api.realtimeapi.ai/v1/stockmarket/sectors/trending" -H "X-API-Key: $RTAPI_KEY"Frequently asked questions
How do I get get trending themes from StockMarketAPI?
Send GET https://api.realtimeapi.ai/v1/stockmarket/sectors/trending. Pay $0.01 per request with x402, or send an X-API-Key header.
What does GET /sectors/trending cost?
$0.01 per successful request in USDC on Base. Failed requests are never charged.
Can I call this endpoint from an MCP client?
Yes. Connect any MCP client to the RealtimeAPI server and use call_feed with this endpoint's URL, or get_quote to check the price first.