Skip to main content
The TradeWatch WebSocket API provides a low-latency, bidirectional stream for real-time financial market data. While the REST API is ideal for historical data and snapshots, the WebSocket API is built for applications that require immediate updates, such as trading bots, real-time dashboards, and execution engines. With a single persistent connection, you can subscribe to thousands of tickers across all supported asset classes and receive tick-by-tick updates as they happen.

Getting Started

To begin streaming real-time data, follow these steps:
  1. Compare API Types: Ensure WebSockets are the right choice for your project. If you only need occasional updates, the REST API might be more efficient.
  2. Authentication: You will use the same credentials as the REST API. Review the Authentication guide to manage your API Keys.

Core Concepts

Connection Details

  • Base URL: wss://tradewatch.io/
  • Format: JSON
  • Protocol: Secure WebSocket (WSS)

Connection Lifecycle

Unlike standard HTTP requests, a WebSocket connection involves a handshake followed by a persistent stream:
  • Handshake: Establish a secure connection using your API Key.
  • Subscription: Once connected, send a JSON “subscribe” message specifying the symbols you wish to track.
  • Heartbeats: The server sends periodic pings to ensure the connection is alive. Ensure your client is configured to respond with pongs to prevent Limits or timeouts.

Real-Time Asset Classes

You can subscribe to real-time streams for any of the following categories. Click a link below to view the specific message schemas and available symbols for each:
  • Currencies: Ultra-low latency Forex feeds and major/minor pairs.
  • Crypto: Real-time price action for global digital assets.
  • Stocks: Live updates for international equity markets.
  • Indices: Real-time tracking of global market benchmarks.
  • Commodities: Live pricing for metals, energy, and agriculture.

Account & Support

Your WebSocket usage, including concurrent connection counts and message throughput, contributes to your Usage Statistics. For technical assistance with your WebSocket integration, please visit our Support Page or reach out to our engineering team at hello@tradewatch.io.