WEEX API introduction

Welcome to WEEX API!

This is the official WEEX API document, and it will be continuously updated, please stay tuned for the latest updates.

You can switch to different API business in the top menu, and switch to different language by clicking the button in the top right.

On the right side of the document are examples for request parameters and response results.

Check Server Time

Rate limit rule: 20 request/2s

HTTP Request Check server time

  • GET /api/spot/v1/public/time

Response

{
    "code": "00000",
    "msg": "success",
    "requestTime": 1622097118135,
    "data": 1622097118134
}

Coin Basic Information

Rate limit rule: 20 request/2s

HTTP Request get all coins information on the platform

  • GET /api/spot/v1/public/currencies

Response:

{
    "code":"00000",
    "msg":"success",
    "requestTime":1622097139437,
    "data":[
        {
            "coinId":"1",
            "coinName":"BTC",
            "transfer":"true",
            "chains":[
                {
                    "chain":null,
                    "needTag":"false",
                    "withdrawAble":"true",
                    "rechargeAble":"true",
                    "withdrawFee":"0.005",
                    "depositConfirm":"1",
                    "withdrawConfirm":"1",
                    "minDepositAmount":"0.001",
                    "minWithdrawAmount":"0.001",
                    "browserUrl":"https://blockchair.com/bitcoin/testnet/transaction/"
                }
            ]
        },
        {
            "coinId":"2",
            "coinName":"USDT",
            "transfer":"true",
            "chains":[
                {
                    "chain":"ERC20",
                    "needTag":"false",
                    "withdrawAble":"true",
                    "rechargeAble":"true",
                    "withdrawFee":"0.01",
                    "depositConfirm":"12",
                    "withdrawConfirm":"1",
                    "minDepositAmount":"0.1",
                    "minWithdrawAmount":"0.1",
                    "browserUrl":"https://ropsten.etherscan.io/tx/"
                }
            ]
        }
    ]
}

Response Field

FieldDescription
coinIdCurrency ID
coinNameCurrency name
transferIs it possible to transfer
chains
> chainChain name
> needTagIs tag needed
> withdrawAbleWithdrawable or not
> rechargeAbleIs it possible to deposit
> withdrawFeeWithdrawal fee
> depositConfirmDeposit no. of confirmation block
> withdrawConfirmWithdrawal no. of confirmation block
> minDepositAmountMinimum deposit Amount
> minWithdrawAmountMinimum withdrawal Amount
> browserUrlBlockchain browser url

Get All Coin Pairs Information

Rate limit rule: 20 request/1s

HTTP Request get basic configuration information of all trading pairs

  • GET /api/spot/v1/public/products

Response:

{
    "code":"00000",
    "msg":"success",
    "requestTime":1622097197283,
    "data":[
        {
            "symbol":"BTCUSDT_SPBL",
            "symbolName":"BTCUSDT",
            "baseCoin":"BTC",
            "quoteCoin":"USDT",
            "minTradeAmount":"0.0001",
            "maxTradeAmount":"10000",
            "takerFeeRate":"0.001",
            "makerFeeRate":"0.001",
            "priceScale":"4",
            "quantityScale":"8",
            "status":"online"
        },
        {
            "symbol":"EOSUSDT_SPBL",
            "symbolName":"EOSUSDT",
            "baseCoin":"EOS",
            "quoteCoin":"USDT",
            "minTradeAmount":"1",
            "maxTradeAmount":"1",
            "takerFeeRate":"1",
            "makerFeeRate":"1",
            "priceScale":"1",
            "quantityScale":"1",
            "status":"online"
        }
    ]
}

Response Field

FieldDescription
symbolCoin pair
baseCoinBase coin
quoteCoinQuote coin
minTradeAmountMinimum trade size
maxTradeAmountMaximum trade size
takerFeeRateTaker fee rate
makerFeeRateMaker fee rate
priceScalePricing scale
quantityScaleQuantity scale
statusStatus

Get Coin Pairs Information By Symbol

Rate limit rule: 20 request/1s

HTTP Request

  • GET /api/spot/v1/public/product

Request parameter

ParametersTypeRequiredDescription
symbolStringYesName of Currency pair

Response:

