Vantafin
Pricing
Log InView plans
Help Center/Developers & API
Developers & APILast updated Aug 4, 2026

How to stream real-time data over WebSocket

Subscribe to live quotes, news, SEC filings, and trading halts over Vantafin's WebSocket API for real-time apps and alerting.

How to stream real-time data over WebSocket - WebSocket (Vantafin Help Center)
Vantafin Team

On this page

  • Connect
  • Available streams
  • A minimal Python client
  • Design a resilient stream
  • When to use WebSocket vs REST vs alerts
  • Next steps

Vantafin's WebSocket API streams real-time market events - live quotes, news, SEC filings, and trading halts - so your app reacts the moment something happens instead of polling. WebSocket streaming is an Ultimate-plan feature. This guide covers how to connect and subscribe; the channel reference is in the WebSocket docs.

Connect

Open a connection to the stocks stream and authenticate with your API key:

wss://socket.vantafin.com/v1/stocks?apiKey=vf-live-YOUR_KEY

After connecting, you subscribe to the channels and symbols you care about (see the docs for the exact message format).

Connect

Open the WebSocket overview and subscribe

Read the WebSocket docs for the connect URL and subscribe schema, then authenticate with your API key from Settings.

WebSocket overview→Create an API key

Available streams

StreamDelivers
Live quotesSecond- and minute-level price updates
NewsBreaking headlines
SEC filingsNew filings as they post
Trading haltsHalt and resume events

A minimal Python client

import os
import json
import websocket  # pip install websocket-client

API_KEY = os.environ["VANTAFIN_API_KEY"]
URL = f"wss://socket.vantafin.com/v1/stocks?apiKey={API_KEY}"

def on_message(ws, message):
    event = json.loads(message)
    print(event)

def on_open(ws):
    # Subscribe to the channels/symbols you want (see the docs for the schema).
    ws.send(json.dumps({"action": "subscribe", "params": "..."}))

ws = websocket.WebSocketApp(URL, on_open=on_open, on_message=on_message)
ws.run_forever()

Quotes

Stream live prices, then check MSFT in the app

Subscribe to quote updates for a ticker you care about, and open the MSFT profile to compare the live quote path with the UI.

API docs→MSFT profile

Adapt the subscribe payload to the schema documented in the WebSocket reference.

Design a resilient stream

Real-time clients should:

  • Reconnect automatically with backoff if the connection drops.
  • Resubscribe to your channels after reconnecting.
  • Buffer and process messages off the socket thread so you never block reads.

No code

Prefer in-app alerts when you only need pings

If you want notifications without a streaming client, set price, filing, or news alerts instead of maintaining a WebSocket app.

Open alerts→Create alerts

When to use WebSocket vs REST vs alerts

NeedUse
Build your own real-time appWebSocket
Pull data on demandREST API
Get notified without codeAlerts

Next steps

  • Create and use an API key
  • Query data with the REST API
  • WebSocket reference

Frequently asked questions

Important Disclaimer

This article is for informational and educational purposes only and does not constitute investment advice, financial advice, trading advice, tax advice, legal advice, or any other form of professional advice. DTS Analytics LLC (operating as Vantafin) is not a registered investment adviser, broker-dealer, or fiduciary. Market data, figures, and other information on Vantafin may be delayed, incomplete, or incorrect and are provided without warranty. Nothing herein should be construed as a solicitation, recommendation, endorsement, or offer to buy, sell, hold, or trade any security or other financial instrument. Past performance is not indicative of future results. You should independently verify all information and consult a qualified and licensed financial professional before making any investment or financial decision. You are solely responsible for your own investment, trading, and financial decisions, and DTS Analytics LLC is not liable for any losses arising from your use of or reliance on this content.

Related articles

  • How to create and use a Vantafin API key - API keys (Vantafin Help Center)
    Developers

    How to create and use a Vantafin API key

  • How to query data with the Vantafin REST API - REST API (Vantafin Help Center)
    Developers

    How to query data with the Vantafin REST API

  • How to connect the Vantafin MCP server - MCP (Vantafin Help Center)
    Developers

    How to connect the Vantafin MCP server

  • What is Vantafin? A complete overview - Overview (Vantafin Help Center)
    Get Started

    What is Vantafin? A complete overview

Overview
  • Home
  • Docs
  • Pricing
Platform
  • Markets Hub
  • Stock Screener
  • Market Calendar
  • AI Chat
About
  • About
  • Contact Us
Resources
  • Blog
  • Changelog
  • Help Center
Legal
  • Terms of Service
  • Privacy Policy
  • AI Policy
Log In
© 2026 DTS Analytics LLC. All Rights Reserved.

Vantafin provides market data and research tools for informational purposes only and does not constitute investment advice. Data may be delayed, incomplete, or incorrect. You are solely responsible for your investment decisions. See our Terms of Service.