Trades

This document provides example request and subscription payloads for receiving trade data via WebSocket.

Request Message Format

To request trade data, after establishing the WebSocket connection, you must create a JSON object with the structure below and include it as a Data Type Object in the request message. For the full WebSocket data request message specification including Ticket and Format fields, please refer to the WebSocket Usage Guide document.

Field Name Type Description Required Default Value
type String trade Required
codes List:String List of trading pairs to receive.
Must be requested in uppercase.
Required
is_only_snapshot Boolean Provide snapshot trade data only Optional false
is_only_realtime Boolean Provide real-time trade data only Optional false
Check the proper endpoint based on your region.
The examples in this page is written using Singapore fiat code(SGD). Set the quote currency to match your region. The base_url differs by country/region. Make sure to specify the correct region value for your environment.

Quotation
- Singapore (sg): wss://sg-api.upbit.com/websocket/v1
- Indonesia (id): wss://id-api.upbit.com/websocket/v1
- Thailand (th): wss://th-api.upbit.com/websocket/v1

Exchange
- Singapore (sg): wss://sg-api.upbit.com/websocket/v1/private
- Indonesia (id): wss://id-api.upbit.com/websocket/v1/private
- Thailand (th): wss://th-api.upbit.com/websocket/v1/private

Examples

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

Subscription Data Specification

The current price snapshot or real-time stream data is returned as follows.

Field Name Abbreviation Description Type Example Value
typetyData TypesStringtrade
codecdTrading pair codeStringSGD-BTC
opening_priceopOpening priceDouble
high_pricehpHigh priceDouble
low_pricelpLow priceDouble
trade_pricetpCurrent trade priceDouble
prev_closing_pricepcpPrevious day closing priceDouble
changecDirection of price change compared to previous day closing priceStringRISE: Up
EVEN: Unchanged
FALL: Down
change_pricecpAbsolute value of price change compared to previous dayDouble
signed_change_pricescpSigned value of price change compared to previous dayDouble
change_ratecrAbsolute rate of change compared to previous dayDouble
signed_change_ratescrSigned rate of change compared to previous dayDouble
trade_volumetvMost recent trade volumeDouble
acc_trade_volumeatvAccumulated trade volume (UTC 0 기준)Double
acc_trade_volume_24hatv24h24-hour accumulated trade volumeDouble
acc_trade_priceatpAccumulated trade amount (UTC 0 기준)Double
acc_trade_price_24hatp24h24-hour accumulated trade amountDouble
trade_datetdtMost recent trade date (UTC)StringyyyyMMdd
trade_timettmMost recent trade time (UTC)StringHHmmss
trade_timestampttmsTrade timestamp (milliseconds)Long
ask_bidabBuy/Sell distinctionStringASK: Sell
BID: Buy
acc_ask_volumeaavAccumulated sell volumeDouble
acc_bid_volumeabvAccumulated buy volumeDouble
highest_52_week_priceh52wp52-week highest priceDouble
highest_52_week_dateh52wdt52-week highest price dateStringyyyy-MM-dd
lowest_52_week_pricel52wp52-week lowest priceDouble
lowest_52_week_datel52wdt52-week lowest price dateStringyyyy-MM-dd
trade_statustsTrading status. Deprecated; recommended to ignore.String
market_statemsMarket trading statusStringPREVIEW: Deposit supported
ACTIVE: Trading available
DELISTED: Trading ended
market_state_for_iosmsfiMarket trading status. Deprecated; recommended to ignore.String
is_trading_suspendeditsTrading suspension status. Deprecated; recommended to ignore.Boolean
delisting_dateddMarket delisting dateDate
market_warningmwMarket warning statusStringNONE: None
CAUTION: Investment caution
timestamptmsTimestamp (milliseconds)Long
stream_typestStream typeStringSNAPSHOT: Snapshot
REALTIME: Real-time

Examples

{
  "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"
}
[
  {
    "ty": "trade",
    "cd": "SGD-BTC",
    "tms": 1749471055123,
    "td": "2025-06-09",
    "ttm": "12:10:55",
    "ttms": 1749471055055,
    "tp": 138423.0,
    "tv": 1.67e-05,
    "ab": "ASK",
    "pcp": 136158.0,
    "c": "RISE",
    "cp": 2265.0,
    "sid": 1749471055055000,
    "bap": 138770,
    "bas": 0.17,
    "bbp": 138423,
    "bbs": 0.1699833,
    "st": "SNAPSHOT"
  },
  {
    "ty": "trade",
    "cd": "SGD-ETH",
    "tms": 1749470929025,
...
    "st": "SNAPSHOT"
  }
]