{
    "code":"00000",
    "msg":"success",
    "requestTime":1622097197283,
    "data":[
        {
            "symbol":"BTCUSDT_SPBL",
            "symbolName":"BTCUSDT",
            "baseCoin":"BTC",
            "quoteCoin":"USDT",
            "minTradeAmount":"0.0001",
            "maxTradeAmount":"10000",
            "takerFeeRate":"0.001",
            "makerFeeRate":"0.001",
            "priceScale":"4",
            "quantityScale":"8",
            "status":"online"
        }
    ]
}

Response Field

FieldDescription
symbolCurrency pair
baseCoinBase Currency
quoteCoinQuote Currency
minTradeAmountMinimum trade size
maxTradeAmountMaximum trade size
takerFeeRateTaker fee rate
makerFeeRateMaker fee rate
priceScalePricing scale
quantityScaleQuantity scale
statusStatus

Spot Market Data Endpoints

Get Ticker By Symbol

Rate limit rule: 20 request/1s

HTTP Request

  • GET /api/spot/v1/market/ticker

Request parameter

ParametersTypeRequiredDescription
symbolStringYesCurrency pair

Response:

{
    "code":"00000",
    "data":{
        "symbol":"BTCUSDT",
        "high24h":"34413.1",
        "low24h":"34413.1",
        "close":"34413.1",
        "quoteVol":"0",
        "baseVol":"0",
        "usdtVol":"0",
        "ts":"1625125755277"
    },
    "msg":"success",
    "requestTime":1625125756372
}

Response Field

FieldDescription
symbolCurrency pair
high24h24h highest price
closeLatest transaction price
low24h24h lowest price
quoteVolQuote Currency volume
baseVolBase Currency volume
usdtVolUSDT volume
tsSystem timestamp

Get The Latest Ticker For All Symbols

Rate limit rule: 20 request/1s

HTTP Request Get the latest ticker for all coin pairs

  • GET /api/spot/v1/market/tickers

Response:

{
    "code":"00000",
    "data":[
      {
        "symbol":"BTCUSDT",
        "high24h":"34413.1",
        "low24h":"34413.1",
        "close":"34413.1",
        "quoteVol":"0",
        "baseVol":"0",
        "usdtVol":"0",
        "ts":"1625125755277"
    }
    ]
    "msg":"success",
    "requestTime":1625125756372
}

Response Field

FieldDescription
symbolCurrency pair
high24h24h highest price
closeLatest transaction price
low24h24h lowest price
tsSystem timestamp
baseVolBase coin volume
quoteVolQuote coin volume
usdtVolUSDT volume

Recent Trades List

Rate limit rule: 20 request/1s

HTTP Request

  • GET /api/spot/v1/market/fills

Request parameter

ParametersTypeRequiredDescription
symbolStringYesCurrency pair
limitStringNoDefault 100

Response:

{
    "code":"00000",
    "msg":"success",
    "requestTime":1622097283024,
    "data":[
        {
            "symbol":"BFTUSDT_SPBL",
            "tradeId":"781698148534505473",
            "side":"buy",
            "fillPrice":"2.38735",
            "fillQuantity":"2470.6224",
            "fillTime":"1622097282536"
        },
        {
            "symbol":"BFTUSDT_SPBL",
            "tradeId":"781698140590493697",
            "side":"sell",
            "fillPrice":"2.38649",
            "fillQuantity":"3239.7976",
            "fillTime":"1622097280642"
        }
    ]
}

Response Field

FieldDescription
symbolCurrency pair
tradeIdtrade id
sideTrade direction
fillPriceTransaction price
fillQuantityTransaction quantity
fillTimeTransaction time

Kline/Candlestick Data

Rate limit rule: 20 request/1s

HTTP Request

  • GET /api/spot/v1/market/candles

Request parameter

ParametersTypeRequiredDescription
symbolStringYesCurrency pair
periodStringYesCandlestick line time unit, granularity (​​refer to the following list for values)
afterStringNoTime after
beforeStringNoTime before
limitStringNoDefault 100
Descriptiongranularity
1min60
5min300
15min900
30min1800
1h3600
4h14400
12h43200
1d86400
7d604800

Response:

