Live Quotes (Per Second)
WSwss://socket.vantafin.com/v1/stocks
Subscribe to per-second live quotes over Vantafin’s WebSocket API. After authenticating with your API key, send a subscribe message for channel LS.{ticker} (e.g. LS.AAPL) or LS.* for every live ticker. During market hours (4:00 AM-8:00 PM ET on trading days) you receive one quote per ticker per second with open, high, low, close, volume and a timestamp. If the market is closed, the server may respond with a market_status message instead of data.
Use cases
- Real-time intraday charts with second-level resolution
- High-frequency monitoring and short-horizon signals
- Live dashboards that need fresher updates than one-minute data
- Market microstructure and liquidity research during the session
Subscribe
Send a subscribe message after connecting. Use LS.{ticker} (e.g. LS.AAPL) for a single symbol or LS.* for every symbol.
{
"action": "subscribe",
"params": "LS.AAPL"
}Message fields
| Field | Type | Description |
|---|---|---|
| type | string | Message type discriminator. |
| ticker | string | Ticker. |
| open | float | Opening price of the window. |
| high | float | Highest trade price in the window. |
| low | float | Lowest trade price in the window. |
| close | float | Closing price of the window. |
| volume | integer | Traded volume in the window. |
| timestamp | integer | Window timestamp, epoch milliseconds. |
from vantafin import WebSocketClient
ws = WebSocketClient("vf-live-your_api_key")
ws.connect()
ws.subscribe(["LS.AAPL"])
for message in ws:
print(message){
"type": "live_quote_second",
"ticker": "AAPL",
"open": 189.12,
"high": 189.2,
"low": 189.05,
"close": 189.18,
"volume": 12500,
"timestamp": 1700000001000
}