체결 (Trade)

Request

요청은 JSON Object를 이용하며 응답 또한 JSON Object 입니다. 요청은 크게 ticket field, type field, format field 로 나누어지며 하나의 요청에 여러 개의 type field 를 명시할 수 있습니다. ticket field 와 format field 에 대해서는 요청 방법 및 포맷을 참고해주시기 바랍니다.

📘

Request format

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

Type Field

수신하고 싶은 시세 정보를 나열하는 필드입니다.
is_only_snapshot, is_only_realtime 필드는 생략 가능하며 모두 생략시 스냅샷과 실시간 데이터 모두를 수신합니다.

필드명
타입
내용
필수 여부
기본 값
typeString데이터 타입
trade: 체결
O
codesList마켓 코드 리스트
*대문자로 요청해야 합니다.
O
is_only_snapshotBoolean스냅샷 시세만 제공Xfalse
is_only_realtimeBoolean실시간 시세만 제공Xfalse

Response

👍

best_ask_price, best_ask_size, best_bid_price, best_bid_size를 통해 최우선 매수/매도 호가와 잔량을 확인하실 수 있습니다.

*sequential_id 필드는 체결의 유일성 판단을 위한 근거로 쓰일 수 있습니다. 하지만 체결의 순서를 보장하지는 못합니다.

Example

Request

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

Response

{
  "type": "trade",
  "code": "KRW-BTC",
  "timestamp": 1730336862082,
  "trade_date": "2024-10-31",
  "trade_time": "01:07:42",
  "trade_timestamp": 1730336862047,
  "trade_price": 100473000.00000000,
  "trade_volume": 0.00014208,
  "ask_bid": "BID",
  "prev_closing_price": 100571000.00000000,
  "change": "FALL",
  "change_price": 98000.00000000,
  "sequential_id": 17303368620470000,
  "best_ask_price": 100473000,
  "best_ask_size": 0.43139478,
  "best_bid_price": 100465000,
  "best_bid_size": 0.01990656,
  "stream_type": "SNAPSHOT"
}
{
  "type": "trade",
  "code": "KRW-ETH",
  "timestamp": 1730336862120,
  "trade_date": "2024-10-31",
  "trade_time": "01:07:42",
  "trade_timestamp": 1730336862080,
  "trade_price": 3700000.00000000,
  "trade_volume": 0.02207517,
  "ask_bid": "BID",
  "prev_closing_price": 3695000.00000000,
  "change": "RISE",
  "change_price": 5000.00000000,
  "sequential_id": 17303368620800006,
  "best_ask_price": 3700000,
  "best_ask_size": 0.39101775,
  "best_bid_price": 3699000,
  "best_bid_size": 0.13499454,
  "stream_type": "SNAPSHOT"
}
※ This English version is a translation of the original Korean version of the Upbit Developer Center, generated using a third-party tool. In the event of any discrepancies, the Korean version shall take precedence.