Skip to content

053state

haipo yang edited this page Jul 16, 2018 · 2 revisions

Market status API

  • Acquire market status

#Example

#Request
{
  "method":"state.query",
  "params":[
    "BTCBCH",           #1.market: See<API invocation description·market> 
    86400,              #2. cycle period,Integer, e.g. 86400 for last 24 hours
  ],
  "id":15
}

#Response
{
  "error": null, 
  "result": {
     "close":"430.33", #close price
     "deal":"1574489.5181782117",  #value
     "high":"445.68", #highest price
     "last":"430.33", #latest price
     "low":"420.32",  #lowest price
     "open":"434.11", #open price
     "period":86400,  #cycle period
     "volume":"3624.85992531" #volume
  },
  "id": 15
 }
  • Subscribe market 24H status

#Example

#Request

{
  "method":"state.subscribe",
  "params":[
    "ETHUSDT",               #1.empty for subscribe all, market: See<API invocation description·market> 
  ],
  "id":15
}

#notify
{
  "method": "state.update", 
  "params": [
       {
        "ETHUSDT": {
           "close":"430.33", #close price
           "deal":"1574489.5181782117",  #value
           "high":"445.68", #highest price
           "last":"430.33", #latest price
           "low":"420.32",  #lowest price
           "open":"434.11", #open price
           "period":86400,  #cycle period
           "volume":"3624.85992531" #volume
        },
    }
  ], 
  "id": 15
}

HTTP API Introduction

Common API

Market API

Account API

Trading API

Margin API

Contract API

WebSocket API Introduction

Clone this wiki locally