{
    "code":"00000",
    "msg":"success",
    "requestTime":1622097356073,
    "data":[
        {
            "open":"2.34517",
            "high":"2.34771",
            "low":"2.34214",
            "close":"2.34555",
            "quoteVol":"189631.101357091",
            "baseVol":"80862.6823",
            "usdtVol":"189631.101357091",
            "ts":"1622091360000"
        },
        {
            "open":"2.34391",
            "high":"2.34903",
            "low":"2.34391",
            "close":"2.34608",
            "quoteVol":"167725.002115681",
            "baseVol":"71479.3205",
            "usdtVol":"167725.002115681",
            "ts":"1622091420000"
        }
    ]
}

Response Field

FieldDescription
tsSystem timestamp
openOpening price
highHighest price
lowLowest price
closeClosing price
baseVolBase Currency volume
quoteVolQuote Currency volume
usdtVolUSDT volume

Order Book

Rate limit rule: 20 request/1s

HTTP Request

  • GET /api/spot/v1/market/depth

Request parameter

ParametersTypeRequiredDescription
symbolStringYesCurrency pair
typeStringYesDefault: step0: do not merge, value: step0, step1, step2, step3, step4, step5
limitStringYesDefault 500

Response:

{
    "code":"00000",
    "msg":"success",
    "requestTime":1622102974025,
    "data":{
        "asks":[
            [
                "38084.5",
                "0.0039"
            ],
            [
                "38085.7",
                "0.0018"
            ],
            [
                "38086.7",
                "0.0310"
            ],
            [
                "38088.2",
                "0.5303"
            ]
        ],
        "bids":[
            [
                "38073.7",
                "0.4993000000000000"
            ],
            [
                "38073.4",
                "0.4500"
            ],
            [
                "38073.3",
                "0.1179"
            ],
            [
                "38071.5",
                "0.2162"
            ]
        ],
        "timestamp":"1622102974025"
    }
}

Spot Account Endpoints

Get Assets

Rate limit rule: 10 request/1s

HTTP Request

  • GET /api/spot/v1/account/assets

Response:

{
  "code":"00000",
  "message":"success",
  "data":[
    {
        "coinId":"10012",
        "coinName":"usdt",
        "available":"0",
        "frozen":"0",
        "lock":"0",
        "uTime":"1622697148"
    }
]
}

Response Field

FieldDescription
coinIdCurrency id
coinNameCurrency name
availableAvailable assets
frozenFrozen assets
lockLocked assets
uTimeUpdated time

Get Bill Record

Rate limit rule: 10 request/1s

HTTP Request

  • POST /api/spot/v1/account/bills

Request parameter

ParametersTypeRequiredDescription
coinIdIntegerNoCurrency ID
groupTypeStringNoTransaction group type
bizTypeStringNoBusiness type
afterStringNoSend in billId, the data before this billId
beforeStringNoSend in billId, the data after this billId
limitIntegerNodefault 100, Max. 500

Response:

{
  "code":"00000",
  "message":"success",
  "data":[{
      "cTime":"1622697148",
      "coinId":"22",
      "coinName":"usdt",
      "groupType":"deposit",
      "bizType":"transfer-in", 
      "quantity":"1",
      "balance": "1",
      "fees":"0",
      "billId":"1291"
}]
}

Response Field

FieldDescription
cTimeCreated time
coinIdCurrency Id
coinNameCurrency name
groupTypeTransaction group type
bizTypeBusiness type
quantityQuantity
balanceAssets before action
feesTransaction fees
billIdid

Get Transfer Record

Rate limit rule: 10 request/1s

HTTP Request

  • GET /api/spot/v1/account/transferRecords

Request parameter

ParametersTypeRequiredDescription
coinIdIntegerNoCurrency ID
fromTypeStringNoAccount Type
afterLongNoafter transfer balance
beforeLongNobefore transfer balance
limitIntegerNodefault 100, Max. 500

Response:

{
    "code":"00000",
    "data":[
        {
            "coinName":"btc",
            "status":"SUCCESS",
            "toType":"USD_MIX",
            "toSymbol":"",
            "fromType":"CONTRACT",
            "fromSymbol":"BTC/USD",
            "amount":"1000.00000000",
            "tradeTime":"1631070374488"
        }
    ],
    "msg":"success",
    "requestTime":1631608142260
}

Response Field

FieldDescription
coinNameCurrency name
statusStatus
toTypeTransfer in account type
toSymbolTransfer to account Symbol
fromTypeTransfer out account type
fromSymbolTransfer in account Symbol
amountNumber of transfers
tradeTimeTransfer time

