Stream live market data with Server-Sent Events. Get real-time price updates and quotes from 353+ global exchanges — with automatic browser reconnect and zero extra dependencies.
Choose the right streaming protocol for your use case
Best for one-way server-to-client streaming
Best for two-way real-time communication
Real-time data streaming with automatic reconnect and global market coverage
Push live market quotes directly to your browser or server
Live candlestick OHLCV data pushed via SSE stream
Built-in browser reconnect with no extra code required
Secure token-based authentication for SSE connections
Stream data from 353+ exchanges worldwide
Lightweight one-way push with browser-native EventSource API
Build real-time applications with SSE price and quote streaming
Push real-time quotes to a dashboard with automatic browser reconnect support
Connect SSE → Receive quote events → Update UI Stream market data to your backend for processing, storage, or further distribution
SSE stream → Process events → Store / forward Monitor streaming prices server-side and trigger alerts when thresholds are crossed
Stream prices → Threshold check → Send alerts Track a portfolio of symbols with a single SSE connection using comma-separated symbols
symbols=AAPL,TSLA,BTC → Stream all → Portfolio view Receive live OHLCV candlestick data to keep charts updated in real time
type=price&timeframe=5 → OHLCV events → Chart update Use SSE instead of WebSocket when you only need one-way server-to-client data flow
EventSource connect → Receive events → Render UI Customize your SSE stream with these query parameters
| Parameter | Required | Description | Example |
|---|---|---|---|
token | Required | JWT authentication token from /api/token/generate | eyJhbGci... |
symbols | Required | Comma-separated list of symbols to subscribe to | NASDAQ:AAPL,NYSE:TSLA |
type | Optional | Subscription type: quote (default) or price | quote |
timeframe | Optional | Candle timeframe when type=price (default: 5) | 1, 5, 15, 60, D |
GET https://ws.tradingviewapi.com/sse/stream?token=TOKEN&symbols=SYMBOLS Connect and start streaming in minutes
// Step 1: Generate JWT token via REST API
const tokenRes = await fetch('https://api.tradingviewapi.com/api/token/generate', {
method: 'POST',
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'tradingview-data1.p.rapidapi.com',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
});
const { token, sseUrl } = await tokenRes.json();
// Step 2: Connect to SSE stream
const symbols = 'NASDAQ:AAPL,NYSE:TSLA,BINANCE:BTCUSDT';
const url = `${sseUrl}?token=${token}&symbols=${symbols}&type=quote`;
const eventSource = new EventSource(url);
eventSource.onopen = () => {
console.log('SSE connection established');
};
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'connected') {
console.log('Connected, streaming:', data.symbols);
} else if (data.type === 'quote_update') {
console.log(`${data.symbol}: ${data.data.lp}`);
}
};
eventSource.onerror = (err) => {
console.error('SSE error:', err);
// Browser will auto-reconnect — no extra logic needed
};
// To stream price candles instead of quotes:
// const url = `${sseUrl}?token=${token}&symbols=BINANCE:BTCUSDT&type=price&timeframe=5`; Three steps to real-time SSE market data
Call /api/token/generate to get your JWT token and SSE URL. The same endpoint is used for both WebSocket and SSE connections.
Use the sseUrl from the token response and append your JWT token plus the symbols you want to track.
new EventSource(sseUrl + '?token=TOKEN&symbols=NASDAQ:AAPL') Handle onmessage events to process real-time quote or price updates. The browser auto-reconnects if the connection drops.
SSE events are JSON-encoded strings sent as standard data: fields
{
"type": "connected",
"clientId": "sse_abc123",
"symbols": ["NASDAQ:AAPL", "NYSE:TSLA"],
"timestamp": 1234567890
} {
"type": "quote_update",
"symbol": "NASDAQ:AAPL",
"data": { "lp": 195.42 },
"timestamp": 1234567891
} {
"type": "price_update",
"symbol": "BINANCE:BTCUSDT",
"data": {
"open": 68100, "high": 68250,
"low": 67980, "close": 68200,
"volume": 1240.5
},
"timestamp": 1234567892
} Start building real-time applications with SSE quote and price streaming. Generate your JWT token and connect today.