Hoppa till huvudinnehållet
Den webbläsare du använder stöds inte längre. Klicka här för att se vilka rekommenderade webbläsare som stöds.

Nordnet External Feeds (Feeds) are real-time feeds to be used together with the Nordnet External API (API). There are two feed components: Public Feed and Private Feed. Public Feed allows a client to receive a stream of market data in real-time for all markets and products available on the Nordnet platform. Private Feed is an event stream where order and trade notifications are sent. For more information please visit the Nordnet External API product page.

A client interacts with the Feeds by sending commands to a Feed specific hostname and port (see below). The client sets up an SSL connection to the host and port for the Feed that it wishes to receive events from and can then send commands over this connection. All commands sent to Feeds must be JSON-encoded and terminated by a linefeed (ASCII 10) character.

In order to protect from overload situations there are limits enforced for the number of commands per second and the number of commands per 30 seconds. When a first threshold is reached the server will send an error event to the client and start to drop incoming messages. If the client surpasses a second threshold the connection will be closed by the server. While the exact limits are not specified, a client wishing to send many thousand commands in a short period of time should spread them out in time so that no more than a few hundred are sent per second.

Logging In to a Feed

To get access to Feeds the client has to perform a successful login to the API. For complete instructions on how to login, see the Getting started guide. The response on a successful login will contain hostnames and ports to use for interacting with the Feeds. It also contains a session_key which is needed when sending commands to the Feeds.

In order to start using a Feed the user needs to send a login command over the connection to it.

Login request format:

Key Value JSON Type

"cmd"

"login".

String

"args"

See below.

Object

Args:

Key Mandatory JSON Type

"session_key"

Yes.

String. See HTTP POST login/verify request.

Here is an example of a login request:

{
  "cmd": "login",
  "args": {
    "session_key": "ABC123"
  }
}

Note that all requests sent must be terminated by a linefeed (ASCII 10) character.

Heartbeat Events

A heartbeat is sent when no events are published on the stream, at an interval of five seconds.

Key Value JSON Type

"type"

"heartbeat".

String

"data"

Empty.

Object

For example:

{
  "type": "heartbeat",
  "data": {}
}

Error Events

When the processing of a command results in an error, an error event is sent to the client.

Key Value JSON Type

"type"

"err".

String

"data"

See below.

Object

The data field contains details about the error.

Key Value JSON Type

"msg"

Message describing the error.

String

"cmd"

The client command that failed.

Object

For example:

{
  "type":"err",
  "data": {
    "msg":"Not authorized.",
    "cmd": {
      "cmd":"subscribe",
      "args": {
        "t":"price",
        "m":111,
        "i":"101"
      }
    }
  }
}

Private Feed

Private Feed is an event stream which pushes notifications for the various events described below. All events related to a user account will be sent. The following sections describe the structure of the messages sent over Private Feed.

Order Notification Events

An order notification is sent when an order on one of the client’s accounts is sent, deleted, or modified. These will always be sent once the user has logged in to the Private Feed, no subscription is necessary.

Key Value JSON Type

"type"

"order".

String

"data"

See HTTP GET orders request.

Object

For example:

{
  "type": "order",
  "data": {
    "volume": 111.0,
    "price": {
      "value": 132.55,
      "currency": "SEK"
    },
    "volume_condition": "NORMAL",
    "order_id": 202178767,
    "reference": "ABC132",
    "tradable": {
      "market_id": 11,
      "identifier": "101"
    },
    "validity": {
      "type": "DAY",
      "valid_until": 1613061300000
    },
    "accno": 123123,
    "accid": 1,
    "side": "BUY",
    "modified": 1612955053717,
    "activation_condition": {
      "type": "NONE"
    },
    "order_state": "LOCAL",
    "action_state": "INS_PEND",
    "order_type": "LIMIT"
  }
}

Trade Notification Events

A trade notification is sent when a trade is completed.

Key Value JSON Type

"type"

"trade".

String

"data"

See HTTP GET trades request.

Object

Public Feed

Public Feed is a real-time market data feed. In order to get events from Public Feed the client must first send subscribe commands. There are six message types a client can subscribe to.

  • Trade - all trades on the market.

  • Price - last, best bid, best ask and so on.

  • Depth - the orderbook price depth in five levels.

  • Trading status - the state of an orderbook (e.g continuous trading, stopped, etc).

  • Indicator - price information of indicators.

  • News - news items in real-time.

Subscribe/Unsubscribe Requests

Subscribe requests allows a client to ask for a stream related to an instrument, indicator etc.

Key Value JSON Type

"cmd"

"subscribe" or "unsubscribe".

String

"args"

See below.

Object

Args:

Key Mandatory Value JSON Type

"t"

Yes.

Type: "price", "depth", "trade", "indicator", "news" or "trading_status".