Spot Trade Endpoints

New Order

Rate limit rule: 10 requests/1s

HTTP Request new order

  • POST /api/spot/v1/trade/orders

Request Parameter

ParametersTypeRequiredDescription
symbolStringYesSymbol:/products
sideStringYesTrade Direction
orderTypeStringYesTrade Type limit/market
forceStringYesOrder Type
priceStringNoLimit Order Price
quantityStringYesAmount
clientOrderIdStringNoClient Order ID

Response:

{
    "code":"00000",
    "msg":"success",
    "data":{
        "orderId":"1001",
        "clientOrderId":"hgXjh89AsxleMSw"
    }
}

Response Field

FieldDescription
orderIdorder id
clientOrderIdclient order id

Place Multiple Orders

Rate limit rule: 5 requests/1s

HTTP Request Place Multiple Orders

  • POST /api/spot/v1/trade/batch-orders

Request Parameter

ParametersTypeRequiredDescription
symbolStringYesSymbol: /products
orderListListYesList of Orders
  • orderList Field
ParametersTypeRequiredDescription
sideStringYesTrade Direction
orderTypeStringYesTrade Type limit/market
forceStringYesOrder Type
priceStringNoLimit Order Price
quantityStringYesAmoun
clientOrderIdStringNoClient Order ID

Response:

{
    "code":"00000",
    "msg":"success",
    "data":{
        "resultList":[
            {
                "clientOrderId":"hgXjh89AsxleMSw",
                "orderId":"1001"
            }
        ]
    }
}

Cancel Order

Rate limit rule: 10 requests/1s

HTTP Request Cancel order

  • POST /api/spot/v1/trade/cancel-order

Request Parameter

ParametersTypeRequiredDescription
symbolStringYesSymbol :/products
orderIdStringYesOrder id array

Response:

{

  "code":"00000",
   "message":"success",
   "data":"1001"

}

Cancel Multiple Orders

Rate limit rule: 10 request/1s

HTTP Request Cancel multiple orders

  • POST /api/spot/v1/trade/cancel-batch-orders

Request Parameter

ParametersTypeRequiredDescription
symbolStringYesSymbol:/products
orderIdsString[]YesOrder id array

Response:

{

  "code":"00000",
   "message":"success",
    "data":[
    "1001",
    "1002"
    ]

}   

Get Order details

Rate limit rule: 10 request/1s

HTTP Request get order details by order id or client order id

  • POST /api/spot/v1/trade/orderInfo

Request Parameter

ParametersTypeRequiredDescription
symbolStringYesSymnol:/products
orderIdStringYesOrder id
clientOrderIdStringNoCustom order id

Response:

{
  "code":"00000",
  "message":"success",
"data":[{
  "accountId":"10012",
  "symbol":"btcusdt_spbl",
  "orderId":"2222222",
  "clientOrderId":"xxxxxxx",
  "price":"34245.12",
  "quantity":"1",  
  "orderType":"limit",
  "side":"buy",
  "status":"new",
  "fillPrice":"0",
  "fillQuantity":"0",
  "fillTotalAmount":"0",
  "cTime":"1622697148"
}]
}

Response Field

FieldDescription
accountIdaccount id
symbolCurrency pair name
orderIdOrder id
clientOrderIdCustom id
priceprice
quantityOrder quantity
orderTypeOrder type
sideOrder direction
statusstatus
fillPriceTransaction price
fillQuantityTransaction quantity
fillTotalAmountTotal transcation volume
cTimeCreated time

Get Pending Orders

Rate limit rule: 10 request/1s

HTTP Request Get unfilled and partially filled uncancelled orders

  • POST /api/spot/v1/trade/open-orders

Request Parameter

ParametersTypeRequiredDescription
symbolStringYesSymbol:/products

Response:

{
  "code":"00000",
  "message":"success",
"data":[{
  "accountId":"10012",
  "symbol":"btcusdt_spbl",
  "orderId":"2222222",
  "clientOrderId":"xxxxxxx",
  "price":"34829.12",
  "quantity":"1",  
  "orderType":"limit",
  "side":"buy",
  "status":"new",
  "fillPrice":"0",
  "fillQuantity":"0",
  "fillTotalAmount":"0",
  "cTime":"1622697148"
}]
}

