Skip to main content
GET
TypeScript

Authorizations

Authorization
string
header
required

The Trading API key (trdrs_sk_…), for market data, orders and account state on the accounts its owner holds. Use it server-to-server, and keep it on your server. Its scope is named trading in the API.

Query Parameters

subs
string
required

Comma-separated INSTRUMENT~tf subscriptions, at most 24. Percent-encode each instrument. ~ and , never occur in symbols. Duplicates count once, and a malformed subscription is dropped without an error.

Response

An open event stream. The events are those of a single stream, each also naming its subscription:

  • snapshot { instrument, tf, bars: WireBar[] }
  • bar { instrument, tf, bar: WireBar }
  • quote { instrument, bid, ask }
  • mark { instrument, price }
  • session { instrument, last, open, high, low, prevClose, volume, change, changePct, spark }
  • error { instrument, tf, code, message }

A subscription that is refused or fails, with a 503 code of the single stream or one of its ending codes, becomes an error event for that subscription, and the connection and every other subscription carry on. Only session_expired, your own session ending, closes the whole connection.

The stream may end with a reconnect event, { code, afterMs }: the engine serving it is restarting for a release, or the trader it serves moved to another engine, and the stream closes right after the event. code is engine_draining. Open the stream again after afterMs milliseconds, which is never more than 1,000: another engine serves it, and it opens as any connection does. It is not an error, so keep what you show until the new stream's first events arrive. The event sets the stream's retry: to afterMs too, so an EventSource that reconnects on its own follows it.

The response is of type string.