String

"m"

No.

The tradable market_id or indicator src. Used for "price", "depth", "trade", "indicator" and "trading_status". If the type is an "indicator" the field is a string otherwise it is an integer.

String or number

"i"

No.

The tradable or indicator identifier. Used in "subscribe" commands for "price", "depth", "trade", "indicator" and "trading_status".

String

"s"

No.

News source. Only used in "subscribe" commands for "news".

Number

"delay"

No.

(Deprecated) true if delayed news are accepted. Default is false. Used only in "subscribe" commands for "news".

Boolean

For example, in order to subscribe to price events for the instrument with identifier "101" in market 11 the following command should be sent:

{
  "cmd": "subscribe",
  "args": {
    "t": "price",
    "m": 11,
    "i": "101"
  }
}

See below for more examples.

Public Feed Events

The messages sent from the server have the following structure

Key Value JSON Type

"type"

"price", "depth", "trade", "indicator", "news", "trading_status" or "heartbeat".

String

"data"

Depends on type.

Object

Price Events

In the first message after a subscription, all available fields are sent to the client. In subsequent events only the "m" , "i" and changed fields are sent. In other words, first a full tick is sent which is followed by delta ticks only. Note that all fields are not available on all markets.

Key Value JSON Type

"i"

The identifier of the tradable.

String

"m"

The market_id of the tradable.

Number

"delayed"

Delay of the priceinformation in seconds for the tradable. Only sent if it is greater than 0.

Number

"trade_timestamp"

Timestamp of the last trade - the time when last and turnover fields are updated.

Number

"tick_timestamp"

The timestamp of this update.

Number

"bid"

Best bid price.

Number

"bid_volume"

Total volume of the best bid price.

Number

"ask"

Best ask price.

Number

"ask_volume"

Total volume of the best ask price.

Number

"close"

Closing price.

Number

"high"

Highest price for a trade today.

Number

"last"

Last paid.

Number

"last_volume"

Volume of the last trade.

Number

"low"

Lowest price for a trade today.

Number

"open"

Opening price.

Number

"vwap"

Volume Weighted Average Price.

Number

"turnover"

Turnover value today. The currency is the orderbook currency.

Number

"turnover_volume"

Turnover volume today.

Number

"ep"

Equilibrium price. Only sent during auction on the Nordic markets.

Number

"paired"

The paired quantity of shares at the equilibrium price. Only sent during auction on the Nordic markets.

Number

"imbalance"

The quantity of shares not paired at the equilibrium price. Positive quantity indicates buy imbalance. Negative quantity indicates sell imbalance. Only sent during auction on the Nordic markets.

Number

"extended_last"

Last price in a trading session outside of the regular trading session. Only sent for markets that support it.

Number

Trade Events

The trade feed contains public trade information.

Key Value JSON Type

"i"

The identifier of the tradable.

String

"m"

The market_id of the tradable.

Number

"trade_timestamp"

The time of the trade.

Number

"price"

The price of the trade in the default currency of the orderbook.

Number

"volume"

Volume traded.

Number

"broker_buying"

Buying participant. Not supported on all markets.

String

"broker_selling"

Selling participant. Not supported on all markets.

String

"trade_id"

The exchange trade identifier. Not supported on all markets.

String

"trade_type"

The exchange trade type - differs between markets.

String

Order Depth Events

In the first message after a subscription all available fields are sent to the client. After that only the "m" , "i" and changed fields are sent.

Key Value JSON Type

"i"

The identifier of the tradable.

String

"m"

The market_id of the tradable.

Number

"tick_timestamp"

The timestamp of this update.

Number

"bid1"

Bid price on level 1.

Number

"bid_volume1"

Bid volume on level 1.

Number

"bid_orders1"

Number of bid orders on level 1.

Number

"ask1"

Ask price on level 1.

Number

"ask_volume1"

Ask volume on level 1.

Number

"ask_orders1"

Number of ask orders on level 1.

Number

"bid2"

Bid price on level 2.

Number

"bid_volume2"

Bid volume on level 2.

Number

"bid_orders2"

Number of bid orders on level 2.

Number

"ask2"

Ask price on level 2.

Number

"ask_volume2"

Ask volume on level 2.

Number

"ask_orders2"

Number of ask orders on level 2.

Number

"bid3"

Bid price on level 3.

Number

"bid_volume3"

Bid volume on level 3.

Number

"bid_orders3"

Number of bid orders on level 3.

Number

"ask3"

Ask price on level 3.

Number

"ask_volume3"

Ask volume on level 3.

Number

"ask_orders3"

Number of ask orders on level 3.

Number

"bid4"

Bid price on level 4.

Number

"bid_volume4"

Bid volume on level 4.

Number

"bid_orders4"

Number of bid orders on level 4.

Number