Response Field

FieldDescription
accountIdAccount ID
symbolCurrency pair
orderIdorder id
clientOrderIdCustom id
priceOrder price
quantityOrder quantity
orderTypeOrder type
sideOrder direction
statusstatus
fillPriceTransaction price
fillQuantityTransaction quantity
fillTotalAmountTotal transcation volume
cTimeCreated time

Get Traded Order Record

Rate limit rule: 20 request/1s

HTTP Request Get all filled and cancelled orders

  • POST /api/spot/v1/trade/history

Request Parameter

参数名TypeRequiredDescription
symbolStringYesSymbol:/products
afterStringNouse orderId, the data before this orderId desc
beforeStringNouse orderId, the data after this orderId asc
limitIntegerNodefault 100, max. is 500

Response:

{
  "code":"00000",
  "message":"success",
"data":[{
  "accountId":"10012",
  "symbol":"btcusdt_spbl",
  "orderId":"2222222",
  "clientOrderId":"xxxxxxx",
  "price":"34982.12",
  "quantity":"1",  
  "orderType":"limit",
  "side":"buy",
  "status":"new",
  "fillPrice":"34982.12",
  "fillQuantity":"1",
  "fillTotalAmount":"34982.12",
  "cTime":"1622697148"
}]
}

Response Field

FieldDescription
accountIdAccount ID
symbolCurrency pair
orderIdOrder id
clientOrderIdCustom ID
priceOrder price
quantityOrder quantity
orderTypeOrder type
sideOrder direction
statusOrder status
fillPriceTransaction price
fillQuantityTransaction quantity
fillTotalAmountTotal transcation volume
cTimeCreated time

Get Transaction Details

Rate limit rule: 20 request/1s

HTTP Request get transaction detail history

  • POST /api/spot/v1/trade/fills

Request Parameter

ParametersTypeRequiredDescription
symbolStringYesSymbol:/products
orderIdStringNoOrder ID
afterStringNouse in orderId, the data before this orderId desc
beforeStringNouse in the orderId, the data after this orderId asc
limitIntegerNodefault 100, max. 500

Response:

{
  "code":"",
  "message":"",
  "data":[{
  "accountId":"1001",
  "symbol":"btcusdt_spbl",
  "orderId":"100021",
  "fillId":"102211",
  "orderType":"limit",
  "side":"buy",
  "fillPrice":"38293.12",
  "fillQuantity":"1",
  "fillTotalAmount":"38293.12",
  "cTime":"1622697148",
  "feeCcy":"btc",
  "fees":"0.0001"
}]
}

Response Field

FieldDescription
accountIdAccount ID
symbolCurrency pair
orderIdOrder id
fillIdTransaction ID
orderTypeOrder type
sideOrder direction
fillPriceTransaction price
fillQuantityTransaction quantity
fillTotalAmountTotal transaction volume
cTimeCreatied time
feeCcyCoin for transaction fee
feesTransaction fees

Common Error Codes

Error MessageError Codehttp status code
The request header “ACCESS_KEY” cannot be empty40001400
The request header “ACCESS_SIGN” cannot be empty40002400
The request header “ACCESS_TIMESTAMP” cannot be empty40003400
Invalid ACCESS_TIMESTAMP40005400
Invalid ACCESS_KEY40006400
Invalid Content_Type,please use“application/json”format40007400
Requested timestamp expired40008400
api verification failed40009400
Request is too frequent429429
The request header “ACCESS_PASSPHRASE” cannot be empty40011400
apikey/passphrase is incorrect40012400
User has been frozen40013400
Incorrect permissions40014400
System error40015400
The user must bind a mobile phone or Google authenticator40016400
Parameter verification failed40017400
Illegal IP request40018400

Spot Error Codes

Error MessageError Codehttp status code
Batch processing orders can only process up to 5040912400
OrderId or clientId must be passed one40913400
The contract configuration does not exist, please check the parameters40102400
Server upgrade, please try again later40200400
Client_oid length is not greater than 40, and cannot be Martian characters40305400
Wrong format40409400
Only check the data of the last three months40704400
Start time is greater than end time40707400
Parameter is empty40724400
Spot service return an error40725400