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 |
---|---|---|---|---|
type | String | data type - trade : Transaction | O | |
codes | List | Market code list *Must be requested in capital letters. | O | |
is_only_snapshot | Boolean | Only provides snapshot data | X | false |
is_only_realtime | Boolean | Only provides real-time data | X | false |
Response
Field Name | Simplified Format (format: SIMPLE) | Description | Type | Value |
---|---|---|---|---|
type | ty | Type | String | trade |
code | cd | Market code (ex. SDG-BTC) | String | |
trade_price | tp | Trade price | Double | |
trade_volume | tv | Trade volume | Double | |
ask_bid | ab | Order type | String | ASK BID |
prev_closing_price | pcp | Previous closing price | Double | |
change | c | Change price type compared to the previous day's closing price | String | RISE EVEN FALL |
change_price | cp | Unsigned change price compared to the previous day's closing price | Double | |
trade_date | td | Trade date (UTC) | String | yyyy-MM-dd |
trade_time | ttm | Trade time (UTC) | String | HH:mm:ss |
trade_timestamp | ttms | Trade timestamp (millisecond) | Long | |
timestamp | tms | Timestamp (millisecond) | Long | |
sequential_id | sid | Trade sequential ID (Unique) | Long | |
stream_type | st | Stream type | String | SNAPSHOT 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,
"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,
"stream_type": "REALTIME"
}