WebSocket을 이용한 방식으로, 현재가, 호가, 체결에 대한 정보를 수신할 수 있습니다.

WebSocket 을 이용하여 수신할 수 있는 정보

  • 현재가(ticker)
  • 호가(orderbook)
  • 체결(transaction)

접속정보

wss://pubwss.bithumb.com/pub/ws

접속 성공 시 응답 메시지

{
    "status" : "0000",
    "resmsg" : "Connected Successfully"
}

필터 설정 응답

성공

{
    "status" : "0000", 
    "resmsg" : "Filter Registered Successfully"
}

실패

{
    "status" : "5100", 
    "resmsg" : "Invalid Filter Syntax"
}

구독 요청 형식

필드설명타입
type구독 메시지 종류("ticker" / "transaction" / "orderbookdepth")String
symbolsBTC_KRW, ETH_KRW, …Array (String)
(optional) tickTypestick 종류 ("30M"/"1H"/"12H"/"24H"/"MID")Array (String)

Example Request Parameters

  • 현재가(ticker)
{
  "type" : "ticker", 
  "symbols" : ["BTC_KRW", "ETH_KRW"], 
  "tickTypes" : ["30M", "1H", "12H", "24H", "MID"]
}
  • 체결(transaction)
{
  "type" : "transaction", 
  "symbols" : ["BTC_KRW" , "ETH_KRW"]
}
  • 변경호가(orderbookdepth)
{
  "type" : "orderbookdepth", 
  "symbols" : ["BTC_KRW" , "ETH_KRW"]
}
  • 호가 스냅샷(orderbooksnapshot)
{
  "type" : "orderbooksnapshot", 
  "symbols" : ["BTC_KRW" , "ETH_KRW"]
}

Example Response

  • 현재가(ticker)
{
    "type" : "ticker",
    "content" : {
        "symbol" : "BTC_KRW",           // 통화코드
        "tickType" : "24H",                 // 변동 기준시간- 30M, 1H, 12H, 24H, MID
        "date" : "20200129",                // 일자
        "time" : "121844",                  // 시간
        "openPrice" : "2302",               // 시가
        "closePrice" : "2317",              // 종가
        "lowPrice" : "2272",                // 저가
        "highPrice" : "2344",               // 고가
        "value" : "2831915078.07065789",    // 누적거래금액
        "volume" : "1222314.51355788",  // 누적거래량
        "sellVolume" : "760129.34079004",   // 매도누적거래량
        "buyVolume" : "462185.17276784",    // 매수누적거래량
        "prevClosePrice" : "2326",          // 전일종가
        "chgRate" : "0.65",                 // 변동률
        "chgAmt" : "15",                    // 변동금액
        "volumePower" : "60.80"         // 체결강도
    }
}
  • 체결(transaction)
{
    "type" : "transaction",
    "content" : {
        "list" : [
            {
                "symbol" : "BTC_KRW",                   // 통화코드
                "buySellGb" : "1",                          // 체결종류(1:매도체결, 2:매수체결)
                "contPrice" : "10579000",                   // 체결가격
                "contQty" : "0.01",                         // 체결수량
                "contAmt" : "105790.00",                    // 체결금액
                "contDtm" : "2020-01-29 12:24:18.830039",   // 체결시각
                "updn" : "dn"                               // 직전 시세와 비교 : up-상승, dn-하락
            }
        ]
    }
}
  • 변경호가(orderbookdepth)
{
    "type" : "orderbookdepth",
        "content" : {
        "list" : [
            {
                "symbol" : "BTC_KRW",
                "orderType" : "ask",        // 주문타입 – bid / ask
                "price" : "10593000",       // 호가
                "quantity" : "1.11223318",  // 잔량
                "total" : "3"               // 건수
            },
            {"symbol" : "BTC_KRW", "orderType" : "ask", "price" : "10596000", "quantity" : "0.5495", "total" : "8"},
            {"symbol" : "BTC_KRW", "orderType" : "ask", "price" : "10598000", "quantity" : "18.2085", "total" : "10"},
            {"symbol" : "BTC_KRW", "orderType" : "bid", "price" : "10532000", "quantity" : "0", "total" : "0"},
            {"symbol" : "BTC_KRW", "orderType" : "bid", "price" : "10572000", "quantity" : "2.3324", "total" : "4"},
            {"symbol" : "BTC_KRW", "orderType" : "bid", "price" : "10571000", "quantity" : "1.469", "total" : "3"},
            {"symbol" : "BTC_KRW", "orderType" : "bid", "price" : "10569000", "quantity" : "0.5152", "total" : "2"}
        ],
        "datetime":1580268255864325     // 일시
    }
}
  • 호가 스냅샷(orderbooksnapshot)
{
    "type": "orderbooksnapshot",
    "content": {            //매수,매도 30호가 제공
        "symbol": "BTC_KRW",
        "datetime": "1680082623245840",
        "asks": [
            [
                "37458000", //호가
                "0.9986"    //잔량
            ],
            ["37461000","0.0487"],
            ["37462000","0.9896"],
            ["37464000","0.2296"],
            ["37466000","0.1075"]
        ],
        "bids": [
            [
                "37452000",
                "0.0115"
            ],
            ["37450000","0.0614"],
            ["37448000","0.0991"],
            ["37447000","0.0002"],
            ["37445000","0.1249"]
        ]
    }
}