Request
Requests use JSON Objects and responses are also in JSON Object format. The request is mainly divided into ticket field, type field, and format field. You can specify multiple type fields in a single request. For details on the ticket field and format field, please refer to Request Method and Format.
Request format
[{Ticket Field},{Type Field},....,{Type Field},{Format Field}]
Type Field
This is a field for listing the market data you want to receive.
The fields isOnlySnapshot and isOnlyRealtime are optional. If both are omitted, you will receive both snapshot and real-time data.
/Field Name | Type | Description | Requirement | Default |
---|---|---|---|---|
type | String | Data type - ticker | O | |
codes | List | Market code *Request in C. | O | |
isOnlySnapshot | Boolean | Provides only quote snapshot market data. | X | false |
isOnlyRealtime | Boolean | Provides only real-time market data. | X | false |
Response
Field Name | Simplified Format (format: SIMPLE) | Description | Type | Value |
---|---|---|---|---|
type | ty | Type | String | trade |
code | cd | Market code (ex. KRW-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 example"
},
{
"type": "trade",
"codes": [
"KRW-BTC",
"KRW-ETH"
]
},
{
"format": "DEFAULT"
}
]
Response
{
"type": "trade",
"code": "KRW-BTC",
"timestamp": 1676965220452,
"trade_date": "2023-02-21",
"trade_time": "07:40:20",
"trade_timestamp": 1676965220395,
"trade_price": 32292000,
"trade_volume": 0.03096742,
"ask_bid": "BID",
"prev_closing_price": 31883000.00000000,
"change": "RISE",
"change_price": 409000.00000000,
"sequential_id": 1676965220395000,
"stream_type": "SNAPSHOT"
}