Market Data

Stream real-time order books, trading charts, price data, and market summaries with live bid/ask updates

Get order book

Connection

URL
/marketdata/v5/info?access_token={YOUR_ACCESS_TOKEN}

arguments array

The connection parameters.

In the first element, provide the accountId as a string.

In the second element, provide the marketId as a string.

invocationId string

The invocation identifier.

Must be unique and increase by 1 for each sent message.

target string

The stream name.

Specify "Book".

type int

The operation type.

Set to 4 to indicate a subscription to the stream.

Example
{
  "arguments": [
    "67d0456f8c7b1108e4cf5d46",
    "cfd.eur_chf"
  ],
  "invocationId": "0",
  "target": "Book",
  "type": 4
}

Message

type string

The operation type.

2 indicates the streaming is in progress.

invocationId string

The invocation identifier. Same as in the request.

item object

The dataset object.

item.instrument string

The market identifier, in the following format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.

item.askTotalAmount string

The total ask amount.

item.bidTotalAmount string

The total bid amount.

item.asks array of objects

The array of ask price objects.

item.asks.price string

The price, in the quote asset.

item.asks.amount string

The total amount of the base asset available at a corresponding price level.

item.asks.total string

The total amount, in the quote asset, required to fully execute the orders at a corresponding price level.

item.bids array of objects

The array of bid price objects.

item.bids.price string

The price, in the quote asset.

item.bids.amount string

The total amount of the base asset available at a corresponding price level.

item.bids.total string

The total amount, in the quote asset, required to fully execute the orders at a corresponding price level.

item.version string

The order book version.

item.snapshot boolean

The data snapshot.

If snapshot: true, it indicates the message contains the full dataset. Subsequent messages with snapshot: false only include updates or changes since the initial snapshot.

Example
{
  "type": 2,
  "invocationId": "0",
  "item": {
    "instrument": "cfd.eur_chf",
    "askTotalAmount": "18700000",
    "bidTotalAmount": "19100000",
    "asks": [
      {
        "price": "0.93677",
        "amount": "5000000",
        "total": "4683850"
      },
      {
        "price": "0.93676",
        "amount": "0",
        "total": "0"
      },
      {
        "price": "0.93676",
        "amount": "0",
        "total": "0"
      }
    ],
    "bids": [
      {
        "price": "0.93654",
        "amount": "0",
        "total": "0"
      },
      {
        "price": "0.93654",
        "amount": "0",
        "total": "0"
      },
      {
        "price": "0.93655",
        "amount": "5000000",
        "total": "4682750"
      }
    ],
    "version": "12498",
    "snapshot": false
  }
}

Get trading data

Connection

URL
/marketdata/v5/info?access_token={YOUR_ACCESS_TOKEN}

arguments array

The connection parameters.

In the first element, provide the accountId as a string.

In the second element, provide a list of marketIds as an array of strings.

invocationId string

The invocation identifier.

Must be unique and increase by 1 for each sent message.

target string

The stream name.

Specify "TradingData".

type int

The operation type.

Set to 4 to indicate a subscription to the stream.

Example
{
  "arguments": [
    "67d0456f8c7b1108e4cf5d46",
    [
      "spot.bnb_btc"
    ]
  ],
  "invocationId": "0",
  "target": "TradingData",
  "type": 4
}

Message

type string

The operation type.

2 indicates the streaming is in progress.

invocationId string

The invocation identifier. Same as in the request.

item object

The dataset object.

item.markets array of objects

The array of market objects.

item.markets.marketId string

The market identifier, in the following format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.

item.markets.type string

The market type.

Possible values:

  • Spot

  • Cfd

  • Perp

item.markets.displayName string

The market ticker.

item.markets.fullName string

The market full name or description (optional).

item.markets.price decimal string

The current top-of-the-book price, in the quote asset.

item.markets.priceInRAT decimal string

The current top-of-the-book price, in conversion to the root asset of the platform.

item.markets.priceChange24hr decimal string

The price change over the last 24 hours, in percents.

This value is calculated as ((Current price – Price 24h ago) / Current price) × 100.

item.markets.priceChangeAbs24hr decimal string

The price change over the last 24 hours.

This value is calculated as Current price – Price 24h ago.

