Request

The requests is consisted of JSON Object and the response is also JSON Object. Requests are divided into ticket field, type field, and format field, and multiple type fields can be specified in one request. Please refer to Request method and format for ticket field and format field.

📘

Request format

[{Ticket Field},{Type Field},....,{Type Field},{Format Field}]

Type Field

In this field, you have to list the market data you want to receive.

"is_only_snapshot" and "is_only_realtime" fields are optional and both snapshot and real-time data will be received if they are omitted.

Field Name
Type
Description
Required
Default
typeStringdata type
trade: Transaction
O
codesListMarket code list
*Must be requested in capital letters.
O
is_only_snapshotBooleanOnly provides snapshot dataXfalse
is_only_realtimeBooleanOnly provides real-time dataXfalse

Response

👍

Information regarding the best bid and ask at the trade event has been added.

You can get the best bid/ask prices and sizes through the fields best_ask_price, best_ask_size, best_bid_price, and best_bid_size.

Field Name
Simplified Format (format: SIMPLE)
Description
TypeValue
typetyTypeStringtrade
codecdMarket code (ex. SDG-BTC)String
trade_pricetpTrade priceDouble
trade_volumetvTrade volumeDouble
ask_bidabOrder typeStringASK

BID
prev_closing_pricepcpPrevious closing priceDouble
changecChange price type compared to the previous day's closing priceStringRISE

EVEN

FALL
change_pricecpUnsigned change price compared to the previous day's closing priceDouble
trade_datetdTrade date (UTC)Stringyyyy-MM-dd
trade_timettmTrade time (UTC)StringHH:mm:ss
trade_timestampttmsTrade timestamp (millisecond)Long
timestamptmsTimestamp (millisecond)Long
sequential_idsidTrade sequential ID (Unique)Long
best_ask_pricebapBest ask priceDouble
best_ask_sizebasBest ask sizeDouble
best_bid_pricebbpBest bid priceDouble
best_bid_sizebbsBest bid sizeDouble
stream_typestStream typeStringSNAPSHOT

REALTIME

*The sequential_id field can be used as the basis for assessing the uniqueness of a trade. However, this does not guarantee trade order.

Example

Request

[
  {
    "ticket": "test"
  },
  {
    "format": "DEFAULT"
  },
  {
    "type": "trade",
    "codes": [
      "SGD-BTC",
      "SGD-ETH"
    ]
  }
]

Response

{
  "type": "trade",
  "code": "SGD-BTC",
  "timestamp": 1696585056910,
  "trade_date": "2023-10-06",
  "trade_time": "09:37:36",
  "trade_timestamp": 1696585056846,
  "trade_price": 37625,
  "trade_volume": 8.428e-05,
  "ask_bid": "ASK",
  "prev_closing_price": 37296,
  "change": "RISE",
  "change_price": 329,
  "sequential_id": 1696585056846000,
  "best_ask_price": 32293000,
  "best_ask_size": 0.04414411,
  "best_bid_price": 32291000,
  "best_bid_size": 0.01202163,
  "stream_type": "SNAPSHOT"
}
...
{
  "type": "trade",
  "code": "SGD-ETH",
  "timestamp": 1696585254027,
  "trade_date": "2023-10-06",
  "trade_time": "09:40:53",
  "trade_timestamp": 1696585253974,
  "trade_price": 2224,
  "trade_volume": 0.00210894,
  "ask_bid": "ASK",
  "prev_closing_price": 2192,
  "change": "RISE",
  "change_price": 32,
  "sequential_id": 1696585253974000,
  "best_ask_price": 32293000,
  "best_ask_size": 0.04414411,
  "best_bid_price": 32291000,
  "best_bid_size": 0.01202163,
  "stream_type": "REALTIME"
}