## WebSocket API Use the public WebSocket for market data and the private WebSocket for account events: ```text wss://ws-api.korbit.co.kr/v2/public wss://ws-api.korbit.co.kr/v2/private ``` Private connections sign exactly like REST: `timestamp` and `signature` go in the URL query string; `X-KAPI-KEY` goes in the connection header. Subscribe and unsubscribe with messages of the form: ```json [ {"requestId": 1, "method": "subscribe", "type": "ticker", "symbols": ["btc_krw"]} ] ``` Data messages do not have a `status` field. Control messages do: ```json {"requestId": 1, "status": "success"} {"requestId": 1, "status": "fail", "code": "INVALID_SYMBOL", "message": "..."} {"status": "error", "message": "..."} ``` Public messages can be dropped under load — periodically reconcile against REST snapshots if correctness matters, and on reconnect refetch a fresh REST snapshot (e.g. `/v2/orderbook`) before trusting incremental updates again, since you may have missed messages while disconnected. Private messages are not dropped, but the socket can be force-closed; on reconnect, reconcile orders and balances via REST. | Channel | Auth | Purpose | |---|---|---| | [`ticker`](/llms/en/websocket_api/public.md#method-subscribe_type-ticker) | (public) | Streams latest pricing information for a symbol. | | [`orderbook`](/llms/en/websocket_api/public.md#method-subscribe_type-orderbook) | (public) | Streams orderbook data for a symbol. Up to 30 prices are available for each side. | | [`trade`](/llms/en/websocket_api/public.md#method-subscribe_type-trade) | (public) | Streams real-time trades. The subscription snapshot carries only the latest trade(s), not full trade history — use REST GET /v2/trades for recent history. | | [`myOrder`](/llms/en/websocket_api/private.md#method-subscribe_type-myOrder) | `readOrders` | Streams the changes in my orders. | | [`myTrade`](/llms/en/websocket_api/private.md#method-subscribe_type-myTrade) | `readOrders` | Streams trades on my orders. | | [`myAsset`](/llms/en/websocket_api/private.md#method-subscribe_type-myAsset) | `readBalances` | Streams changes to my balances in real time. |