Websocket API for streaming data
Websocket service for streaming data
Server-side стрим предоставления биржевой информации.
Available only on servers:
Accepts the following message:
{
"subscribeCandlesRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"interval": "SUBSCRIPTION_INTERVAL_UNSPECIFIED",
"instrumentId": "string"
}
],
"waitingClose": true
},
"subscribeOrderBookRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"depth": 0,
"instrumentId": "string",
"orderBookType": "ORDERBOOK_TYPE_UNSPECIFIED"
}
]
},
"subscribeTradesRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"instrumentId": "string"
}
],
"tradeSource": "TRADE_SOURCE_UNSPECIFIED"
},
"subscribeInfoRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"instrumentId": "string"
}
]
},
"subscribeLastPriceRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"instrumentId": "string"
}
]
},
"pingSettings": {
"pingDelayMs": 0
}
}
Server-side стрим предоставления биржевой информации.
Available only on servers:
Accepts the following message:
{
"subscribeInfoResponse": {
"infoSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"trade": {
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
},
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00"
},
"subscribeOrderBookResponse": {
"orderBookSubscriptions": [
{
"depth": 0,
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"depth": 0,
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"ping": {
"streamId": "streamId",
"pingRequestTime": "2000-01-23T04:56:07.000+00:00",
"time": "2000-01-23T04:56:07.000+00:00"
},
"candle": {
"volume": "volume",
"high": {
"nano": 6,
"units": "units"
},
"lastTradeTs": "2000-01-23T04:56:07.000+00:00",
"low": {
"nano": 6,
"units": "units"
},
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00",
"close": {
"nano": 6,
"units": "units"
},
"open": {
"nano": 6,
"units": "units"
}
},
"orderbook": {
"depth": 6,
"asks": [
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
},
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
}
],
"instrumentUid": "instrumentUid",
"bids": [
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
},
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
}
],
"limitUp": {
"nano": 6,
"units": "units"
},
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00",
"limitDown": {
"nano": 6,
"units": "units"
},
"isConsistent": true
},
"subscribeTradesResponse": {
"tradeSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"tradingStatus": {
"limitOrderAvailableFlag": true,
"marketOrderAvailableFlag": true,
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00"
},
"subscribeCandlesResponse": {
"candlesSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"waitingClose": true,
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"waitingClose": true,
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"subscribeLastPriceResponse": {
"lastPriceSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"lastPrice": {
"price": {
"nano": 6,
"units": "units"
},
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00"
}
}
Bidirectional-стрим предоставления биржевой информации.
Available only on servers:
Accepts the following message:
Запрос подписки или отписки на определённые биржевые данные.
Запрос подписки или отписки на определённые биржевые данные.
{
"subscribeCandlesRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"interval": "SUBSCRIPTION_INTERVAL_UNSPECIFIED",
"instrumentId": "string"
}
],
"waitingClose": true
},
"subscribeOrderBookRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"depth": 0,
"instrumentId": "string",
"orderBookType": "ORDERBOOK_TYPE_UNSPECIFIED"
}
]
},
"subscribeTradesRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"instrumentId": "string"
}
],
"tradeSource": "TRADE_SOURCE_UNSPECIFIED"
},
"subscribeInfoRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"instrumentId": "string"
}
]
},
"subscribeLastPriceRequest": {
"subscriptionAction": "SUBSCRIPTION_ACTION_UNSPECIFIED",
"instruments": [
{
"figi": "string",
"instrumentId": "string"
}
]
},
"getMySubscriptions": {},
"ping": {
"time": "2019-08-24T14:15:22Z"
},
"pingSettings": {
"pingDelayMs": 0
}
}
Bidirectional-стрим предоставления биржевой информации.
Available only on servers:
Accepts the following message:
{
"subscribeInfoResponse": {
"infoSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"trade": {
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
},
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00"
},
"subscribeOrderBookResponse": {
"orderBookSubscriptions": [
{
"depth": 0,
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"depth": 0,
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"ping": {
"streamId": "streamId",
"pingRequestTime": "2000-01-23T04:56:07.000+00:00",
"time": "2000-01-23T04:56:07.000+00:00"
},
"candle": {
"volume": "volume",
"high": {
"nano": 6,
"units": "units"
},
"lastTradeTs": "2000-01-23T04:56:07.000+00:00",
"low": {
"nano": 6,
"units": "units"
},
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00",
"close": {
"nano": 6,
"units": "units"
},
"open": {
"nano": 6,
"units": "units"
}
},
"orderbook": {
"depth": 6,
"asks": [
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
},
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
}
],
"instrumentUid": "instrumentUid",
"bids": [
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
},
{
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
}
}
],
"limitUp": {
"nano": 6,
"units": "units"
},
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00",
"limitDown": {
"nano": 6,
"units": "units"
},
"isConsistent": true
},
"subscribeTradesResponse": {
"tradeSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"tradingStatus": {
"limitOrderAvailableFlag": true,
"marketOrderAvailableFlag": true,
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00"
},
"subscribeCandlesResponse": {
"candlesSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"waitingClose": true,
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"waitingClose": true,
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"subscribeLastPriceResponse": {
"lastPriceSubscriptions": [
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
},
{
"streamId": "streamId",
"instrumentUid": "instrumentUid",
"figi": "figi",
"subscriptionId": "subscriptionId"
}
],
"trackingId": "trackingId"
},
"lastPrice": {
"price": {
"nano": 6,
"units": "units"
},
"instrumentUid": "instrumentUid",
"figi": "figi",
"time": "2000-01-23T04:56:07.000+00:00"
}
}
Server-side stream обновлений портфеля.
Available only on servers:
Accepts the following message:
Запрос установки stream-соединения.
Запрос установки stream-соединения.
{
"accounts": [
"string"
],
"pingSettings": {
"pingDelayMs": 0
}
}
Server-side stream обновлений портфеля.
Available only on servers:
Accepts the following message:
{
"subscriptions": {
"streamId": "streamId",
"accounts": [
{
"accountId": "accountId"
},
{
"accountId": "accountId"
}
],
"trackingId": "trackingId"
},
"portfolio": {
"totalAmountBonds": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"totalAmountFutures": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"accountId": "accountId",
"totalAmountCurrencies": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"totalAmountSp": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"expectedYield": {
"nano": 6,
"units": "units"
},
"positions": [
{
"varMargin": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"instrumentType": "instrumentType",
"quantity": {
"nano": 6,
"units": "units"
},
"averagePositionPricePt": {
"nano": 6,
"units": "units"
},
"expectedYieldFifo": {
"nano": 6,
"units": "units"
},
"averagePositionPriceFifo": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"currentPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"positionUid": "positionUid",
"figi": "figi",
"quantityLots": {
"nano": 6,
"units": "units"
},
"blockedLots": {
"nano": 6,
"units": "units"
},
"averagePositionPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"blocked": true,
"instrumentUid": "instrumentUid",
"currentNkd": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"expectedYield": {
"nano": 6,
"units": "units"
}
},
{
"varMargin": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"instrumentType": "instrumentType",
"quantity": {
"nano": 6,
"units": "units"
},
"averagePositionPricePt": {
"nano": 6,
"units": "units"
},
"expectedYieldFifo": {
"nano": 6,
"units": "units"
},
"averagePositionPriceFifo": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"currentPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"positionUid": "positionUid",
"figi": "figi",
"quantityLots": {
"nano": 6,
"units": "units"
},
"blockedLots": {
"nano": 6,
"units": "units"
},
"averagePositionPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"blocked": true,
"instrumentUid": "instrumentUid",
"currentNkd": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"expectedYield": {
"nano": 6,
"units": "units"
}
}
],
"totalAmountShares": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"totalAmountEtf": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"totalAmountPortfolio": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"virtualPositions": [
{
"averagePositionPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"instrumentType": "instrumentType",
"quantity": {
"nano": 6,
"units": "units"
},
"expectedYieldFifo": {
"nano": 6,
"units": "units"
},
"averagePositionPriceFifo": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"instrumentUid": "instrumentUid",
"positionUid": "positionUid",
"currentPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"figi": "figi",
"expectedYield": {
"nano": 6,
"units": "units"
},
"expireDate": "2000-01-23T04:56:07.000+00:00"
},
{
"averagePositionPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"instrumentType": "instrumentType",
"quantity": {
"nano": 6,
"units": "units"
},
"expectedYieldFifo": {
"nano": 6,
"units": "units"
},
"averagePositionPriceFifo": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"instrumentUid": "instrumentUid",
"positionUid": "positionUid",
"currentPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"figi": "figi",
"expectedYield": {
"nano": 6,
"units": "units"
},
"expireDate": "2000-01-23T04:56:07.000+00:00"
}
],
"totalAmountOptions": {
"nano": 5,
"currency": "currency",
"units": "units"
}
},
"ping": {
"streamId": "streamId",
"pingRequestTime": "2000-01-23T04:56:07.000+00:00",
"time": "2000-01-23T04:56:07.000+00:00"
}
}
Server-side stream обновлений информации по изменению позиций портфеля.
Available only on servers:
Accepts the following message:
Запрос установки stream-соединения позиций.
Запрос установки stream-соединения позиций.
{
"accounts": [
"string"
],
"pingSettings": {
"pingDelayMs": 0
}
}
Server-side stream обновлений информации по изменению позиций портфеля.
Available only on servers:
Accepts the following message:
{
"subscriptions": {
"streamId": "streamId",
"accounts": [
{
"accountId": "accountId"
},
{
"accountId": "accountId"
}
],
"trackingId": "trackingId"
},
"ping": {
"streamId": "streamId",
"pingRequestTime": "2000-01-23T04:56:07.000+00:00",
"time": "2000-01-23T04:56:07.000+00:00"
},
"position": {
"date": "2000-01-23T04:56:07.000+00:00",
"accountId": "accountId",
"money": [
{
"availableValue": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"blockedValue": {
"nano": 5,
"currency": "currency",
"units": "units"
}
},
{
"availableValue": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"blockedValue": {
"nano": 5,
"currency": "currency",
"units": "units"
}
}
],
"options": [
{
"blocked": "blocked",
"balance": "balance",
"instrumentUid": "instrumentUid",
"positionUid": "positionUid"
},
{
"blocked": "blocked",
"balance": "balance",
"instrumentUid": "instrumentUid",
"positionUid": "positionUid"
}
],
"futures": [
{
"blocked": "blocked",
"balance": "balance",
"instrumentUid": "instrumentUid",
"positionUid": "positionUid",
"figi": "figi"
},
{
"blocked": "blocked",
"balance": "balance",
"instrumentUid": "instrumentUid",
"positionUid": "positionUid",
"figi": "figi"
}
],
"securities": [
{
"instrumentType": "instrumentType",
"blocked": "blocked",
"balance": "balance",
"instrumentUid": "instrumentUid",
"positionUid": "positionUid",
"figi": "figi",
"exchangeBlocked": true
},
{
"instrumentType": "instrumentType",
"blocked": "blocked",
"balance": "balance",
"instrumentUid": "instrumentUid",
"positionUid": "positionUid",
"figi": "figi",
"exchangeBlocked": true
}
]
}
}
Stream поручений пользователя. Перед работой прочитайте [статью](https://russianinvestments.github.io/investAPI/orders_state_stream/).
Available only on servers:
Accepts the following message:
{
"accounts": [
"string"
],
"pingDelayMs": 0
}
Stream поручений пользователя. Перед работой прочитайте [статью](https://russianinvestments.github.io/investAPI/orders_state_stream/).
Available only on servers:
Accepts the following message:
{
"ping": {
"streamId": "streamId",
"pingRequestTime": "2000-01-23T04:56:07.000+00:00",
"time": "2000-01-23T04:56:07.000+00:00"
},
"subscription": {
"streamId": "streamId",
"accounts": [
"accounts",
"accounts"
],
"error": {
"code": "code",
"message": "message"
},
"trackingId": "trackingId"
},
"orderState": {
"orderId": "orderId",
"initialOrderPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"createdAt": "2000-01-23T04:56:07.000+00:00",
"completionTime": "2000-01-23T04:56:07.000+00:00",
"lotsLeft": "lotsLeft",
"orderPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"executedOrderPrice": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"currency": "currency",
"classCode": "classCode",
"ticker": "ticker",
"amount": {
"nano": 5,
"currency": "currency",
"units": "units"
},
"lotSize": 0,
"lotsCancelled": "lotsCancelled",
"trades": [
{
"dateTime": "2000-01-23T04:56:07.000+00:00",
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
},
"tradeId": "tradeId"
},
{
"dateTime": "2000-01-23T04:56:07.000+00:00",
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
},
"tradeId": "tradeId"
}
],
"accountId": "accountId",
"lotsExecuted": "lotsExecuted",
"clientCode": "clientCode",
"lotsRequested": "lotsRequested",
"instrumentUid": "instrumentUid",
"orderRequestId": "orderRequestId",
"exchange": "exchange"
}
}
Stream сделок пользователя
Available only on servers:
Accepts the following message:
Запрос установки соединения.
Запрос установки соединения.
{
"accounts": [
"string"
],
"pingDelayMs": 0
}
Stream сделок пользователя
Available only on servers:
Accepts the following message:
{
"ping": {
"streamId": "streamId",
"pingRequestTime": "2000-01-23T04:56:07.000+00:00",
"time": "2000-01-23T04:56:07.000+00:00"
},
"subscription": {
"streamId": "streamId",
"accounts": [
"accounts",
"accounts"
],
"error": {
"code": "code",
"message": "message"
},
"trackingId": "trackingId"
},
"orderTrades": {
"createdAt": "2000-01-23T04:56:07.000+00:00",
"accountId": "accountId",
"orderId": "orderId",
"instrumentUid": "instrumentUid",
"trades": [
{
"dateTime": "2000-01-23T04:56:07.000+00:00",
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
},
"tradeId": "tradeId"
},
{
"dateTime": "2000-01-23T04:56:07.000+00:00",
"quantity": "quantity",
"price": {
"nano": 6,
"units": "units"
},
"tradeId": "tradeId"
}
],
"figi": "figi"
}
}
Запрос подписки или отписки на определённые биржевые данные.
Запрос подписки или отписки на определённые биржевые данные.
Запрос установки stream-соединения.
Запрос установки stream-соединения.
Запрос установки stream-соединения позиций.
Запрос установки stream-соединения позиций.
Запрос установки соединения.
Запрос установки соединения.
Пакет биржевой информации по подписке.
Результат изменения статус подписки на свечи.
Статус подписки на свечи.
Интервал свечи.
Результат подписки.
Результат изменения статуса подписки на стаканы.
Статус подписки.
Результат изменения статуса подписки на поток обезличенных сделок.
Статус подписки.
Типы источников сделок.
Результат изменения статуса подписки на торговый статус.
Статус подписки.
Пакет свечей в рамках стрима.
Котировка — денежная сумма без указания валюты.
Информация о сделке.
Направление сделки.
Пакет стаканов в рамках стрима.
Массив предложений/спроса.
Пакет изменения торгового статуса.
Проверка активности стрима.
Результат изменения статуса подписки на цену последней сделки.
Статус подписки на цену последней сделки.
Информация о цене последней сделки.
subscribeCandles | Изменения статуса подписки на свечи.
Тип операции со списком подписок.
Запрос изменения статус подписки на свечи.
Запрос на изменение статуса подписки на стаканы.
Запрос подписки на стаканы.
Изменение статуса подписки на поток обезличенных сделок.
Запрос подписки на поток обезличенных сделок.
Изменение статуса подписки на торговый статус инструмента.
Запрос подписки на торговый статус.
Изменение статуса подписки на цену последней сделки по инструменту.
Запрос подписки на последнюю цену.
Запрос подписки или отписки на определённые биржевые данные.
Информация по позициям и доходностям портфелей.
Объект результата подписки.
Счёт клиента.
Результат подписки.
Текущий портфель по счёту.
Денежная сумма в определённой валюте.
Позиции портфеля.
Запрос установки stream-соединения.
Информация по изменению позиций портфеля.
Объект результата подписки.
Счёт клиента.
Результат подписки.
Данные о позиции портфеля.
Валютная позиция портфеля.
Баланс позиции ценной бумаги.
Баланс фьючерса.
Баланс опциона.
Запрос установки stream-соединения позиций.
Направление операции.
Тип заявки.
Информация о сделке.
Информация о торговых поручениях.
Информация об исполнении торгового поручения.
Запрос установки соединения.