• Yes, requires OpenSSL
  • No, only Blocking mode
  • Yes, Requires Win8.+

Huobi WebSocket API

 sgcWebSockets API Huobi components

From sgcWebSockets 4.1.9 Huobi WebSocket API is supported.

Huobi is an international multi-language cryptocurrency exchange.

 

Methods

 SubscribeKLine

   K line data, including the opening price, closing price, highest price, lowest price, volume, turnover, number of transactions, etc. per unit time interval $period Optional values: { 1min, 5min, 15min, 30min, 60min, 4hour ,1day, 1mon, 1week, 1year }

 

{

  "status": "ok",

  "rep": "market.btcusdt.kline.1min",

  "tick": [

    {

      "amount": 1.6206,

      "count":  3,

      "id":     1494465840,

      "open":   9887.00,

      "close":  9885.00,

      "low":    9885.00,

      "high":   9887.00,

      "vol":    16021.632026

    },

    {

      "amount": 2.2124,

      "count":  6,

      "id":     1494465900,

      "open":   9885.00,

      "close":  9880.00,

      "low":    9880.00,

      "high":   9885.00,

      "vol":    21859.023500

    }

  ]

}

 

 

  SubscribeMarketDepth

  Handbook depth, according to different step aggregation, buy one, buy two, buy three, and sell one, sell two, sell three, etc. type Optional value: { step0, step1, step2, step3, step4, step5, percent10 } (combination depth 0-5); when step0, no depth is merged

 

{

  "ch": "market.btcusdt.depth.step0",

  "ts": 1489474082831,

  "tick": {

    "bids": [

    [9999.3900,0.0098], // [price, amount]

    [9992.5947,0.0560],

    // more Market Depth data here

    ]

    "asks": [

    [10010.9800,0.0099]

    [10011.3900,2.0000]

    //more data here

    ]

  }

}

 

 

  SubscribeTradeDetail

  Transaction record, including transaction price, volume, direction of transaction, etc.

 

{

  "ch": "market.btcusdt.trade.detail",

  "ts": 1489474082831,

  "tick": {

        "id": 14650745135,

        "ts": 1533265950234,

        "data": [

            {

                "amount": 0.0099,

                "ts": 1533265950234,

                "id": 146507451359183894799,

                "price": 401.74,

                "direction": "buy"

            },

            // more Trade Detail data here

        ]

    }

  

  ]

  }

}

  

  SubscribeMarketDetail

  Last 24 hours of volume, turnover, opening price, closing price, highest price, lowest price, number of transactions, etc.

 

{

  "rep": "market.btcusdt.detail",

  "status": "ok",

  "id": "id12",

  "tick": {

    "amount": 12224.2922,

    "open":   9790.52,

    "close":  10195.00,

    "high":   10300.00,

    "ts":     1494496390000,

    "id":     1494496390,

    "count":  15195,

    "low":    9657.00,

    "vol":    121906001.754751

  }

}

  

  SubscribeMarketTickers

  Information on the daily K line, the last 24 hours of trading, etc.