item.markets.highPrice24hr decimal string

The highest trade price over the last 24 hours.

item.markets.lowPrice24hr decimal string

The lowest trade price over the last 24 hours.

item.markets.markPrice decimal string

Applicable to Perpetual markets only.

The mid-spread price, in conversion to RAT.

item.markets.fundingRate decimal string

Applicable to Perpetual markets only.

The current funding rate.

item.snapshot boolean

The data snapshot.

If snapshot: true, it indicates the message contains the full dataset. Subsequent messages with snapshot: false only include updates or changes since the initial snapshot.

Example
{
  "type": 2,
  "invocationId": "0",
  "item": {
    "markets": [
      {
        "marketId": "cfd.eur_chf",
        "type": "Cfd",
        "displayName": "cfd.eur_chf",
        "fullName": "",
        "price": "0.93586",
        "priceInRAT": "1",
        "priceChange24hr": "-0.0006",
        "priceChangeAbs24hr": "-0.00049",
        "highPrice24hr": "0.93695",
        "lowPrice24hr": "0.93134",
        "markPrice": null,
        "fundingRate": null
      }
    ],
    "snapshot": false
  }
}

Get top of the book

Connection

arguments array

The connection parameters.

In the first element, provide the accountId as a string.

In the second element, provide a list of marketIds as an array of strings.

invocationId string

The invocation identifier.

Must be unique and increase by 1 for each sent message.

target string

The stream name.

Specify "Tob".

type int

The operation type.

Set to 4 to indicate a subscription to the stream.


Message

type string

The operation type.

2 indicates the streaming is in progress.

invocationId string

The invocation identifier. Same as in the request.

item object

The dataset object.

item.markets array of objects

The array of market objects.

item.markets.marketId string

The market identifier, in the following format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.

item.markets.ask decimal string

The top-of-the-book ask price.

item.markets.bid decimal string

The top-of-the-book bid price.

item.snapshot boolean

The data snapshot.

If snapshot: true, it indicates the message contains the full dataset. Subsequent messages with snapshot: false only include updates or changes since the initial snapshot.

Get trading chart

Connection

arguments array

The connection parameters.

In the first element, provide the accountId as a string.

In the second element, provide the marketId and timescale as a string.

invocationId string

The invocation identifier.

Must be unique and increase by 1 for each sent message.

target string

The stream name.

Specify "Chart".

type int

The operation type.

Set to 4 to indicate a subscription to the stream.


Message

type string

The operation type.

2 indicates the streaming is in progress.

invocationId string

The invocation identifier. Same as in the request.

item object

The dataset object.

item.instrument string

The market identifier, in the following format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.

item.low decimal string

The lowest base asset price within the specified time interval.

item.high decimal string

The highest base asset price within the specified time interval.

item.open decimal string

The base asset price at the beginning of the specified time interval.

item.close decimal string

The base asset price at the end of the specified time interval.

item.start dateTime

The beginning of the specified time interval, in ISO 8601 format.

item.end dateTime

The end of the specified time interval, in ISO 8601 format.

Get market summary

Connection

arguments array

The connection parameters.

In the first element, provide the accountId as a string.

In the second element, provide a list of marketIds as an array of strings.

invocationId string

The invocation identifier.

Must be unique and increase by 1 for each sent message.

target string

The stream name.

Specify "Summary".

type int

The operation type.

Set to 4 to indicate a subscription to the stream.


Message

type string

The operation type.

2 indicates the streaming is in progress.

invocationId string

The invocation identifier. Same as in the request.

item object

The dataset object.

item.items array of objects

The array of data objects.

item.items.marketId string

The market identifier, in the following format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.

item.items.last decimal string

The price of the last trade.

item.items.high24hr decimal string

The highest trade price over the last 24 hours.

item.items.low24hr decimal string

The lowest trade price over the last 24 hours.

item.items.percentChange decimal string

The price change over the last 24 hours, in percents.

This value is calculated as ((Current price – Price 24h ago) / Current price) × 100.

item.snapshot boolean

The data snapshot.

If snapshot: true, it indicates the message contains the full dataset. Subsequent messages with snapshot: false only include updates or changes since the initial snapshot.

Last updated