WebSocket API
Real-time market data over a single socket. Connect to wss://socket.vantafin.com/v1/stocks, authenticate with your API key, and subscribe to channels for per-second and per-minute quotes, live news, SEC filings, and trading halts. One connection can carry many subscriptions at once.
How it works
Open a WebSocket connection to the shared endpoint, send an authentication frame with your API key, then send subscribe frames for the channels you want. Each channel uses a CODE.TICKER selector - for example LS.AAPL for per-second Apple quotes, or LS.* to receive every live ticker. Messages arrive as JSON frames, each carrying a type discriminator.
- Endpoint: wss://socket.vantafin.com/v1/stocks
- Auth: send your API key on connect
- Subscribe: CODE.TICKER selectors, or CODE.* for all tickers
- Market hours: quote streams run 4:00 AM-8:00 PM ET on trading days; news and filings stream around the clock
Quick start
- Connect and subscribe
import json from websocket import create_connection ws = create_connection("wss://socket.vantafin.com/v1/stocks") ws.send(json.dumps({"action": "auth", "apiKey": "vf-live-your_api_key"})) ws.send(json.dumps({"action": "subscribe", "channels": ["LS.AAPL"]})) while True: print(ws.recv())
Available streams
Every real-time channel is documented on its own page with message fields and connect samples.
Need request/response data instead of streams? See the REST API. Official WebSocket clients for every language are on github.com/vantafin/vantafin.