Tickers

This document provides example request and subscription payloads for receiving ticker(current price) data via WebSocket.

WebSocket Endpoint

TypeEndpoint
Publicwss://{region}-api.upbit.com/websocket/v1

Use the endpoint for your region.

RegionEndpoint
Singaporewss://sg-api.upbit.com/websocket/v1
Indonesiawss://id-api.upbit.com/websocket/v1
Thailandwss://th-api.upbit.com/websocket/v1

Request Message Format

To request announcement data, after establishing a WebSocket connection, create a JSON Object with the structure below and include it as a Data Type Object in the request message.

For the complete WebSocket request message specification, including the Ticket and Format Objects, refer to the WebSocket Usage and Error Guide.

Field NameTypeDescriptionRequiredDefault
typeStringData type to receive. Set to ticker to receive ticker data.Required
codesList:StringList of trading pairs to receive.
Must be requested in uppercase.
Required
is_only_snapshotBooleanProvide snapshot data onlyOptionalfalse
is_only_realtimeBooleanProvide real-time data onlyOptionalfalse
formatStringData format to receive.

DEFAULT: Default format.
SIMPLE: Simplified format with abbreviated field names.
JSON_LIST: List format.
SIMPLE_LIST: List format with abbreviated field names.
Required

Subscription Data Specification

When a new announcement is published or an existing announcement is updated, real-time stream data is returned as follows.

Field NameAbbreviationDescriptionTypeValue Example
typetyData TypesStringticker
codecdTrading pair codeStringSGD-BTC
opening_priceopOpening priceDouble
high_pricehpHigh priceDouble
low_pricelpLow priceDouble
trade_pricetpCurrent priceDouble
prev_closing_pricepcpPrevious day closing priceDouble
changecPrice change direction compared to previous day closingStringRISE: Rise
EVEN: Even
FALL: Fall
change_pricecpAbsolute price change compared to previous dayDouble
signed_change_pricescpSigned 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 (from UTC 0)Double
acc_trade_volume_24hatv24hAccumulated trade volume over last 24 hoursDouble
acc_trade_priceatpAccumulated trade value (from UTC 0)Double
acc_trade_price_24hatp24hAccumulated trade value over last 24 hoursDouble
trade_datetdtLatest trade date (UTC)StringyyyyMMdd
trade_timettmLatest trade time (UTC)StringHHmmss
trade_timestampttmsTrade timestamp (ms)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
market_statemsTrading statusStringPREVIEW: Deposit supported
ACTIVE: Trading available
DELISTED: Trading ended
is_trading_suspendeditsTrading suspension status (Deprecated - recommended to ignore)Boolean
delisting_dateddTrading end dateDate
market_warningmwMarket warning status (Deprecated - recommended to ignore)StringNONE: None
CAUTION: Investment caution
timestamptmsTimestamp (ms)Long
stream_typestStream typeStringSNAPSHOT: Snapshot
REALTIME: Real-time

Examples

Subscription Request Example

[
  {
    "ticket": "0e66c0ac-7e13-43ef-91fb-2a87c2956c49"
  },
  {
    "type": "ticker",
    "codes": ["SGD-BTC","SGD-ETH"]
  },
  {
    "format": "DEFAULT"
  }
]

Subscription Data Example

{
  "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, // or "delisting_date" : {"year":2025,"month":10,"day":1}
  "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, // or "delisting_date" : {"year":2025,"month":10,"day":1}
  "market_warning": "NONE",
  "timestamp": 1693383750023,
  "acc_trade_price_24h": 4342.50350959,
  "acc_trade_volume_24h": 1.88473642,
  "stream_type": "REALTIME"
}

Error Information

If an error occurs after establishing a WebSocket connection and sending a request, the response is returned in the following JSON format.

{
  "error": {
    "name": "ERROR_CODE",
    "message": "ERROR_MESSAGE"
  }
}

The main error codes that may be returned are listed below.

error.nameReasonRecommended Action
INVALID_AUTHMissing authentication information or authentication token verification failureWhen using a Private WebSocket endpoint, make sure you are connected to the correct endpoint and that the Authorization header contains a valid authentication token.
WRONG_FORMATInvalid request message formatMake sure the request message follows the WebSocket request format. Check the Object structure as well as the type and value of each field.
NO_TICKETMissing ticket fieldMake sure the request message includes a Ticket Object and the ticket field.
NO_TYPEMissing type fieldMake sure the Data Type Object includes the type field and specify the data type to subscribe to.
NO_CODESMissing codes fieldCheck whether the subscribed data type requires the codes field and specify the trading pair codes to receive.
INVALID_PARAMMissing required request field or unsupported valueMake sure all required fields are included and that each field contains a supported value.
Too Many RequestsRequest rate limit exceededWait until another request can be made, then retry. Refer to the Rate Limits section for details.
I'm a teapotRequests are temporarily restricted due to repeated Too Many Requests errorsCheck the restriction period included in the response and retry after the specified time has passed.

Rate Limits

APIs are grouped into Rate Limit groups. APIs within the same group share the same per-second request limit.

The maximum number of requests allowed per Rate Limit group may change after prior notice according to service policy, and additional restrictions may be applied depending on service conditions. For details, refer to Rate Limits.

Rate Limit GroupPolicyApplied By
websocket-connectUp to 5 connections per secondIP
websocket-messageUp to 5 messages per second and 100 messages per minuteConnection

Managing WebSocket Rate Limits

Unlike REST API responses, WebSocket does not provide the number of remaining requests. Clients should track the number of WebSocket connection attempts and data request messages they send to ensure compliance with the applicable rate limits. If a rate limit is reached, wait for an appropriate period before sending another request..