繁體中文

OpenEX logo

General API Information Edit

  • The following base endpoints are available:
    • http base Url:https://api-mk.openex.xyz/
    • wss base Url:wss://ws-mk.openex.xyz/
  • All endpoints return either a JSON object or array.
  • All time and timestamp related fields are in milliseconds.
  • If there is an error, the API will return an error with a message of the reason.
    • Specific error codes and messages are defined in Error Codes

Basic Information Edit

  • Request Header
  • Signature

Request Header Parameters

 

Parameter name Description
apiKey api request authentication mark token
businessType 1 : U Contract,
2 : Coin Standard
signature the secretKey and timestamp corresponding to the token are used as the key of HMAC SHA256 in the format of secretKey+timestamp, and all other parameters are used as the operation objects of HMAC SHA256, and the output obtained is the signature.

Signature Encryption

Encrypt the request parameters using HMAC SHA256 algorithm secretKey+timestamp as salt, and place the encrypted data in the signature attribute of the header

Time Window

Network conditions are not reliable and cannot be fully relied on, so add the recvWindow time window. When high-frequency transaction is performed, the requirements for timeliness are higher and the user sets the value of recvWindow according to needs so as to meet the requirements

{
 "apiKey": "f23f58c04ac5439d8406e2e9e3rcc26f",
 "businessType": 1,
 "signature": "a7c4a3e4224db9bc31da7bd1a0095cb8d1f07d2d1cf1460aa4f83e055892a07d"
}
 if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {     //Logic after passing   } else {     // Logic that doesn't pass   }

List of Transfer Accounts Edit

Single User Accounts List

  • URL:/spot/v1/account/list
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Description Type Required or not Constraints
coin Currency name String Yes For example:"USDT"
recvWindow Timestamp sliding window, how many milliseconds before and after the timestamp request is valid integer No  
timestamp Calling time Long Yes  
{
    "code": 1,
    "data": [
        {
            "type": "usdt", // Business Type usdt:U-standard contract account,spot:spot account,withdraw:Coin charging and withdrawal account
            "coin": "USDT", // Currency
            "amount": "1330.3704832" // Transferable amount
        },
        {
            "type": "spot",
            "coin": "USDT",
            "amount": "998937.3452574978"
        },
        {
            "type": "withdraw",
            "coin": "USDT",
            "amount": "9515878.623"
        }
    ]
}
{
 "code": 9999,
 "message": "Exception!"
}

Account Transfers Edit

Transfer of funds between single user accounts

  • URL:/spot/v1/account/transfer
  • Method:POST
  • Authentication required:Yes

Request Parameters

Parameter name Description Type Required or not Constraints
type Transfer out account String Yes Currently supported types of transfers:

"usdt-to-withdraw":
From U-standard contract account to Coin charging and withdrawal account,

"withdraw-to-usdt":
From U-standard contract account to Coin charging and withdrawal account,

"spot-to-withdraw":
From spot account to Coin charging and withdrawal account,

"withdraw-to-spot":
From Coin charging and withdrawal account to spot account,

"usdt-to-spot":
From U-standard to spot account,

"spot-to-usdt":
From spot to U-standard account
coin Currency of account transfer String Yes Refer to the currency list interface.
amount Amount of account transfer Decimal Yes Numbers greater than 0
recvWindow Timestamp sliding window, how many milliseconds before and after the timestamp request is valid integer No  
timestamp Calling time Long Yes  
{
  "type":"withdraw-to-usdt",
  "coin":"USDT",
  "amount":120
}
{
    "code": 1,
    "message": "",
    "data": true
}
{
 "code": 9998,
 "message": "Parameter requested error: type"
}

Transfer Records Edit

Single-user Transfer Records

  • URL:/spot/v1/account/transfer/history
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Description Type Required or not Constraints
startTime Start timestamp Long No 1 : USDT contract,
3 : Spot goods,
4 : Coin charging and withdrawal
endTime End timestamp Long No 1 : USDT contract,
3 : Spot goods,
4 : Coin charging and withdrawal
coin Currency of account transfer String Yes  
fromId The id of the last data in the last list Long No The first page is null, and the other pages must have values
limit Number of entries per page Integer Yes Integers greater than 0 and less than or equal to 100
signature Yes String Yes  
timestamp Calling time Long Yes  
{
    "code": 1,
    "data": [
        {
            "id": 1709,
            "type": "withdraw-to-usdt",
            "coin": "USDT",
            "amount": "120",
            "status": 1, // 1:success 0:To be processed
            "reason": "", // Cause of failure
            "createTime": 1657179001000
        },
        {
            "id": 1686,
            "type": "withdraw-to-spot",
            "coin": "USDT",
            "amount": "1000",
            "status": 1,  
            "reason": "",  
            "createTime": 1657173979000
        }
    ]
}
{
 "code": 9999,
 "message": "Exception!"
}

Single Business Account Assets Edit

Single-user single business account assets

  • URL:/spot/v1/account/assets/detail
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Description Type Required or not Constraints
convertCoin Asset display currency String No Default
"USDT"
type Account type String Yes "usdt":U-standard contract account,
"spot":spot account,
"withdraw":coin charging and withdrawal account
recvWindow Timestamp sliding window, how many milliseconds before and after the timestamp request is valid integer No  
timestamp Calling time integer Yes  
{
    "code": 1,
    "data": {
        "type": "usdt", // Business Type usdt:USDT contract,swaps:Coin standard contract,spot:spot
        "convertCoin": "BTC", // Presentation of currency
        "assetsAsXXX": "0.065127782241623264", // Total assets(Convert to display currency)
        "assetsAsUSDT": "1330.3704832", // Total assets(convert USDT)
        "detailAssetsList": [
            {
                "coin": "USDT", // currency
                "assets": "1330.3704832", // assets(unconverted)
                "holdAssets": "0", // Frozen assets(unconverted)
                "availableBalance": "1330.3704832", // Available balance of orders
                "maxWithdrawAmount": "1330.3704832", // Maximum withdrawable balance
                "convertCoin": "BTC",
                "assetsAsXXX": "0.065127782241623264", // assets(Convert to display currency)
                "assetsAsUSDT": "1330.3704832", // assets(convert USDT)
                "holdAssetsAsXXX": "0", // Frozen assets(Convert to display currency)
                "holdAssetsAsUSDT": "0" // Frozen assets(convert USDT)
            }
        ]
    }
}

Order Placing Edit

  • URL:/spot/v1/trade/order
  • Method:POST
  • Authentication required:Yes

Request Parameters

Parameter name Type Required or not Description
symbol String Yes Transaction pair
side Enum Yes "BUY" : Buying direction,
"SELL" : Selling direction
type Enum Yes Order Type:
"LIMIT", "MARKET"
quantity BigDecimal Yes Number of orders placed
price BigDecimal No Commissioning Price
clientOrderId String No Currently support for market marker account only.
It must be a combination of case-sensitive alphanumerics, up to 32 characters
recvWindow Long No Timestamp sliding window in milliseconds
timestamp Long Yes Calling time
{
 "symbol": "BTC/USDT",
 "side": "BUY",
 "type": "LIMIT",
 "quantity": 10,
 "price": 100.01
 "recvWindow": 0,
 "timestamp": 0,
}
{
 "code": 1,
 "data": [
   {
     "orderId": 1229231381528581//Order id
   }
 ],
 "message": ""
}
{
 "code": 9999,
 "message": "Exception!"
}

Bulk Orders Edit

  • URL:/spot/v1/trade/batchOrders
  • Method:POST
  • Authentication required:Yes

Request example

Parameter name Type Required or not Description
batchOrders List<OrderRequest> YES Order list, supporting up to 5 orders
recvWindow Long NO Timestamp sliding window in milliseconds
timestamp Long YES Calling time

OrderRequest

Parameter name Type Required or not Description
symbol String Yes  
side Enum Yes "BUY" : Buying direction,
"SELL" : Selling direction
type Enum Yes Required when closing a position:
"LIMIT", "MARKET"
quantity BigDecimal Yes Number of orders placed
price BigDecimal No Commissioning Price
clientOrderId String No Currently support for market marker account only.
It must be a combination of case-sensitive alphanumerics, up to 32 characters
{
 "batchOrders": [{
   "symbol": "BTC/USDT",
   "type": "LIMIT",
   "quantity": 10,
   "price": 100.01
  }],
 "recvWindow": 5000,
 "timestamp": 1657162729000
}
{
 "code": 1,
 "data": [
   {
     "orderId": 1229231381528581,
     "clientOrderId": "newClientOrderId0001"
   },
   {
     "orderId": 1229231381528582,
     "clientOrderId": "newClientOrderId0002"
   }
 ],
 "message": ""
}
{
 "code": 9999,
 "message": "Exception!"
}

Cancellation of Orders Edit

  • URL:/spot/v1/trade/order
  • Method:DELETE
  • Authentication required:Yes

Note:

  1. For the request, either orderId or clientOrderId was required. If both parameters was pass in, only orderId will be used.

Request Parameters

Parameter name Type Required or not Description
symbol String Yes Transaction pair
orderId Long Conditional Order number
clientOrderId String Conditional Currently support for market marker account only.
It must be a combination of case-sensitive alphanumerics, up to 32 characters
recvWindow Long No Timestamp sliding window in milliseconds
timestamp Long Yes Calling time
{
 "symbol": "BTC/USDT",
 "orderId": 1229231391899653,
 "recvWindow": 5000,
 "timestamp": 1657162729000
}
{
 "code": 1,
 "data": true,
 "message": ""
}
{
 "code": 9999,
 "message": "Exception!"
}

Bulk Cancellation of Orders Edit

  • URL:/spot/v1/trade/batchOrders
  • Method:DELETE
  • Authentication required:Yes

Note:

  1. For the request, either orderIdList or clientOrderIdList was required. If both parameters was pass in, only orderIdList will be used.

Request Parameters

Parameter name Type Required or not Description
symbol String Yes Transaction pair
orderIdList List<Long> Conditional Collection of order numbers
clientOrderIdList List<String> Conditional Collection of client order id.
Currently support for market marker account only.
For each clientOrderId, it must be a combination of case-sensitive alphanumerics, up to 32 characters
recvWindow Long No Timestamp sliding window in milliseconds
timestamp Long Yes Calling time
/spot/v1/trade/batchOrders?symbol=BTC/USDT&orderIdList=1229231391899653,1229231391899654&recvWindow=5000&timestamp=1657162729000
{
 "code": 1,
 "data": true,
 "message": ""
}
{
 "code": 9999,
 "message": "Exception!"
}

Cancellation of All Orders Edit

  • URL:/spot/v1/trade/allOpenOrders
  • Method:DELETE
  • Authentication required:Yes

Request Parameters

Parameter name Type Required or not Description
symbol String YES Transaction pair
recvWindow Long NO Timestamp sliding window in milliseconds
timestamp Long YES Calling time
{
 "symbol": "BTC/USDT",
 "recvWindow": 5000,
 "timestamp": 1657162729000
}
{
 "code": 1,
 "data": true,
 "message": ""
}
{
 "code": 9999,
 "message": "Exception!"
}

Transaction History Edit

  • URL:/spot/v1/trade/userTrades
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Type Required or not Description
symbol String YES Transaction pair
fromId Long NO Return the fromId and subsequent transactions. The default is to return the most recent transaction.
limit Integer NO The number of result sets returned,
default : 200,
maximum : 1000
startTime Long YES Start time
endTime Long YES End time
recvWindow Long NO Timestamp sliding window in milliseconds
timestamp Long YES Calling time
{
 "symbol": "ETH/USDT",
 "fromId": 1208218841498181,
 "limit": 200,
 "startTime": 1654840101939,
 "endTime": 1655099837239,
 "timestamp": 1655099837259,
 "recvWindow": 5000
}
{
 "code": 1,
 "data": [{
   "id": 1229231370945733, //Transaction idid
   "orderId": 1229231370027013, //Order number
   "symbol": "ETH/USDT", //Transaction pair
   "price": "1133.97", //Transaction price
   "qty": "1", //Trading volume
   "realizedPnl": "1.280800714285714285", //Realize profit and loss
   "commission": "0.01700955", 
   "commissionAsset": "USDT", //Commission unit
   "side": "SELL", //Buying and selling direction
   "positionSide": "LONG", //Position direction
   "time": 1657162731000 
  }],
 "message": ""
}
{
 "code": 9999,
 "message": "Exception!"
}

Inquiry for Commissioned Orders Edit

  • URL:/spot/v1/trade/openOrder
  • Method:GET
  • Authentication required:Yes

Note:

  1. For the request, either orderId or clientOrderId was required. If both parameters was pass in, only orderId will be used.

Request Parameters

Parameter name Type Required or not Description
symbol String Yes Transaction pair
orderId Long Conditional Order number
clientOrderId String Conditional Currently support for market marker account only.
It must be a combination of case-sensitive alphanumerics, up to 32 characters
recvWindow Long No Timestamp sliding window in milliseconds
timestamp Long Yes Calling time
{
 "symbol": "ETH/USDT",
 "orderId": 1208218841498181,
 "timestamp": 1655099837259,
 "recvWindow": 5000
}
{
 "code": 1,
 "data": {
   "orderId": 1229231334670341,
   "symbol": "ETH/USDT",//Transaction pair
   "type": "LIMIT",//Order Type:LIMIT,MARKET
   "price": "1089.58",//The price or market price entered by the user
   "avgPrice": "0",//Average transaction price
   "side": "BUY",//Buying and selling direction:BUY,SELL
    "positionSide": "LONG",//Position direction:LONG,SHORT
   "origQty": "1",//Original order quantity
   "executedQty": "0",//Transaction quantity
   "status": "NEW",//Order status,NEW:order,PARTIALLY_FILLED:Partial transaction,FILLED:Close the deal,CANCELED:revoked
   "createTime": 1657162729000,
   "updateTime": 1657162729000
  }
}
{
 "code": 9999,
 "message": "Exception!"
}

Inquiry for all commissioned orders Edit

  • URL:/spot/v1/trade/openOrders
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Type Required or not Description
symbol String NO Transaction pair
recvWindow Long NO Timestamp sliding window in milliseconds
timestamp Long YES Calling time
{
 "symbol": "ETH/USDT",
 "timestamp": 1655099837259,
 "recvWindow": 5000
}
{
 "code": 1,
 "data": [{
   "orderId": 1229231334670341,
   "symbol": "ETH/USDT",//Transaction pair
   "type": "LIMIT",//Order Type:LIMIT,MARKET
   "price": "1089.58",//The price or market price entered by the user
   "avgPrice": "0",//Average transaction price
   "side": "BUY",//Buying and selling direction:BUY,SELL
    "positionSide": "LONG",//Position direction:LONG,SHORT
   "origQty": "1",//Original order quantity
   "executedQty": "0",//Transaction quantity
   "status": "NEW",//Order status,NEW:order,PARTIALLY_FILLED:Partial transaction,FILLED:Close the deal,CANCELED:revoked
   "createTime": 1657162729000,
   "updateTime": 1657162729000
  }]
}
{
 "code": 9999,
 "message": "Exception!"
}

Currency list Edit

  • URL:/spot/v1/coins
  • Method:GET
  • Authentication required:No

Request Parameters

None

{
 "code": 1,
 "data": [{
   "coin": ETH,//Currency
   "isDeposit": 1,//Whether to charge coins,1 Yes,0 No
   "isWithdraw": 1,//Whether to support coin withdrawal,1 Yes,0 No
   "status": 0//status,1:effective ,0 void
  }],
 "message": ""
}
{
 "code": 9999,
 "message": "Exception!"
}

Transaction Pairs List Edit

  • URL:/spot/v1/trade/symbols
  • Method:GET
  • Authentication required:No

Request Parameters

None

{
 "code": 1,
 "data": [{
   "symbol": "BTC/USDT",//Transaction pair
   "coin": "BTC",//Measuring currency
   "quoteCoin": "USDT",//Denomination currency
   "coinScale": 2,//Measure coins in decimal places
   "quoteCoinScale": 2,//Denomination decimal place
   "status": 1//status:1:enable,0:deactivate
  }]
}
{
 "code": 9999,
 "message": "Exception!"
}

System Time Edit

  • URL:spot/v1/time
  • Method:GET
  • Authentication required:No

Request Parameters

None

{
 "code": 1,
 "data": {
    "serverTime": 1657173423730//System Time
  }
}
{
 "code": 9999,
 "message": "Exception!"
}

Depth Edit

  • URL:/spot/v1/market/depth?symbol=EOS/USDT
  • Method:GET

Request Parameters

Parameter Type Required or not Description
symbol String true Coin pair
{
  "code": 1,
  "data": {
    "symbol": "EOS/USDT",//Coin pair
    "bids": [ //
      [
        "1.999",//Price
        "9592"//Quantity
      ]
    ],
    "asks": [
      [
        "2.6",
        "1"
      ],
      [
        "2.55",
        "4840"
      ]
      
    ]
  },
  "message": "SUCCESS"
}
{
  "code": 0,
  "data": null,
  "message": "FAILURE"
}

Real-time Transactions Edit

  • URL:/spot/v1/market/realTime?symbol=EOS/USDT
  • Method:GET

Request Parameters

Parameter Type Required or not Description
symbol String true Coin pair
{
  "code": 1,
  "data": [
    {
      "size": "1",
      "price": "1.999",
      "side": 2,//direction 1:buy 2:sell
      "time": 1650274754613,
      "symbol": "EOS/USDT"
    },
    {
      "size": 1,
      "price": 2.55,
      "side": 1,
      "time": 1650274751574,
      "symbol": "EOS/USDT"
    },
    {
      "size": 1,
      "price": 2.55,
      "side": 1,
      "time": 1650274719644,
      "symbol": "EOS/USDT"
    }
  ],
  "message": "SUCCESS"
}
{
  "code": 0,
  "data": null,
  "message": "FAILURE"
}

K Line Edit

  • URL:/spot/v1/market/kline
  • Method:GET

Request Parameters

Parameter Type Required or not Description
symbol String true Coin pair
type Integer true Cycle Type :
0 : 1 min, 2 : 5 min, 3 : 15 min,
4 : 30 min, 5 : 1 hour, 7 : 4 hour,
10 : 1 day, 11 : 1 week, 12 : 1 month,
13 : 1 year
since Long true k-line start timestamp accurate to the minute(1650016682000)
end Long true k-line end timestamp accurate to the minute
{
  "code": 1,
  "data": [
    {
      "open": "40373.2",
      "high": "40391.82",
      "low": "40372.84",/
      "close": "40391.72",
      "volume": "0.0522",//Transaction number
      "amount": "2107.840752",//turnover
      "type": 0,//Cycle Type
      "time": 1650096180000,
      "symbol": "BTC/USDT"
    }
  ]
  "message": "SUCCESS"
}
{
  "code": 0,
  "data": null,
  "message": "FAILURE"
}

24-hour Market Conditions Edit

  • URL:/spot/v1/market/ticker?symbol=BTC/USDT
  • Method:GET

Request Parameters

Parameter Type Required or not Description
symbol String true Coin pair
{
  "code": 1,
  "data": {
    "time": "1650278049804",
    "last": "39056.18",//price
    "change": "-3.43",//ups and downs
    "symbol": "BTC/USDT",
    "open": "40421.94",
    "high": "40593.22",//24-hour maximum price
    "low": "38538.02",//24-hour minimum price
    "volume": "182.40568",//Trading volume
    "amount": "7223419.4784845"
  },
  "message": "SUCCESS"
}
{
  "code": 0,
  "data": null,
  "message": "FAILURE"
}

24-hour Market Conditions (lot size) Edit

  • URL:/spot/v1/market/ticker/list
  • Method:POST

Request Parameters

Parameter Type Required or not Description
symbolArray String[] true Coin pair
{
	"symbolArray": ["BTC/USDT","EOS/USDT"]
}
{
  "code": 1,
  "data": [
    {
      "time": "1650269906549",//时间
      "last": "38989",//价格
      "change": "-3.56",//涨跌幅
      "symbol": "BTC/USDT"//币对
    },
    {
      "time": "1650274754627",
      "last": "1.999",
      "change": "-21.61",
      "symbol": "EOS/USDT"
    }
  ],
  "message": "SUCCESS"
}
{
  "code": 0,
  "data": null,
  "message": "FAILURE"
}

Latest Price Edit

  • URL:/spot/v1/market/ticker/last?symbol=EOS/USDT
  • Method:GET

Request Parameters

Parameter Type Required or not Description
symbol String true Coin pair
{
  "code": 1,
  "data": {
    "time": "1650274754627",
    "last": "1.999",//price
    "symbol": "EOS/USDT"
  },
  "message": "SUCCESS"
}
{
  "code": 0,
  "data": null,
  "message": "FAILURE"
}

Basic Information Edit

  • The connections are as follows:
    • Base Url:wss://ws-mk.openex.xyz
    • The URL format is /spot
  • Heartbeat rules:
    • Number of heartbeats/30s
    • User end sending:{"event":"ping"}
    • Service end receipt:{"event":"pong"}

      public code
      (the type field is the subscription type)
       
      Subscribe successfully {"code":1,"desc":"success","type":"MARKET"}
      Event type does not exist {"code":10001,"desc":"Non-existent event types","type":"MARKET"}
      Request json format error {"code":10000,"desc":"json format error","type":"MARKET"}

Index Edit

{
	"event": "SUB",
	"type": "INDEX_PRICE",
	"symbol": "BTC/USDT"
}
{
	"event": "UNSUB",
	"type": "INDEX_PRICE",
	"symbol": "BTC/USDT"
}
{
  "symbol": "BTC/USDT",
  "type": "INDEX_PRICE",
  "data": "40658.981000000",
  "ts": 1650352557873
}
{
	"code": 1,
	"desc": "success",
	"topic": {
		"event": "SUB",
		"type": "INDEX_PRICE_ALL",
		"symbols": "BTC/USDT,ETH/USDT"
	}
}

Index (lot size) Edit

{
	"event": "SUB",
	"type": "INDEX_PRICE_ALL",
	"symbols": "BTC/USDT,ETH/USDT"
}
{
	"event": "UNSUB",
	"type": "INDEX_PRICE_ALL"
}
{
	"type": "INDEX_PRICE_ALL",
	"data": [{
		"symbol": "BTC/USDT",
		"price": "20547.103000000"
	}, {
		"symbol": "ETH/USDT",
		"price": "1095.646000000"
	}],
	"ts": 1655971790464
}
{
	"code": 1,
	"desc": "success",
	"topic": {
		"event": "SUB",
		"type": "INDEX_PRICE_ALL",
		"symbols": "BTC/USDT,ETH/USDT"
	}
}

Depth Edit

{
	"event": "SUB",
	"type": "DEPTH",
	"symbol": "BTC/USDT"
}
{
	"event": "UNSUB",
	"type": "DEPTH",
	"symbol": "BTC/USDT"
}
{
	"symbol": "BTC/USDT",
	"type": "DEPTH",
	"data": {
		"asks": [//asks (Ascending order)sell subscript 0 price,1 quantity
			["40592", "1.33301"],
			["40593", "1.02589"],
			["40594", "0.17704"],
			["40595", "0.1593"],
			["40596", "1.15614"]
		],
		"bids": [//bids (Descending order)buy
			["40497", "0.62148"],
			["40498", "0.47407"],
			["40499", "1.05067"],
			["40500", "0.26455"],
			["40501", "0.78471"],
			["40502", "0.44409"],
		]
	},
	"ts": 1650352632920
}
{
	"code": 1,
	"desc": "success",
	"topic": {
		"event": "SUB",
		"type": "DEPTH",
		"symbol": "BTC/USDT"
	}
}

24-hour market conditions Edit

{
	"event": "SUB",
	"type": "TICKER",
	"symbol": "BTC/USDT"
}
{
	"event": "UNSUB",
	"type": "MARKET",
	"symbol": "BTC/USDT"
}
{
	"symbol": "BTC/USDT",
	"type": "TICKER",
	"data": {
		"amount": "12041429.0669052",//Trading volume
		"change": "3.62",//ups and downs
		"high": "41258.86",//
		"last": "40680.6",//Latest price
		"low": "38538.02",
		"open": "38821.7",//Opening price
		"time": "1650347625464",
		"volume": "301.7915"//Trading volume
	},
	"ts": 1650347625841
}
{
	"code": 1,
	"desc": "success",
	"topic": {
		"event": "SUB",
		"type": "TICKER",
		"symbol": "BTC/USDT"
	}
}

K line Edit

periods:k-line type

"1min":0

"5min": 2

"15min":3

"30min":4

"1hour":5

"4hour":7

"1day":10

"1week":11

"1month":12

"1year":13

Multiple k-line types separated by commas

{
	"event": "SUB",
	"type": "KLINE",
	"symbol": "BTC/USDT",
	"params": {
		"periods": "0,2"
	}
}

{
	"event": "UNSUB",
	"type": "KLINE",
	"symbol": "BTC/USDT"
}
{
	"symbol": "BTC/USDT",
	"type": "KLINE",
	"data": [{
		"open": "40716.4",
		"high": "40716.6",
		"low": "40702.8",
		"close": "40702.8",
		"volume": "0.00735",
		"amount": "299.24742",
		"type": 0,
		"time": 1650352200000
	}],
	"ts": 1650352218714
}
{
	"code": 1,
	"desc": "success",
	"topic": {
		"event": "SUB",
		"type": "KLINE",
		"params": {
			"periods": "0,2"
		},
		"symbol": "BTC/USDT"
	}
}

Real-time transactions Edit

{
	"event": "SUB",
	"type": "TRADE",
	"symbol": "BTC/USDT"
}
{
	"event": "UNSUB",
	"type": "TRADE",
	"symbol": "BTC/USDT"
}
{
	"symbol": "BTC/USDT",
	"type": "TRADE",
	"data": [{
		"size": "0.0003",//quantity
		"price": "40711.4",
		"side": 1,//Buying and selling direction 1:buy 2:sell
		"time": 1650352384250
	}],
	"ts": 1650352384312
}
{
	"code": 1,
	"desc": "success",
	"topic": {
		"event": "SUB",
		"type": "TRADE",
		"symbol": "BTC/USDT"
	}
}

Recharge address inquiry Edit

  • URL:/spot/v1/capital/deposit/address
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Type Required or not Description
coin String YES Currency
chain String NO Chain name
signature String YES Signature
timestamp Long YES Calling time
{
    "coin": "USDT",
    "timestamp": 1656913877424,
    "recvWindow": 5000
}
{
    "code": 1,
    "data": [
        {
            "coin": "USDT",
            "chain": "BEP20",
            "address": "0x01feea3cbb1c12ff0357751b134e574x8d1b4x85",
            "addressTag": ""
        },
        {
            "coin": "USDT",
            "chain": "TRC20",
            "address": "T9yT4UUY3m2s182XwRwVYHckrR5Acxs6Fb",
            "addressTag": ""
        }
    ]
}
{
    "code": 9202,
    "message": "The currency cannot be empty"
}

Recharge Record Edit

  • URL:/spot/v1/capital/deposit/history
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Type Required or not Description
coin String YES Currency
startTime Long NO Start time
endTime Long NO End time
fromId Long NO Query start ID
limit Integer NO Query record size
signature String YES Signature
timestamp Long YES Calling time
{
    "coin": "USDT",
    "timestamp": 1656913877424,
    "recvWindow": 5000
}
{
    "code": 1,
    "data": [
        {
            "id": 1100828149039493,
            "coin": "USDT",
            "amount": "100",
            "address": "18600531753",
            "addressTag": "",
            "txId": "1100828109930501",
            "createTime": 1657188020000
        }
    ]
}
{
    "code": 9202,
    "message": "The currency cannot be empty"
}

Coin Withdrawal Record Edit

  • URL:/v1/capital/withdraw/history
  • Method:GET
  • Authentication required:Yes

Request Parameters

Parameter name Type Required or not Description
coin String YES Currency
startTime Long NO Start time
endTime Long NO End time
fromId Long NO Query start ID
limit Integer NO Query record size
signature String YES Signature
timestamp Long YES Calling time

Coin Withdrawal Status

  • 0 : Under audit
  • 1 : Audit completed
  • 2 : Successful coin withdrawal
  • 3 : Audit Failure
  • 4 : Coin withdrawal failure
  • 5 : Coin withdrawal cancellation
  • 6 : On-chain processing in progress
  • 7 : On-chain processing completed
  • 8 : On-chain processing failure
{
    "coin": "USDT",
    "timestamp": 1656913877424,
    "recvWindow": 5000
}
{
    "code": 1,
    "data": [
        {
            "id": 1189938193498373,
            "coin": "USDT",
            "amount": "10",
            "address": "TA778a8koXvHPHmhM1rjwUd1rECFdT3LXX",
            "addressTag": "",
            "txId": "1234556",
            "createTime": 1654764465575,
            "status": 2
        },
        {
            "id": 1189935202320645,
            "coin": "USDT",
            "amount": "6",
            "address": "TA778a8koXvHPHmhM1rjwUd1rECFdT3LXX",
            "addressTag": "",
            "createTime": 1654764283009,
            "status": 4
        },
        {
            "id": 1189931341644037,
            "coin": "USDT",
            "amount": "5",
            "address": "TA778a8koXvHPHmhM1rjwUd1rECFdT3LXX",
            "addressTag": "",
            "createTime": 1654764047370,
            "status": 5
        }
    ]
}
{
    "code": 9201,
    "message": "The interval cannot exceed 90 days"
}

Error Codes Edit

error code message
287 RPC error
9001 Invalid business type
9002 Invalid symbol
9003 Invalid side
9004 Invalid positionSide
9005 Invalid orderType
9006 Invalid price
9007 Invalid quantity
9201 The interval cannot exceed 90 days
9202 The currency cannot be empty
9984 Request timestamp validation failed
9985 Invalid apiKey
9986 Operating frequency
9987 The end time cannot be later than the start time
9988 Sign verification failed
9990 The source IP address is not in the trust list
9998 Parameter requested error: type
9999 Exception
10001 Event type does not exist
10000 Request json format error 
100024 Invalid token, please log in again