Available languages: [Python](https://databento.com/docs/api-live/message-flows/subscription.python.md) · [C++](https://databento.com/docs/api-live/message-flows/subscription.cpp.md) · [Rust](https://databento.com/docs/api-live/message-flows/subscription.rust.md) · [Raw](https://databento.com/docs/api-live/message-flows/subscription.raw.md)

Source: https://databento.com/docs/api-live/message-flows/subscription


# Subscription

After authenticating, the client can subscribe to live data.

To subscribe, the client must send a
[subscription request](https://databento.com/docs/api-live/client-control-messages/subscription-request.md) to
the gateway.

Subscriptions from multiple symbols and schemas can be made in the same session.
Different datasets require separate connections.

The same symbol can have separate subscriptions in different schemas.

A subscription will not take effect until the session is [started](https://databento.com/docs/api-live/message-flows/start-session.md).

To remove symbols from a subscription, the client can send an [unsubscribe request](https://databento.com/docs/api-live/client-control-messages/unsubscribe-request.md).

If one or more symbols in a subscription fail to resolve, the gateway will send an [`ErrorMsg`](https://databento.com/docs/api-live/basics/errors.md) record with `code=SymbolResolutionFailed` for each unresolved symbol.
The session is not terminated, and any successfully resolved symbols in the same subscription will continue to stream normally.

For other subscription failures (such as `code=InvalidSubscription` or `code=InternalError`), the gateway will send an [`ErrorMsg`](https://databento.com/docs/api-live/basics/errors.md) record and terminate the session.

## Example

To subscribe to trades for all E-mini S&P Mini 500 Futures on CME, the client would send:

`schema=trades|stype_in=parent|symbols=ES.FUT\n`
