Getting Started
This guide walks you through connecting to the Market Data API and subscribing to your first real-time quote. Market data streams over a dedicated WebSocket connection, separate from the trading API.
What You Need
- An access token. Market data uses the same credentials as the Trade API. If you don’t have a token yet, follow the Trade API Getting Started guide first. The token response includes an
mdAccessTokenfield specifically for market data connections. - A WebSocket client. Any library that supports the
wss://protocol works. Most languages and frameworks include one.
All examples on this page use the Demo environment. Swap in wss://md.tradovateapi.com/v1/websocket for Live market data.
Connect to the WebSocket
Open a WebSocket connection to the market data Demo host:
When the connection opens, the server sends an o (open) frame to confirm the session is established. After that, it sends h (heartbeat) frames about every 2.5 seconds. Your client must reply to each heartbeat with [] to keep the connection alive.
Authorize the connection
Send an authorize request with the mdAccessToken from your token response. The WebSocket text protocol separates the endpoint name, a request ID, and the body with newlines:
A successful response returns status 200:
You only need to authorize once per connection. For the full authorization flow and server details, see Authentication & Access.
Subscribe to a quote
Send an md/subscribeQuote request with the contract symbol you want to track:
On success, the server begins streaming quote events as they occur. Each event arrives as an a frame with event type md:
The entries object contains the available data points for that contract. Common entry types include Bid, Offer, Trade, HighPrice, LowPrice, OpeningPrice, and TotalTradeVolume.
To stop receiving updates for a contract, send md/unsubscribeQuote with the same symbol. You can hold one subscription per type (quotes, DOM, charts) per contract, so track your active subscriptions to clean them up later.
Next Steps
- Read Real-Time Data via WebSocket for the full protocol, including DOM, chart, and histogram subscriptions.
- Browse the WebSocket API reference for every available channel and message format.
- See Tick Charts for tick-level chart data.