"ask4"

Ask price on level 4.

Number

"ask_volume4"

Ask volume on level 4.

Number

"ask_orders4"

Number of ask orders on level 4.

Number

"bid5"

Bid price on level 5.

Number

"bid_volume5"

Bid volume on level 5.

Number

"bid_orders5"

Number of bid orders on level 5.

Number

"ask5"

Ask price on level 5.

Number

"ask_volume5"

Ask volume on level 5.

Number

"ask_orders5"

Number of ask orders on level 5.

Number

Trading Status Events

Key Value JSON Type

"i"

The identifier of the tradable.

String

"m"

The market_id of the tradable.

Number

"tick_timestamp"

Timestamp of the update

Number

"status"

The Nordnet trading status of an orderbook.

  • "C" - Continuous trading.
  • "R" - Receiving orders but trading is disabled.
  • "D" - Temporarily disabled.
  • "X" - Permanently disabled.
  • "U" - Unknown state.

String

"source_status"

The marketplace orderbook state.

String

"halted"

The halted reason if available from the market.

String

"orderbook_status"

Normalized orderbook status across markets. Possible values:

  • "PRE_TRADING"
  • "OPENING_AUCTION"
  • "CONTINUOUS_TRADING"
  • "INTRADAY_AUCTION"
  • "CLOSING_AUCTION"
  • "POST_TRADING"
  • "CLOSED"
  • "SUSPENDED_OR_HALTED"
  • "UNKNOWN"

String

Indicator Events

Key Value JSON Type

"i"

Index identification.

String

"m"

Index source.

String

"tick_timestamp"

Timestamp of the last update

Number

"high"

Highest price today.

Number

"low"

Lowest price today.

Number

"last"

Last price.

Number

"close"

Last close price.

Number

News Events

Key Value JSON Type

"news_id"

News item identifier (64 bit unsigned integer) can be used in the news rest service to get the whole news item.

Number

"lang"

The language of the news.

String

"timestamp"

The time of the news.

Number

"source_id"

News source identifier.

Number

"headline"

Headline of the news.

String

"instruments"

Array of instruments involved in the news. This is only set if the news source provides the information.

Array of Number

"type"

The type of the news.

String

Tick types

There are two types of ticks: delta and full. The full tick is the full JSON Object with every field present. This is in contrast to a delta tick for which the JSON Object will only include changed fields.

Examples of Subscribe Commands and Corresponding Events

Price Subscription

{
  "cmd": "subscribe",
  "args": {
    "t": "price",
    "m": 11,
    "i": "101"
  }
}

Corresponding event:

{
  "type": "price",
  "data": {
    "ask": 78.9,
    "ask_volume": 7,
    "bid": 0.0,
    "bid_volume": 0,
    "close": 74.02,
    "high": 78.44,
    "i": "101",
    "id": 16750901,
    "last": 78.0,
    "last_volume": 10,
    "low": 78.0,
    "m": 11,
    "open": 78.44,
    "tick_timestamp": 1726742910932,
    "trade_timestamp": 1726732083524,
    "turnover": 369616.0,
    "turnover_volume": 4720,
    "vwap": 78.41
  }
}

Order Depth Subscription

{
  "cmd": "subscribe",
  "args": {
    "t": "depth",
    "i": "1869",
    "m": 30
  }
}

Corresponding event:

{
  "type": "depth",
  "data": {
    "i": "1869",
    "m": 30,
    "tick_timestamp": 1560168002590,
    "bid1": 21,
    "bid_volume1": 100,
    "bid_orders1": 1,
    "ask1": 35,
    "ask_volume1": 300,
    "ask_orders1": 1
  }
}

Indicator Subscription

{
  "cmd": "subscribe",
  "args": {
    "t": "indicator",
    "i": "SIX-IDX-DJI",
    "m": "SIX"
  }
}

Corresponding event:

{
  "type": "indicator",
  "data": {
    "delayed": 900,
    "i": "SIX-IDX-DJI",
    "m": "SIX",
    "tick_timestamp": 1560168002590,
    "high": 0,
    "low": 0,
    "close": 25983.94,
    "last": 25983.94
  }
}

News Subscription

{
  "cmd": "subscribe",
  "args": {
    "t": "news",
    "s": 1
  }
}

Corresponding event:

{
  "type": "news",
  "data": {
    "news_id": 2001079727,
    "source_id": 1,
    "headline": "TRATON: KEPLER CHEUVREUX SÄNKER RIKTKURSEN TILL 32 EUR (33)",
    "lang": "sv",
    "type": "NEWS",
    "timestamp": 1727419271000,
    "instruments": [17654899,17623444,17985327]
  }
}

Disclaimer

There can be changes made to the structure and naming in the data provided, and this can happen at any time without any prior notice. For more information visit the product page.