Subscription request

Add a new subscription to the session.

Supports multiple subscriptions for different schemas, which enables rich data streams containing mixed record types.

Specify an optional start time for intraday replay with subscriptions made before starting the session.

Subscriptions end when the TCP connection closes or when their symbols are removed with an unsubscribe request.

When subscribing to many symbols, a subscription can be split across multiple control messages so as to avoid exceeding the maximum length. It's recommended to chunk the symbols in groups of 500. All but the last message should include is_last=0 to indicate to the gateway that another part of the subscription remains.

Fields

Field
Required
Type
Description
schema
required
string
The data record schema code (string identifier). Must be one of the values from metadata.list_schemas.
stype_in
required
string
The symbology type of input symbols.
symbols
required
string
A comma-separated list of symbols to filter for. Setting this value to ALL_SYMBOLS will subscribe to all the symbols in the dataset.
start
optional
string or uint64_t
The inclusive start of subscription replay. Filters on ts_event except for CBBO and BBO schemas, which filter on ts_recv. Takes an ISO 8601 string or a UNIX timestamp in nanoseconds. Must be within the last 24 hours. Pass 0 to request all available data. Cannot be specified after the session is started.
snapshot
optional
int8_t
Request subscription with snapshot. When snapshot=1, start must be absent.
id
optional
uint32_t
A numerical identifier for the subscription.
is_last
optional
int8_t
0 indicates more requests will be sent with the same parameters other than symbols and the gateway should wait to process the request. is_last=1 is the default and instructs the gateway to process the request immediately.
Example message
1
schema=trades|start=1671717080706865759|stype_in=raw_symbol|symbols=SPY,QQQ\n