This document provides example request and subscription payloads for receiving ticker(current price) data via WebSocket.
Request Message Format
To request ticker 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 | ticker |
Required | |
codes | List:String | List of trading pairs to receive. Must be requested in uppercase. |
Required | |
is_only_snapshot | Boolean | Provide snapshot ticker data only | Optional | false |
is_only_realtime | Boolean | Provide real-time ticker 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
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": "0e66c0ac-7e13-43ef-91fb-2a87c2956c49"
},
{
"type": "ticker",
"codes": ["SGD-BTC","SGD-ETH"]
},
{
"format": "DEFAULT"
}
]
[
{
"ticket": "0e66c0ac-7e13-43ef-91fb-2a87c2956c49"
},
{
"type": "ticker",
"codes": ["SGD-BTC","SGD-ETH"]
},
{
"format": "SIMPLE_LIST"
}
]
Subscription Data Specification
The ticker snapshot or real-time stream data is returned in the following format.
Field Name | Abbreviation | Description | Type | Value Example |
---|---|---|---|---|
type | ty | Data Types | String | ticker |
code | cd | Trading pair code | String | SGD-BTC |
opening_price | op | Opening price | Double | |
high_price | hp | High price | Double | |
low_price | lp | Low price | Double | |
trade_price | tp | Current price | Double | |
prev_closing_price | pcp | Previous day closing price | Double | |
change | c | Price change direction compared to previous day closing | String | RISE : RiseEVEN : EvenFALL : Fall |
change_price | cp | Absolute price change compared to previous day | Double | |
signed_change_price | scp | Signed price change compared to previous day | Double | |
change_rate | cr | Absolute rate of change compared to previous day | Double | |
signed_change_rate | scr | Signed rate of change compared to previous day | Double | |
trade_volume | tv | Most recent trade volume | Double | |
acc_trade_volume | atv | Accumulated trade volume (from UTC 0) | Double | |
acc_trade_volume_24h | atv24h | Accumulated trade volume over last 24 hours | Double | |
acc_trade_price | atp | Accumulated trade value (from UTC 0) | Double | |
acc_trade_price_24h | atp24h | Accumulated trade value over last 24 hours | Double | |
trade_date | tdt | Latest trade date (UTC) | String | yyyyMMdd |
trade_time | ttm | Latest trade time (UTC) | String | HHmmss |
trade_timestamp | ttms | Trade timestamp (ms) | Long | |
ask_bid | ab | Buy/Sell distinction | String | ASK : SellBID : Buy |
acc_ask_volume | aav | Accumulated sell volume | Double | |
acc_bid_volume | abv | Accumulated buy volume | Double | |
highest_52_week_price | h52wp | 52-week highest price | Double | |
highest_52_week_date | h52wdt | 52-week highest price date | String | yyyy-MM-dd |
lowest_52_week_price | l52wp | 52-week lowest price | Double | |
lowest_52_week_date | l52wdt | 52-week lowest price date | String | yyyy-MM-dd |
trade_status | ts | Trading status (Deprecated - recommended to ignore) | String | |
market_state | ms | Trading status | String | PREVIEW : Deposit supportedACTIVE : Trading availableDELISTED : Trading ended |
market_state_for_ios | msfi | Trading status (Deprecated - recommended to ignore) | String | |
is_trading_suspended | its | Trading suspension status (Deprecated - recommended to ignore) | Boolean | |
delisting_date | dd | Trading end date | Date | |
market_warning | mw | Market warning status | String | NONE : NoneCAUTION : Investment caution |
timestamp | tms | Timestamp (ms) | Long | |
stream_type | st | Stream type | String | SNAPSHOT : SnapshotREALTIME : Real-time |
Examples
{
"type": "ticker",
"code": "SGD-BTC",
"opening_price": 37249,
"high_price": 37645,
"low_price": 36732,
"trade_price": 36929,
"prev_closing_price": 37235,
"acc_trade_price": 5530.55648491,
"change": "FALL",
"change_price": 306,
"signed_change_price": -306,
"change_rate": 0.0082180744,
"signed_change_rate": -0.0082180744,
"ask_bid": "ASK",
"trade_volume": 0.00006314,
"acc_trade_volume": 0.149474,
"trade_date": "20230830",
"trade_time": "082105",
"trade_timestamp": 1693383665811,
"acc_ask_volume": 0.0197006,
"acc_bid_volume": 0.1297734,
"highest_52_week_price": 42710,
"highest_52_week_date": "2023-07-06",
"lowest_52_week_price": 21332,
"lowest_52_week_date": "2022-11-21",
"market_state": "ACTIVE",
"is_trading_suspended": false,
"delisting_date": null,
"market_warning": "NONE",
"timestamp": 1693383690031,
"acc_trade_price_24h": 8320.40577449,
"acc_trade_volume_24h": 0.22569412,
"stream_type": "SNAPSHOT"
}
...
{
"type": "ticker",
"code": "SGD-ETH",
"opening_price": 2347,
"high_price": 2349,
"low_price": 2306,
"trade_price": 2334,
"prev_closing_price": 2347,
"acc_trade_price": 1532.79257748,
"change": "FALL",
"change_price": 13,
"signed_change_price": -13,
"change_rate": 0.0055389859,
"signed_change_rate": -0.0055389859,
"ask_bid": "BID",
"trade_volume": 0.00206817,
"acc_trade_volume": 0.65951195,
"trade_date": "20230830",
"trade_time": "082206",
"trade_timestamp": 1693383726250,
"acc_ask_volume": 0.34334474,
"acc_bid_volume": 0.31616721,
"highest_52_week_price": 2856,
"highest_52_week_date": "2023-04-16",
"lowest_52_week_price": 1479.5,
"lowest_52_week_date": "2022-11-22",
"market_state": "ACTIVE",
"is_trading_suspended": false,
"delisting_date": null,
"market_warning": "NONE",
"timestamp": 1693383750023,
"acc_trade_price_24h": 4342.50350959,
"acc_trade_volume_24h": 1.88473642,
"stream_type": "REALTIME"
}
[
{
"ty": "ticker",
"cd": "SGD-BTC",
"op": 136530.0,
"hp": 138833.0,
"lp": 135365.0,
"tp": 138518.0,
"pcp": 136158.0,
"atp": 764.43574921,
"c": "RISE",
"cp": 2360.0,
"scp": 2360.0,
"cr": 0.0173328045,
"scr": 0.0173328045,
"ab": "ASK",
"tv": 2.291e-05,
"atv": 0.00560341,
"tdt": "20250609",
"ttm": "120753",
"ttms": 1749470873725,
"aav": 0.00288426,
"abv": 0.00271915,
"h52wp": 149844.0,
"h52wdt": "2025-01-20",
...
"st": "SNAPSHOT"
}
]