Stream market data and account events in real-time.
HTTP Streaming
HTTP Streaming involves the process of opening an HTTP connection that does not close. Instead, data is continually transmitted to the HTTP client in "chunks" which can be parsed and processed. The value of an HTTP stream (as opposed to a raw TCP or binary stream) is the inherent convenience of using a well established protocol, built-in encryption, and battle-tested clients are readily available.
As long as data is flowing across the HTTP connection, the HTTP request will stay open. If you’re streaming very inactive symbols and don’t receive data for 15 minutes, the session will close automatically.
It is critical to implement reconnection logic into your streaming interface. There are many things that might cause an HTTP connection to close and solid reconnect logic will ensure you continue to receive data.
WebSocket Streaming
WebSocket streaming offers a much more resilient and feature-rich streaming interface. Once a WebSocket connection is opened, you will send a request payload to our servers, we'll process your request and begin sending back data right away. WebSockets offer many different client implementations, support encrypted connections, and very fast throughput.
Once connected and streaming data, to make modifications to your current streaming connection, simply resend your request payload. You can change the parameters and we'll adjust your stream accordingly. Note: if your sessionid has expired, you will need to get a new one and send it with your adjusted payload.
In the event of validation issues with your WebSocket request, you should expect an error payload with details about the validation.
{"error":"1234 is not a valid symbol"}
WebSocket Endpoint:
wss://ws.tradier.com/v1/