English
javascript

Spot trading

Signature interface request method

Example

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1. Current timestamp

let param = {// 2. Requested parameters
    select: 1
};

let strParam = JSON.stringify(param); // 2. Formatting parameters

let strToSign ='' + timestamp + strParam; // 3. This is the string that needs to be signed

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4. Signed result

let url = "https://api.bibox.com/v3.1/transfer/assets";

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//5. Set request headers
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6. Formatting parameters
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 7. Response data

    });

Field name Field type Field description Field value
content-type string 'application/json'
bibox-api-key string your apikey
bibox-timestamp long Current timestamp,expressed in milliseconds timestamp
bibox-api-sign string Signature result sign

Network test

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/ping";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/ping

Name Necessary or not Type Description Default value Value range

Response

{
    "state":0,
    "result":1604319540420,
    "cmd":"ping",
    "ver":"3"
}

Name Description
state 0 means success, otherwise means failure
result server timestamp
Other fields Ignore

Market

Query trading pairs

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/pairList";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/pairList

Name Necessary or not Type Description Default value Value range

Response

{
    "state":0,
    "result":[
        {
            "id":1,
            "pair":"BIX_BTC",
            "pair_type":0,
            "area_id":7,
            "is_hide":0,
            "decimal":8
        },
        {
            "id":2,
            "pair":"BIX_ETH",
            "pair_type":0,
            "area_id":8,
            "is_hide":0,
            "decimal":8
        }
    ],
    "cmd":"pairList",
    "ver":"3"
}
Name Description
state 0 means success, otherwise means failure
id Trading pair id
pair Trading pair
decimal Price accuracy
Other fields Ignore

Query kline

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/kline?pair=BTC_USDT&period=1min&size=2";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/kline?pair=BTC_USDT&period=1min&size=10

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, ETH_BTC, ...
period true string k-line period '1min', '3min', '5min', '15min', '30min', '1hour', '2hour', '4hour', '6hour', '12hour ','day','week'
size false integer quantity 1000 1-1000

Response

{
    "state":0,
    "result":[
        {
            "time":1604319840000,
            "open":"11700.00000000",
            "high":"11700.00000000",
            "low":"11700.00000000",
            "close":"11700.00000000",
            "vol":"0.00000000"
        },
        {
            "time":1604319900000,
            "open":"11700.00000000",
            "high":"11700.00000000",
            "low":"11700.00000000",
            "close":"11700.00000000",
            "vol":"0.00000000"
        }
    ],
    "cmd":"kline",
    "ver":"3"
}
Name Description
state 0 means success, otherwise means failure
time Timestamp
open Opening price
high Highest price
low Lowest price
close Closing price
vol Volume
Other fields Ignore

Query market of all pairs

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/marketAll";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/marketAll

Name Necessary or not Type Description Default value Value range

Response

{
    "state":0,
    "result":[
        {
            "is_hide":0,
            "high_cny":"0.3668",
            "amount":"380746.08",
            "coin_symbol":"BIX",
            "last":"0.053142",
            "currency_symbol":"USDT",
            "change":"+0.000460",
            "low_cny":"0.3470",
            "base_last_cny":"0.35286384",
            "area_id":15,
            "percent":"+0.87%",
            "last_cny":"0.3529",
            "high":"0.055248",
            "low":"0.052253",
            "pair_type":0,
            "last_usd":"0.0531",
            "vol24H":"7059898",
            "id":90,
            "high_usd":"0.0552",
            "low_usd":"0.0522"
        },
        {
             "is_hide":0,
             "high_cny":"92032.3103",
             "amount":"392242739.20",
             "coin_symbol":"BTC",
             "last":"13328.9300",
             "currency_symbol":"USDT",
             "change":"-437.5799",
             "low_cny":"87735.6210",
             "base_last_cny":"88504.33592048",
             "area_id":15,
             "percent":"-3.17%",
             "last_cny":"88504.3359",
             "high":"13860.2500",
             "low":"13213.1600",
             "pair_type":0,
             "last_usd":"13318.9290",
             "vol24H":"28728",
             "id":36,
             "high_usd":"13849.8503",
             "low_usd":"13203.2459"
        }
    ],
    "cmd":"marketAll",
    "ver":"3"
}
Name Description
state 0 means success, otherwise means failure
id trading pair id
coin_symbol Trading currency
currency_symbol Pricing currency
last 24h latest price
high 24h highest price
low 24h lowest price
change 24h change
percent 24h change percent
vol24H 24h Volume
amount 24h amount
last_cny 24h latest price discount cny
high_cny 24h highest price discount cny
low_cny 24h lowest price discount cny
last_usd 24h latest price discount usd
high_usd 24h highest price discount usd
low_usd 24h lowest price discount usd
Other fields Ignore

Query the market of one pair

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/market?pair=BIX_USDT";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/market?pair=BIX_USDT

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, ETH_BTC, ...

Response

{
    "state":0,
    "result":{
        "is_hide":0,
        "high_cny":"0.3668",
        "amount":"380746.08",
        "coin_symbol":"BIX",
        "last":"0.053142",
        "currency_symbol":"USDT",
        "change":"+0.000460",
        "low_cny":"0.3470",
        "base_last_cny":"0.35286384",
        "area_id":15,
        "percent":"+0.87%",
        "last_cny":"0.3529",
        "high":"0.055248",
        "low":"0.052253",
        "pair_type":0,
        "last_usd":"0.0531",
        "vol24H":"7059898",
        "id":90,
        "high_usd":"0.0552",
        "low_usd":"0.0522"
    },
    "cmd":"market",
    "ver":"3"
}
Name Description
state 0 means success, otherwise means failure
id trading pair id
coin_symbol Trading currency
currency_symbol Pricing currency
last 24h latest price
high 24h highest price
low 24h lowest price
change 24h change
percent 24h change percent
vol24H 24h Volume
amount 24h amount
last_cny 24h latest price discount cny
high_cny 24h highest price discount cny
low_cny 24h lowest price discount cny
last_usd 24h latest price discount usd
high_usd 24h highest price discount usd
low_usd 24h lowest price discount usd
Other fields Ignore

Query depth

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/depth?pair=BTC_USDT&size=2";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/depth?pair=BIX_BTC&size=10

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, ETH_BTC, ...
size false integer quantity 200 1-200

Response

{
    "state":0,
    "result":{
        "pair":"BTC_USDT",
        "update_time":1604316939377,
        "asks":[
            {
                "volume":"0.00320000",
                "price":"11739.1407"
            },
            {
                "volume":"0.00320000",
                "price":"11762.6189"
            }
        ],
        "bids":[
            {
                "volume":"0.00640000",
                "price":"11692.3246"
            },
            {
                "volume":"0.00490000",
                "price":"11668.9866"
            }
        ]
    },
    "cmd":"depth",
    "ver":"3"
}
Name Description
state 0 means success, otherwise means failure
pair Trading pair
update_time Timestamp
asks Seller Depth
bids Buyer Depth
price Pending price
volume Pending volume
Other fields Ignore

Query market records

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/deals?pair=BTC_USDT&size=2";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/deals?pair=BTC_USDT&size=10

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, ETH_BTC, ...
size false integer quantity 200 1-200

Response

{
    "state":0,
    "result":[
        {
            "pair":"BTC_USDT",
            "price":"11700.0000",
            "amount":"0.01000000",
            "time":1604316939377,
            "side":2
        },
        {
            "pair":"BTC_USDT",
            "price":"11857.0026",
            "amount":"0.00160000",
            "time":1604308219643,
            "side":2
        }
    ],
    "cmd":"deals",
    "ver":"3"
}
Name Description
state 0 means success, otherwise means failure
pair Trading pair
price Deal price
volume Deal quantity
time Deal time
side taker trading direction, 1-buy, 2-sell
Other fields Ignore

Query tiker

Request

let request = require("request");
let url = "https://api.bibox.com/v3/mdata/ticker?pair=BTC_USDT";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3/mdata/ticker?pair=BTC_USDT

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, ETH_BTC, ...

Response

{
    "state":0,
    "result":{
        "pair":"BTC_USDT",
        "last":"11700.0000",
        "last_usd":"11700.00",
        "last_cny":"78287.05",
        "high":"11880.0000",
        "low":"11700.0000",
        "buy":"11692.3246",
        "buy_amount":"0.00640000",
        "sell":"11739.1407",
        "sell_amount":"0.00320000",
        "vol":"0.02160000",
        "percent":"-1.51%",
        "timestamp":1604316939377,
        "base_last_cny":"78287.05250000"
    },
    "cmd":"ticker",
    "ver":"3"
}
Name Description
state 0 means success, otherwise means failure
pair Trading pair
buy Latest buying price
buy_amount Latest buying amount
sell Latest selling price
sell_amount Latest selling amount
high 24h highest price
last latest price
low 24h lowest price
timestamp Timestamp
vol 24h volume
percent 24h change percent
last_cny Latest Trading price, priced in cny
last_usd Latest Trading price, priced in usd
Other fields Ignore

Order restriction information

Request

let request = require("request");
let url = "https://api.bibox.com/v3.1/orderpending/tradeLimit";
request.get(url,
    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

GET https://api.bibox.com/v3.1/orderpending/tradeLimit

Name Necessary or not Type Description Default value Value range

Response

{
    "result":{
        "min_trade_price":{
            "default":"0.00000001",
            "USDT":"0.0001",
            "DAI":"0.0001"
        },
        "min_trade_amount":{
            "default":"0.0001"
        },
        "min_trade_money":{
            "USDT":"1",
            "DAI":"1",
            "GUSD":"1",
            "BIX":"3",
            "BTC":"0.0002",
            "ETH":"0.005"
        }
    },
    "cmd":"tradeLimit",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
min_trade_price Minimum order price column
-default The minimum order price limit for ordinary trading pairs is 0.00000001
-USDT The maximum order price limit in the USDT trading area is 0.0001. The decimal part exceeding 0.0001 will be automatically discarded. It is applicable to all trading pairs denominated in USDT
-DAI The minimum order price limit in the DAI trading area is 0.0001. The decimal part exceeding 0.0001 will be automatically discarded. It is applicable to all trading pairs denominated in DAI
min_trade_amount Minimum order quantity column
-default The minimum order quantity limit is 0.0001, the decimal part exceeding 0.0001 will be automatically discarded, applicable to all trading pairs
min_trade_money Minimum order amount column
-USDT The minimum order amount in USDT trading area is limited to 1, and so on

Spot Asset(Need ApiKey)

Wallet assets

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/transfer/assets";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    select: 1
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/transfer/assets

Name Necessary or not Type Description Default value Value range
select false integer Whether to query asset details 0-Total assets of each currency, 1-Request asset details of all currencies

Response

{
    "result":{
        "total_btc":"0.01373280",
        "total_cny":"1253.48",
        "total_usd":"188.63",
        "assets_list":[
            {
                "coin_symbol":"BTC",
                "BTCValue":"0.00149188",
                "CNYValue":"136.17",
                "USDValue":"20.49",
                "balance":"0.00149188",
                "freeze":"0.00000000"
            },
            {
                "coin_symbol":"BIX",
                "BTCValue":"0.00098407",
                "CNYValue":"89.82",
                "USDValue":"13.52",
                "balance":"247.87570000",
                "freeze":"0.00000000"
            }
        ]
    },
    "cmd":"assets",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
total_btc The sum of assets in each currency, btc-based
total_cny The sum of assets in each currency, cny-based
total_usd The sum of assets of each currency, usd-based
assets_list Currency asset list
coin_symbol currency
balance Available assets
freeze freeze assets
BTCValue btc valuation
CNYValue cny valuation
USDValue usd valuation
Other fields Ignore

Spot assets

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/spot/account/assets";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    select: 1
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/spot/account/assets

Name Necessary or not Type Description Default value Value range
select false integer Whether to query asset details 0-Total assets of each currency, 1-Request asset details of all currencies

Response

{
    "result":{
        "total_btc":"0.01373280",
        "total_cny":"1253.48",
        "total_usd":"188.63",
        "assets_list":[
            {
                "coin_symbol":"BTC",
                "BTCValue":"0.00149188",
                "CNYValue":"136.17",
                "USDValue":"20.49",
                "balance":"0.00149188",
                "freeze":"0.00000000"
            },
            {
                "coin_symbol":"BIX",
                "BTCValue":"0.00098407",
                "CNYValue":"89.82",
                "USDValue":"13.52",
                "balance":"247.87570000",
                "freeze":"0.00000000"
            }
        ]
    },
    "cmd":"assets",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
total_btc The sum of assets in each currency, btc-based
total_cny The sum of assets in each currency, cny-based
total_usd The sum of assets of each currency, usd-based
assets_list Currency asset list
coin_symbol currency
balance Available assets
freeze freeze assets
BTCValue btc valuation
CNYValue cny valuation
USDValue usd valuation
Other fields Ignore

Deposit

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/transfer/transferIn";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    coin_symbol:'BTC'
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/transfer/transferIn

Name Necessary or not Type Description Default value Value range
coin_symbol true string Deposit currency BIX, BTC, ...

Response

{
    "result":"13f2LpNAdsKuxdTt2bKFLaSZL7toeyieGE",
    "cmd":"transferIn",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
result Deposit address
Other fields Ignore

Withdrawal

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/transfer/transferOut";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    coin_symbol:'BTC',
    amount: 0.1,
    addr: '13f2LpNAdsKuxdTt2bKFLaSZL7toeyieGExxx',
    memo:''
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/transfer/transferOut

Name Necessary or not Type Description Default value Value range
coin_symbol true string Withdrawal currency BIX, BTC, ...
amount true double Withdrawal quantity Must be greater than the minimum withdrawal quantity for each currency
addr true string Withdrawal address Currency legal address
memo false string Withdrawal label Some currency withdrawals must specify a label, which is unique in combination with the address, such as EOS

Response

{
    "state":0,
    "result":228,
    "cmd":"transfer/transferOut"
}
Name Description
state 0 means success, otherwise means failure
result withdrawal id
Other fields Ignore

Query deposit records

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/transfer/transferInList";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    coin_symbol:'USDT',
    filter_type: 0,
    page: 1,
    size: 10
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/transfer/transferInList

Name Necessary or not Type Description Default value Value range
filter_type false integer deposit record filter 0 0-all, 1-deposit in progress, 2-deposit received, 3-deposit failed
coin_symbol false string Deposit currency BIX, ETH, ...
page true integer page number starting from 1
size true integer number per page 1-50

Response

{
    "result":{
        "count":1,
        "page":1,
        "items":[
            {
                "id":1682192,
                "to":"TXLhYFsWu84vU5ngs8J88yphTPdv69zrqoD",
                "tx_id":"a8f77b3a20758d85f71f2d993766c9b6c2daf1b1f34992e409e1a47247e5a5e45",
                "coin_symbol":"USDT",
                "chain_type":"TRC20",
                "confirmCount":"20",
                "amount":"0.00094400",
                "createdAt":1596876872000,
                "status":2
            }
        ]
    },
    "cmd":"transferInList",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
count The number of records on the current page, if there is a next page, count=the number of records on the current page+1
page page number, starting from 1
items records
coin_symbol currency
to_address deposit address
amount deposit amount
confirmCount deposit confirmation number
createdAt deposit time
status deposit status, 1-deposit in progress, 2-deposit received, 3-deposit failed
Other fields Ignore

Query withdrawal records

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/transfer/transferOutList";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    coin_symbol:'USDT',
    filter_type: 2,
    page: 1,
    size: 10
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/transfer/transferOutList

Name Necessary or not Type Description Default value Value range
filter_type false integer Withdrawal record screening -2: failed review; -1: user cancelled; 0: pending review; 1: approved (to be issued currency); 2: currency issued; 3: currency issued Complete
coin_symbol false string Withdrawal currency BIX, ETH, ...
page true integer page number starting from 1
size true integer number per page 1-50

Response

{
    "result":{
        "count":1,
        "page":1,
        "items":[
            {
                "id":809022,
                "to_address":"0x606a84A14307418F47C6ad538b5E73C93Ff9C8Cf",
                "tx_id":"0xd3cf26d514c1e62f85de84b4e24fbd219084dd078daa7e639844c33cdf81bd62b",
                "coin_symbol":"USDT",
                "chain_type":"ERC20",
                "amount_real":"1000.00000000",
                "amount":"1003.00000000",
                "createdAt":1596876972000,
                "memo":"",
                "status":2
            }
        ]
    },
    "cmd":"transferOutList",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
count The number of records on the current page, if there is a next page, count=the number of records on the current page+1
page page number, starting from 1
items records
coin_symbol currency
to_address Withdrawal address
amount Withdrawal amount
fee Withdrawal fee
createdAt deposit time
memo memo
status status, 1-withdrawal in progress, 2-withdrawal received, 3-withdrawal failed, 4-withdrawal cancelled
Other fields Ignore

Get currency configuration

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/transfer/coinConfig";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/transfer/coinConfig

Name Necessary or not Type Description Default value Value range
coin_symbol false string currency type BIX, ETH...

Response

{
    "result":[
        {
            "coin_symbol":"BTC",
            "is_active":1,
            "original_decimals":8,
            "enable_deposit":1,
            "enable_withdraw":1,
            "withdraw_fee":0.0008,
            "withdraw_min":0.005
        }
    ],
    "cmd":"coinConfig",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
coin_symbol currency
original_decimals Currency original value precision
enable_deposit Whether it can be depositd, 0-prohibited, 1-can
enable_withdraw Whether withdrawal is possible, 0-forbidden, 1-yes
withdraw_fee Withdrawal fee
withdraw_min Minimum withdrawal amount
Other fields Ignore

Query a certain withdrawal record

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/transfer/withdrawInfo";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    id: 228
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/transfer/withdrawInfo

Name Necessary or not Type Description Default value Value range
id true integer withdrawal id

Response

{
    "state":0,
    "result":{
      "id":228,
        "createdAt": 1512756997000,
        "coin_symbol":"LTC",
        "to_address":"xxxxxxxxxxxxxxxxxxxxxxxxxx",
        "status":3,
        "amount":"1.00000000",
        "fee":0.1
    },
    "cmd":"withdrawInfo"
}
Name Description
state 0 means success, otherwise means failure
id withdrawal id
coin_symbol currency
createdAt Withdrawal time
to_address Withdrawal address
status Status, -2: Approval failed; -1: User canceled; 0: Pending approval; 1: Approved (to be issued coins); 2: In the process of issuing coins; 3: Issuing coins completed
amount Withdrawal amount
fee Withdrawal fee
Other fields Ignore

Spot Trade(Need ApiKey)

Place an order

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/trade";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    pair:'BIX_USDT',
    account_type: 0,
    order_side: 2,
    order_type: 2,
    price: 0.05458,
    amount: 100
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/trade

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, ETH_BTC, ...
account_type true integer account type 0-spot account
order_type true integer Trading type 2-Limit order
order_side true integer Trading direction 1-buy, 2-sell
price true double order price minimum value 0.00000001
amount true double order amount minimum 0.0001
client_oid false long to string User-defined id '110011223344'

Response

{
    "result":"12845594488036185",
    "cmd":"trade",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
result order id
Other fields Ignore

Cancel an order

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/cancelTrade";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    orders_id: "12845594488036185"
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/cancelTrade

Name Necessary or not Type Description Default value Value range
orders_id true string order id

Response

{
    "result":"OK",
    "cmd":"cancelTrade",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
result Note: The result only means that the server has received an order cancellation request, and the order record can be queried from the cancellation result
Other fields Ignore

Get open orders

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/orderPendingList";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    pair:'BIX_USDT',
    account_type: 0,
    page: 1,
    size: 10
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/orderPendingList

Name Necessary or not Type Description Default value Value range
pair false string Trading pair BIX_BTC, ETH_BTC, ...
account_type true integer account type 0-spot account
order_side false integer Trading direction 1-Buy, 2-Sell
coin_symbol false string Trading currency BIX, EOS, ...
currency_symbol false string Pricing currency BTC, USDT, ...
page true integer page number starting from 1
size true integer number per page 1-50

Response

{
    "result":{
        "count":1,
        "page":1,
        "items":[
            {
                "id":"12874181782731851",
                "createdAt":1604309861000,
                "account_type":0,
                "pair":"BIX_USDT",
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":2,
                "order_type":2,
                "price":"0.054330",
                "deal_price":"0.000000",
                "amount":"100.0000",
                "money":"5.43300000",
                "deal_amount":"0.0000",
                "deal_percent":"0.00%",
                "deal_money":"0.00000000",
                "deal_count":0,
                "status":1,
                "unexecuted":"100.0000"
            }
        ]
    },
    "cmd":"orderPendingList",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
count The number of records on the current page, if there is a next page, count=the number of records on the current page+1
page page number, starting from 1
items records
id order id
createdAt Creation time
account_type Account type 0-spot account
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Order price, market order is 0
amount Order quantity
money Order value
deal_amount Deal quantity
deal_percent Deal percentage
unexecuted Unexecuted quantity
status Status, -1 Failed 0 or 1-Pending, 2-Partially completed, 3-Completely completed, 4-Partially cancelled, 5-Completely cancelled, 6
Other fields Ignore

Get historical orders

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/pendingHistoryList";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    pair:'BIX_USDT',
    account_type: 0,
    page: 1,
    size: 10
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/pendingHistoryList

Name Necessary or not Type Description Default value Value range
pair false string Trading pair BIX_BTC, ETH_BTC, ...
account_type true integer account type 0-spot account
order_side false integer Trading direction 1-Buy, 2-Sell
coin_symbol false string Trading currency BIX, EOS, ...
currency_symbol false string Pricing currency BTC, USDT, ...
hide_cancel false integer hide cancelled orders 0-not hide, 1-hidden
page true integer page number starting from 1
size true integer number per page 1-50

Response

{
    "result":{
        "count":11,
        "page":1,
        "items":[
            {
                "id":"12845594488036185",
                "createdAt":1604305967000,
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":2,
                "order_type":2,
                "price":"0.054580",
                "amount":"100.0000",
                "money":"5.45800000",
                "deal_price":"0.000000",
                "deal_amount":"0.0000",
                "deal_money":"0.00000000",
                "status":5
            }
        ]
    },
    "cmd":"pendingHistoryList",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
count The number of records on the current page, if there is a next page, count=the number of records on the current page+1
page page number, starting from 1
items records
id order id
createdAt Creation time
account_type Account type 0-spot account
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Order price
amount Order quantity
money Order value
deal_price Average deal price
deal_amount Deal quantity
deal_money Deal value
deal_percent Deal percentage
status Status, -1 Failed 0 or 1-Pending, 2-Partially completed, 3-Completely completed, 4-Partially cancelled, 5-Completely cancelled, 6
Other fields Ignore

Get deal records(based on order id)

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/orderDetail";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    id: "12826902662624234",
    account_type: 0
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/orderDetail

Name Necessary or not Type Description Default value Value range
id true string order id
account_type true integer account type 0-spot account

Response

{
    "result":{
        "sum":"3.57490350",
        "orderList":[
            {
                "id":"2251799823470863898",
                "createdAt":1599730918000,
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":1,
                "order_type":2,
                "price":"0.071300",
                "amount":"0.4825",
                "money":"0.03440225",
                "pay_bix":0,
                "fee_symbol":"BIX",
                "fee":"0.00000000",
                "is_maker":0,
                "relay_id":"12826902662624234"
            },
            {
                "id":"2251799823470863900",
                "createdAt":1599730918000,
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":1,
                "order_type":2,
                "price":"0.071500",
                "amount":"39.8408",
                "money":"2.84861720",
                "pay_bix":0,
                "fee_symbol":"BIX",
                "fee":"0.00000000",
                "is_maker":0,
                "relay_id":"12826902662624234"
            },
            {
                "id":"2251799823470863902",
                "createdAt":1599730918000,
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":1,
                "order_type":2,
                "price":"0.071500",
                "amount":"9.6767",
                "money":"0.69188405",
                "pay_bix":0,
                "fee_symbol":"BIX",
                "fee":"0.00000000",
                "is_maker":0,
                "relay_id":"12826902662624234"
            }
        ]
    },
    "cmd":"orderDetail",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
sum Total turnover
orderList Deal records
id Deal record id
createdAt Deal record time
account_type Account type, 0-spot account
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Deal price
amount Deal amount
money Deal value
pay_bix Wether pay fee with BIX, 0 not activated, 1 activated
fee_symbol fee currency
fee fee
is_maker Whether is maker, 0-No, 1-Yes
relay_id associated order id
Other fields Ignore

Get an order detail

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/order";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    id: "12845594488036185",
    account_type: 0
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/order

Name Necessary or not Type Description Default value Value range
id true string order id
account_type true integer account type 0-spot account

Response

{
    "result":{
        "id":"12845594488036185",
        "createdAt":1604305967000,
        "account_type":0,
        "pair":"BIX_USDT",
        "coin_symbol":"BIX",
        "currency_symbol":"USDT",
        "order_side":2,
        "order_type":2,
        "price":"0.054580",
        "deal_price":"0.000000",
        "amount":"100.0000",
        "money":"5.45800000",
        "deal_amount":"0.0000",
        "deal_percent":"0.00%",
        "deal_money":"0.00000000",
        "deal_count":0,
        "status":5,
        "unexecuted":"100.0000"
    },
    "cmd":"order",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
id order id
createdAt Creation time
account_type Account type 0-spot account
pair Trading pair
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Order price, market order is 0
amount Order quantity
money Order value
deal_amount Dealed quantity
deal_percent Deal percentage
unexecuted Unexecuted quantity
status Status, -1 Failed 0 or 1-Pending, 2-Partially completed, 3-Completely completed, 4-Partially cancelled, 5-Completely cancelled, 6
Other fields Ignore

Get deal records

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/orderHistoryList";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    pair:'BIX_USDT',
    account_type: 0,
    page: 1,
    size: 10
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/orderHistoryList

Name Necessary or not Type Description Default value Value range
pair false string Trading pair BIX_BTC, ETH_BTC, ...
account_type true integer account type 0-spot account
order_side false integer Trading direction 1-Buy, 2-Sell
coin_symbol false string Trading currency BIX, EOS, ...
currency_symbol false string Pricing currency BTC, USDT, ...
page true integer page number starting from 1
size true integer number per page 1-50

Response

{
    "result":{
        "count":1,
        "page":1,
        "items":[
            {
                "id":"2251799823470863902",
                "createdAt":1599730918000,
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":1,
                "order_type":2,
                "price":"0.071500",
                "amount":"9.6767",
                "money":"0.69188405",
                "pay_bix":0,
                "fee_symbol":"BIX",
                "fee":"0.00000000",
                "is_maker":0,
                "relay_id":"12826902662624234"
            }
        ]
    },
    "cmd":"orderHistoryList",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
sum Total turnover
orderList Deal records
id Deal record id
createdAt Deal record time
account_type Account type, 0-spot account
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Deal price
amount Deal amount
money Deal value
pay_bix Wether pay fee with BIX, 0 not activated, 1 activated
fee_symbol fee currency
fee fee
is_maker Whether is maker, 0-No, 1-Yes
relay_id associated order id
Other fields Ignore

Get the latest deal records

Query the deal records after the specified id number, and return 1000 records per page

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let url = "https://api.bibox.com/v3.1/orderpending/orderDetailsLast";

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842";

let param = {
    pair:'BIX_USDT',
    account_type: 0,
    page: 1,
    id:"2251799823470863900"
};

let cmd = JSON.stringify(param); //format param
let timestamp ='' + (Date.now());
let sign = CryptoJS.HmacMD5(timestamp + cmd, secret).toString();//sign cmds

request.post({
        url: url,//request path
        method: "POST",//Request method
        headers: {//Set request header
            'content-type':'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: cmd//post parameter string
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }

        console.log(body)

    });

POST https://api.bibox.com/v3.1/orderpending/orderDetailsLast

Name Necessary or not Type Description Default value Value range
pair false string Trading pair BIX_BTC, ETH_BTC, ...
account_type true integer account type 0-spot account
id true string id number at the beginning of the Trading record greater than "1000000000"
page true integer page number starting from 1

Response

{
    "result":{
        "count":2,
        "page":1,
        "items":[
            {
                "id":"2251799823470863902",
                "createdAt":1599730918000,
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":1,
                "order_type":2,
                "price":"0.071500",
                "amount":"9.6767",
                "money":"0.69188405",
                "pay_bix":0,
                "fee_symbol":"BIX",
                "fee":"0.00000000",
                "is_maker":0,
                "relay_id":"12826902662624234"
            },
            {
                "id":"2251799825448005865",
                "createdAt":1604312287000,
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "order_side":2,
                "order_type":2,
                "price":"0.054330",
                "amount":"100.0000",
                "money":"5.43300000",
                "pay_bix":0,
                "fee_symbol":"USDT",
                "fee":"0.00000000",
                "is_maker":1,
                "relay_id":"12874181782731851"
            }
        ]
    },
    "cmd":"orderDetailsLast",
    "state":0
}
Name Description
state 0 means success, otherwise means failure
sum Total turnover
orderList Deal records
id Deal record id
createdAt Deal record time
account_type Account type, 0-spot account
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Deal price
amount Deal amount
money Deal value
pay_bix Wether pay fee with BIX, 0 not activated, 1 activated
fee_symbol fee currency
fee fee
is_maker Whether is maker, 0-No, 1-Yes
relay_id associated order id
Other fields Ignore

Transfer Assets(Need ApiKey)

Wallet to Spot

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); 

let param = {
    "type": 0,
    "amount": "100",
    "symbol": 'USDT'
};

let strParam = JSON.stringify(param);

let strToSign = '' + timestamp + strParam; 

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; 
let sign = CryptoJS.HmacMD5(strToSign, secret).toString()

let url = "https://api.bibox.com/v3.1/assets/transfer/spot";

request.post({
        url: url,
        method: "POST",
        headers: {
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam 
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) 

    });

POST https://api.bibox.com/v3.1/assets/transfer/spot

Name Necessary Type Description Default Range
symbol true string
amount false string
type false int 0wallet to spot; 1 spot to wallet

Response

{}

Wallet to Leverage

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); 

let param = {
    "pair": "*_USDT",
    "amount": 100,
    "symbol": 'USDT'
};

let strParam = JSON.stringify(param); 

let strToSign = '' + timestamp + strParam; 

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; 
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();

let url = "https://api.bibox.com/v3.1/credit/transferAssets/base2credit";

request.post({
        url: url,
        method: "POST",
        headers: {
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam 
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) 

    });

POST https://api.bibox.com/v3.1/credit/transferAssets/base2credit

Name Necessary Type Description Default Range
coin_symbol true string
amount false double
pair false string EOS_USDT,BTC_USDT, *_USDT...

Response

{}

Leverage to Wallet

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); 

let param = {
    "pair": "BTC_USDT",
    "amount": 100,
    "symbol": 'USDT'
};

let strParam = JSON.stringify(param); 

let strToSign = '' + timestamp + strParam; 

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; 
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();

let url = "https://api.bibox.com/v3.1/credit/transferAssets/credit2base";

request.post({
        url: url,
        method: "POST",
        headers: {
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam 
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) 

    });

POST https://api.bibox.com/v3.1/credit/transferAssets/credit2base

Name Necessary Type Description Default Range
coin_symbol true string
amount false double
pair false string EOS_USDT,BTC_USDT, *_USDT...

Response

{}

Credit/Leverage(Need ApiKey)

Lend Order

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "page":1,
    "status":[
        0,
        1
    ],
    "coin_symbol":"USDT",
    "size":1
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/lendOrder/get";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/lendOrder/get

Name Necessary Type Description Default Range
coin_symbol true string
status false int 0-normal 1-part 2-finish
page false int
size false int

Response

{
    "count": 2,
    "page": 1,
    "items": [
        {
            "id": 14,
            "user_id": 8114202916,
            "coin_id": 60,
            "coin_symbol": "USDT",
            "amount": "1000.00000000",
            "amount_receipt": "0.00000000",
            "interest_rate": "0.00200000",
            "insurance_rate": "0.10000000",
            "fee": "0.00000000",
            "insurance": "0.00000000",
            "interest": "2.33333324",
            "interest_receipt": "0.00000000",
            "period": 7,
            "expireAt": "2019-11-18T03:00:00.000Z",
            "status": 0,
            "createdAt": "2019-11-11T03:50:47.000Z",
            "days": 1
        }
    ],
    "validSymbols": [
        "USDT"
    ]
}

Name Description
coin_symbol
amount lend amount
amount_receipt receipt
interest_rate interest rate
insurance_rate insurance
fee fee
insurance insurance
interest interest
status 0:normal,part,finish

Borrow Order

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "page":1,
    "status":[
        1,
        2
    ],
    "size":10,
    "pair":"BTC_USDT"
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/borrowOrder/get";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/borrowOrder/get

Name Necessary Type Description Default Range
coin_symbol true string USDT, EOS...
pair true string BTC_USDT, ETH_USDT, *_USDT cross
status true int or Array status 1Normal, 2Part, 3-6Finish
page true integer
size true integer 1-50

Response

{
    "count": 2,
    "page": 1,
    "items": [
        {
            "id": 539354,
            "user_id": 8114202916,
            "coin_id": 60,
            "coin_symbol": "USDT",
            "pair": "BTC_USDT",
            "amount": "406.00000000",
            "amount_refund": "0.00000000",
            "interest_rate": "0.00010000",
            "interest_rate_hour": "0.00000417",
            "interest": "0.26559180",
            "interest_refund": "0.00000000",
            "period": 7,
            "expireAt": "2019-11-15T11:00:00.000Z",
            "status": 1,
            "createdAt": "2019-11-08T11:53:15.000Z"
        }
    ],
    "validSymbols": [
        {
            "coin_symbol": "USDT",
            "pair": "BTC_USDT"
        }
    ]
}

Name Description
coin_symbol
pair
amount borrow amount
amount_refund borrow refund
interest_rate interest rate
interest interest
interest_refund refund
status 1normal,2part,3finish

LendOrder Pending

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "page":1,
    "status":[
        0,
        1
    ],
    "coin_symbol":"EOS",
    "size":50
}

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/lendOrderbook/get";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/lendOrderbook/get

Name Necessary Type Description Default Range
coin_symbol true string USDT, EOS, ...
status true integer or integerArray status 0未成交, 1部分成交, 2已完成
page true integer
size true integer 1-50

Response

{
    "count":1,
    "page":1,
    "items":[
        {
            "id":1,
            "user_id":10000000,
            "coin_id":61,
            "coin_symbol":"EOS",
            "amount":5,
            "amount_finish":0,
            "interest_rate":0.001,
            "period":7,
            "expireAt":"2018-12-29T10:59:18.000Z", 
            "status":0,
            "createdAt":"2018-12-22T10:59:18.000Z" 
        }
    ],
    "validSymbols":[
        "EOS"
    ]
}

Name Description
coin_symbol
amount unfill amount
amount_finish finish amount
interest_rate interest rate

Lend Assets

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "coin_symbol":"EOS"
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/transferAssets/lendAssets";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/transferAssets/lendAssets

Name Necessary Type Description Default Range
coin_symbol true string

Response

{
    "balance":"1.52319980",
    "lend":"0.00000000",
    "lend_book":"0.00000000",
    "interest":"0.00000000",
    "lend_receipt":"1.44000000",
    "interest_receipt":"0.16115200" 
}

Name Description
balance avaliable
lend lend
lend_book pending
interest interest
lend_receipt receipt
interest_receipt interest

Borrow Assets

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "pair":"BTC_USDT",
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/transferAssets/borrowAsset";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/transferAssets/borrowAssets

Name Necessary Type Description Default Range
pair true string BTC_USDT, ETH_USDT, *_USDT cross

Response

{
    "pair": "BTC_USDT",
    "currency_deposit": "8406.00000000",
    "currency_borrow": "506.34642529",
    "currency_can_borrow": "70590.53574710",
    "margin_radio": "1660.13",
    "max_leverage_ratio": 10, 
    "current_leverage_radio": "2",
    "force_deal_radio": 110,
    "force_price": "0",
    "items": [
        {
            "coin_symbol": "BTC",
            "coin_id": 42,
            "balance": "0.00000000",
            "freeze": "0.00000000",
            "borrow": "0",
            "can_transfer_credit": "0.00000000",
            "can_transfer_main": "0",
            "can_borrow": "8.82381696",
            "borrow_book": "0",
            "force_price": "0",
            "bust_price": "0",
            "price": "8000",
            "interest": "0",
            "total": "0.00000000"
        },
        {
            "coin_symbol": "USDT",
            "coin_id": 60,
            "balance": "8406.00000000",
            "freeze": "0.00000000",
            "borrow": "506.34642529",
            "can_transfer_credit": "7494.57643447",
            "can_transfer_main": "5000.00000000",
            "can_borrow": "70590.53574710",
            "borrow_book": "0",
            "force_price": "0",
            "bust_price": "0",
            "price": "1",
            "interest": "0.34642529",
            "total": "8406.00000000"
        }
    ]
}

Name Description
pair
currency_deposit all amount
currency_borrow borrow amount
currency_can_borrow can borrow
margin_radio margin radio
current_leverage_radio current_leverage
force_deal_radio force deal radio
force_price force price(isolated)
balance avaliable
freeze freeze
borrow borrow
interest interest

Borrow

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "coin_symbol": "BTC",
    "pair": "BTC_USDT",
    "amount":"5.0036"
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/borrowOrder/autobook";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/borrowOrder/autobook

Name Necessary Type Description Default Range
coin_symbol true string EOS, BTC, USDT
pair true string BTC_USDT, *_USDT
amount true double

Response

{}

Refund

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "coin_symbol": "BTC",
    "pair": "BTC_USDT",
    "amount":"5.0036"
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/borrowOrder/refund";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/borrowOrder/refund

Name Necessary Type Description Default Range
coin_symbol true string EOS, BTC, USDT
pair true string BTC_USDT, *_USDT
amount true double

Response

{}

Publish Lend

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "coin_symbol":"EOS",
    "amount":"5",
    "interest_rate":0.001,
    "is_insurance":1,
    "force":1
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/lendOrderbook/publish";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/lendOrderbook/publish

Name Necessary Type Description Default Range
coin_symbol true string USDT, EOS, ...
amount true double
interest_rate true double
is_insurance true integer 0 or 1
force true integer 1

Response

{}

Cancel LendOrder

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
     "orderbook_id":9064
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/lendOrderbook/cancel";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/lendOrderbook/cancel

Name Necessary Type Description Default Range
orderbook_id true integer order id

Response

{}

Credit Trade

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "account_type":1,
    "pair":"BTC_USDT",
    "order_type":2,
    "price":"100",
    "amount":"1",
    "money":"100.0000",
    "order_side":1
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/trade/trade";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/trade/trade

Name Necessary Type Description Default Range
pair string 交易对
account_type integer 1-isolate 257-cross
order_type integer 2-limit
order_side integer 1-buy,2-sell
price string price min 0.00000001
amount string amount min 0.0001
money string price*amount

Response

{}

Name Description
orders_id order id

Cancel

Request

let CryptoJS = require("crypto-js");
let request = require("request");

let timestamp = Date.now(); // 1.timestamp

let param = {
    "orders_id": "4631142976192513" 
};

let strParam = JSON.stringify(param); // 2.params

let strToSign = '' + timestamp + strParam; // 3.signed params

let apikey = "900625568558820892a8c833c33ebc8fd2701efe"; 
let secret = "c708ac3e70d115ec29efbee197330627d7edf842"; //secret
let sign = CryptoJS.HmacMD5(strToSign, secret).toString();//4.signed

let url = "https://api.bibox.com/v3.1/credit/trade/cancel";

request.post({
        url: url,//path
        method: "POST",//method
        headers: {//5.headers
            'content-type': 'application/json',
            'bibox-api-key': apikey,
            'bibox-api-sign': sign,
            'bibox-timestamp': timestamp
        },
        body: strParam // 6.params
    },

    function optionalCallback(err, httpResponse, body) {
        if (err) {
            return console.error('upload failed:', err);
        }
        console.log(body) // 

    });

POST https://api.bibox.com/v3.1/credit/trade/cancel

Name Necessary Type Description Default Range
orders_id true string orderid

Response

{}

WebSocket

Subscribe to Kline data

Example


const WebSocket = require('ws');
const zlib = require('zlib');

const biboxws ='wss://push.bibox.me';

let wsClass = function () {

};

wsClass.prototype._decodeMsg = async function (data) {
    let that = this;
    return new Promise((resolve, reject) => {
        // console.log(Buffer.from(data,'base64'))
        zlib.unzip(Buffer.from(data,'base64'), (err, buffer) => {
            if (err) {
                return reject(err);
            }
            try {
                console.log('_decodeMsg', buffer.toString())
                let data = JSON.parse(buffer.toString());
                resolve(data);
            } catch (e) {
                console.log('_decodeMsg catch', buffer.toString())
                reject(e);
            }
        });
    }).catch(err => {
        console.warn(err);
    });
};

wsClass.prototype._consumerMsg = function (msg) {
    let that = this;
    Promise.resolve().then(async () => {
        let data = msg.data;
        if (msg.binary == 1) {
            data = await that._decodeMsg(data);
        }
    }).catch(err => {

    });
};

wsClass.prototype._initWs = async function () {
    let that = this;
    let ws = new WebSocket(biboxws);
    that.ws = ws;

    ws.on('open', function open() {
        console.log(new Date(),'open')
        {
            ws.send(JSON.stringify({
                event:'addChannel',
                channel:'bibox_sub_spot_BTC_USDT_kline_1min',
                binary: 0,
                ver: 0,
            }));
        }
    });

    ws.on('close', err => {
        console.log('close,', err);
    });

    ws.on('error', err => {
        console.log('error', err);
    });

    ws.on('ping', err => {
        console.log('ping', err.toString('utf8'));
    });

    ws.on('pong', err => {
        console.log('pong', err.toString('utf8'));
    });

    ws.on('message', data => {
        console.log('message', data)
        let jdata = JSON.parse(data); // get data
        for (let i = 0; i <jdata.length; i++) {
            let item = jdata[i];
            if (!item.data) {
                continue;
            }
            that._consumerMsg(item);
        }
    });
};

let instance = new wsClass();

instance._initWs().catch(err => {
    console.log(err);
});

wss://push.bibox.me

Name Necessary or not Type Description Default value Value range
pair true string trading pair trading pair, BTC_USDT, ETH_USDT
period true string candlestick period 1min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 12hour, day, week
event true string behavior 'addChannel'
channel true string 'bibox_sub_spot_' + ${pair} +'_kline_' + ${period}
binary true int 0
ver true int 0

Response

[
    {
        "channel":"bibox_sub_spot_BTC_USDT_kline_1min",
        "binary":0,
        "data_type":1,
        "data":[
            {
                "time":1604326320000,
                "open":"13365.29000000",
                "high":"13366.59990000",
                "low":"13349.58700000",
                "close":"13352.61990000",
                "vol":"42.19560000"
            },
            {
                "time":1604326380000,
                "open":"13352.63000000",
                "high":"13352.67000000",
                "low":"13352.58000000",
                "close":"13352.58990000",
                "vol":"17.27390000"
            }
        ]
    }
]

Name Description
time Start time of a certain period of kline
open Opening price
high Highest price
low Lowest price
close Closing price
vol Volume
binary 0 means the data is not compressed, 1 means the data is compressed
Other fields Ignore

Subscribe to Market Data

Example


const WebSocket = require('ws');
const zlib = require('zlib');

const biboxws ='wss://push.bibox.me';

let wsClass = function () {

};

wsClass.prototype._decodeMsg = async function (data) {
    let that = this;
    return new Promise((resolve, reject) => {
        // console.log(Buffer.from(data,'base64'))
        zlib.unzip(Buffer.from(data,'base64'), (err, buffer) => {
            if (err) {
                return reject(err);
            }
            try {
                console.log('_decodeMsg', buffer.toString())
                let data = JSON.parse(buffer.toString());
                resolve(data);
            } catch (e) {
                console.log('_decodeMsg catch', buffer.toString())
                reject(e);
            }
        });
    }).catch(err => {
        console.warn(err);
    });
};

wsClass.prototype._consumerMsg = function (msg) {
    let that = this;
    Promise.resolve().then(async () => {
        let data = msg.data;
        if (msg.binary == 1) {
            data = await that._decodeMsg(data);
        }
    }).catch(err => {

    });
};

wsClass.prototype._initWs = async function () {
    let that = this;
    let ws = new WebSocket(biboxws);
    that.ws = ws;

    ws.on('open', function open() {
        console.log(new Date(),'open')
        {
            ws.send(JSON.stringify({
                event:'addChannel',
                channel:'bibox_sub_spot_ALL_ALL_market',
                binary: 0,
                ver: 0,
            }));
        }
    });

    ws.on('close', err => {
        console.log('close,', err);
    });

    ws.on('error', err => {
        console.log('error', err);
    });

    ws.on('ping', err => {
        console.log('ping', err.toString('utf8'));
    });

    ws.on('pong', err => {
        console.log('pong', err.toString('utf8'));
    });

    ws.on('message', data => {
        console.log('message', data)
        let jdata = JSON.parse(data); // get data
        for (let i = 0; i <jdata.length; i++) {
            let item = jdata[i];
            if (!item.data) {
                continue;
            }
            that._consumerMsg(item);
        }
    });
};

let instance = new wsClass();

instance._initWs().catch(err => {
    console.log(err);
});

wss://push.bibox.me

Name Necessary or not Type Description Default value Value range
binary true int 0
ver true int 0

Response

[
    {
        "channel":"bibox_sub_spot_ALL_ALL_market",
        "binary":0,
        "data_type":1,
        "data":[
            {
                "id":1,
                "coin_symbol":"BIX",
                "currency_symbol":"BTC",
                "last":"0.00006604",
                "high":"0.00006712",
                "low":"0.00006421",
                "change":"+0.00000121",
                "percent":"+1.87%",
                "vol24H":"54475636",
                "amount":"3571.11",
                "last_cny":"2.91",
                "high_cny":"2.95",
                "low_cny":"2.83",
                "last_usd":"0.42",
                "high_usd":"0.43",
                "low_usd":"0.41"
            },
            {
                "id":2,
                "coin_symbol":"BIX",
                "currency_symbol":"ETH",
                "last":"0.00190235",
                "high":"0.00192190",
                "low":"0.00181724",
                "change":"+0.00008058",
                "percent":"+4.42%",
                "vol24H":"32059017",
                "amount":"59861.18",
                "last_cny":"2.90",
                "high_cny":"2.93",
                "low_cny":"2.77",
                "last_usd":"0.42",
                "high_usd":"0.42",
                "low_usd":"0.40"
            }
        ]
    }
]

Name Description
state 0 means success, otherwise means failure
id trading pair id
coin_symbol Trading currency
currency_symbol Pricing currency
last 24h latest price
high 24h highest price
low 24h lowest price
change 24h change
percent 24h change percent
vol24H 24h Volume
amount 24h amount
last_cny 24h latest price discount cny
high_cny 24h highest price discount cny
low_cny 24h lowest price discount cny
last_usd 24h latest price discount usd
high_usd 24h highest price discount usd
low_usd 24h lowest price discount usd
Other fields Ignore

Subscribe to Depth data

Example


const WebSocket = require('ws');
const zlib = require('zlib');

const biboxws ='wss://push.bibox.me';

let wsClass = function () {

};

wsClass.prototype._decodeMsg = async function (data) {
    let that = this;
    return new Promise((resolve, reject) => {
        // console.log(Buffer.from(data,'base64'))
        zlib.unzip(Buffer.from(data,'base64'), (err, buffer) => {
            if (err) {
                return reject(err);
            }
            try {
                console.log('_decodeMsg', buffer.toString())
                let data = JSON.parse(buffer.toString());
                resolve(data);
            } catch (e) {
                console.log('_decodeMsg catch', buffer.toString())
                reject(e);
            }
        });
    }).catch(err => {
        console.warn(err);
    });
};

wsClass.prototype._consumerMsg = function (msg) {
    let that = this;
    Promise.resolve().then(async () => {
        let data = msg.data;
        if (msg.binary == 1) {
            data = await that._decodeMsg(data);
        }
    }).catch(err => {

    });
};

wsClass.prototype._initWs = async function () {
    let that = this;
    let ws = new WebSocket(biboxws);
    that.ws = ws;

    ws.on('open', function open() {
        console.log(new Date(),'open')
        {
            ws.send(JSON.stringify({
                event:'addChannel',
                channel:'bibox_sub_spot_BIX_BTC_depth',
                binary: 0,
                ver: 0,
            }));
        }
    });

    ws.on('close', err => {
        console.log('close,', err);
    });

    ws.on('error', err => {
        console.log('error', err);
    });

    ws.on('ping', err => {
        console.log('ping', err.toString('utf8'));
    });

    ws.on('pong', err => {
        console.log('pong', err.toString('utf8'));
    });

    ws.on('message', data => {
        console.log('message', data)
        let jdata = JSON.parse(data); // get data
        for (let i = 0; i <jdata.length; i++) {
            let item = jdata[i];
            if (!item.data) {
                continue;
            }
            that._consumerMsg(item);
        }
    });
};

let instance = new wsClass();

instance._initWs().catch(err => {
    console.log(err);
});

wss://push.bibox.me

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT......

Response

[
    {
        "channel":"bibox_sub_spot_BIX_BTC_depth",
        "binary":0,
        "data_type":1,
        "data": {
            "pair":"BIX_BTC",
            "update_time":1536648343927,
            "asks":[
                {
                    "price":"0.0000683",
                    "volume":"1048.8046"
                },
                {
                    "price":"0.00006831",
                    "volume":"1008.2509"
                }
            ],
            "bids":[
                {
                    "price":"0.00006801",
                    "volume":"2.3472"
                },
                {
                    "price":"0.00006793",
                    "volume":"0.3458"
                }
            ]
        }
    }
]

Name Description
state 0 means success, otherwise means failure
pair Trading pair
update_time Timestamp
asks Seller Depth
bids Buyer Depth
price Pending price
volume Pending volume
Other fields Ignore

Subscribe to Deals data

Example


const WebSocket = require('ws');
const zlib = require('zlib');

const biboxws ='wss://push.bibox.me';

let wsClass = function () {

};

wsClass.prototype._decodeMsg = async function (data) {
    let that = this;
    return new Promise((resolve, reject) => {
        // console.log(Buffer.from(data,'base64'))
        zlib.unzip(Buffer.from(data,'base64'), (err, buffer) => {
            if (err) {
                return reject(err);
            }
            try {
                console.log('_decodeMsg', buffer.toString())
                let data = JSON.parse(buffer.toString());
                resolve(data);
            } catch (e) {
                console.log('_decodeMsg catch', buffer.toString())
                reject(e);
            }
        });
    }).catch(err => {
        console.warn(err);
    });
};

wsClass.prototype._consumerMsg = function (msg) {
    let that = this;
    Promise.resolve().then(async () => {
        let data = msg.data;
        if (msg.binary == 1) {
            data = await that._decodeMsg(data);
        }
    }).catch(err => {

    });
};

wsClass.prototype._initWs = async function () {
    let that = this;
    let ws = new WebSocket(biboxws);
    that.ws = ws;

    ws.on('open', function open() {
        console.log(new Date(),'open')
        {
            ws.send(JSON.stringify({
                event:'addChannel',
                channel:'bibox_sub_spot_BIX_BTC_deals',
                binary: 0,
                ver: 8,
            }));
        }
    });

    ws.on('close', err => {
        console.log('close,', err);
    });

    ws.on('error', err => {
        console.log('error', err);
    });

    ws.on('ping', err => {
        console.log('ping', err.toString('utf8'));
    });

    ws.on('pong', err => {
        console.log('pong', err.toString('utf8'));
    });

    ws.on('message', data => {
        console.log('message', data)
        let jdata = JSON.parse(data); // get data
        for (let i = 0; i <jdata.length; i++) {
            let item = jdata[i];
            if (!item.data) {
                continue;
            }
            that._consumerMsg(item);
        }
    });
};

let instance = new wsClass();

instance._initWs().catch(err => {
    console.log(err);
});

wss://push.bibox.me

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT......

Response

[
    {
        "channel":"bibox_sub_spot_BIX_BTC_deals",
        "binary":0,
        "data_type":1,
        "data":[
            {
                "pair":"BIX_BTC",
                "price":"0.00006788",
                "amount":"9705.9732",
                "time":1536648308000,
                "side":2
            },
            {
                "pair":"BIX_BTC",
                "price":"0.00006788",
                "amount":"11914.8712",
                "time":1536648308000,
                "side":2
            }
        ]
    }
]

Name Description
state 0 means success, otherwise means failure
pair Trading pair
price Deal price
amount Deal amount
time Deal time
side taker trading direction, 1-buy, 2-sell
Other fields Ignore

Subscribe to Ticker data

Example


const WebSocket = require('ws');
const zlib = require('zlib');

const biboxws ='wss://push.bibox.me';

let wsClass = function () {

};

wsClass.prototype._decodeMsg = async function (data) {
    let that = this;
    return new Promise((resolve, reject) => {
        // console.log(Buffer.from(data,'base64'))
        zlib.unzip(Buffer.from(data,'base64'), (err, buffer) => {
            if (err) {
                return reject(err);
            }
            try {
                console.log('_decodeMsg', buffer.toString())
                let data = JSON.parse(buffer.toString());
                resolve(data);
            } catch (e) {
                console.log('_decodeMsg catch', buffer.toString())
                reject(e);
            }
        });
    }).catch(err => {
        console.warn(err);
    });
};

wsClass.prototype._consumerMsg = function (msg) {
    let that = this;
    Promise.resolve().then(async () => {
        let data = msg.data;
        if (msg.binary == 1) {
            data = await that._decodeMsg(data);
        }
    }).catch(err => {

    });
};

wsClass.prototype._initWs = async function () {
    let that = this;
    let ws = new WebSocket(biboxws);
    that.ws = ws;

    ws.on('open', function open() {
        console.log(new Date(),'open')
        {
            ws.send(JSON.stringify({
                event:'addChannel',
                channel:'bibox_sub_spot_BIX_BTC_ticker',
                binary: 0,
                ver: 8,
            }));
        }
    });

    ws.on('close', err => {
        console.log('close,', err);
    });

    ws.on('error', err => {
        console.log('error', err);
    });

    ws.on('ping', err => {
        console.log('ping', err.toString('utf8'));
    });

    ws.on('pong', err => {
        console.log('pong', err.toString('utf8'));
    });

    ws.on('message', data => {
        console.log('message', data)
        let jdata = JSON.parse(data); // get data
        for (let i = 0; i <jdata.length; i++) {
            let item = jdata[i];
            if (!item.data) {
                continue;
            }
            that._consumerMsg(item);
        }
    });
};

let instance = new wsClass();

instance._initWs().catch(err => {
    console.log(err);
});

wss://push.bibox.me

Name Necessary or not Type Description Default value Value range
pair true string trading pair BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT......

Response

[
    {
        "channel":"bibox_sub_spot_BIX_BTC_deals",
        "binary":0,
        "data_type":1,
        "data":{
            "pair":"BIX_BTC",
            "last":"0.00006837",
            "last_usd":"0.43",
            "last_cny":"2.96",
            "high":"0.00007401",
            "low":"0.00006628",
            "buy":"0.00006814",
            "buy_amount":"2654.5376",
            "sell":"0.00006876",
            "sell_amount":"170.3094",
            "vol":"48027601",
            "percent":"-6.73%",
            "timestamp":1536650154258,
            "base_last_cny":"2.96838961"
        }
    }
]

Name Description
state 0 means success, otherwise means failure
pair Trading pair
buy Latest buying price
buy_amount Latest buying amount
sell Latest selling price
sell_amount Latest selling amount
high 24h highest price
last latest price
low 24h lowest price
timestamp Timestamp
vol 24h volume
percent 24h change percent
last_cny Latest Trading price, priced in cny
last_usd Latest Trading price, priced in usd
Other fields Ignore

How to subscribe to user data

Practical example


'use strict'

const WebSocket = require('ws');
let CryptoJS = require("crypto-js");

const biboxws ='wss://push.bibox.me'; // 1. Request path

let apikey = '900625568558820892a8c833c33ebc8fd2701efe'; // your apikey
let param = {// Define the parameter object param, need to use apikey
    "apikey": apikey,
    "channel": "bibox_sub_spot_ALL_ALL_login",
    "event": "addChannel"
};
let strParam = JSON.stringify(param); // Format the parameter object param, get strParam
let secret ='c708ac3e70d115ec29efbee197330627d7edf842'; // apikey password
let sign = CryptoJS.HmacMD5(strParam, secret).toString(); // Use apikey's password secret to sign strParam with HmacMD5 and get the signature result sign
let wsparam = {// 2. Request parameter
    "apikey": apikey,
    "channel": "bibox_sub_spot_ALL_ALL_login",
    "event": "addChannel",
    "sign": sign,
};


let init = function () {

    let ws = new WebSocket(biboxws);

    setInterval(function () {
        if (ws && ws.readyState == WebSocket.OPEN) {
            console.log('manu ping');
            ws.ping(Date.now());
        }
    }, 1000 * 10);

    ws.on('open', function open() {

        console.log('open')
        ws.send(JSON.stringify(wsparam));

    });

    ws.on('close', err => {
        console.log('close,', err);
    });

    ws.on('error', err => {
        console.log('error', err);
    });

    ws.on('ping', err => {
        console.log('ping', err)
    });

    ws.on('pong', err => {
        console.log('pong', err)
    });

    ws.on('message', function incoming(data) {
        let jdata = JSON.parse(data); // return result
        if (!jdata.ping) {
            console.log('message', data)
        }

    });
};

module.exports = {};

init();


wss://push.bibox.me

Name Necessary or not Type Description Default value Value range
apikey true string The apikey you applied for on Bibox Exchange
sign true string Use the apisecret you applied for on Bibox Exchange to sign the entire request data
event true string behavior 'addChannel'
channel true string 'bibox_sub_spot_ALL_ALL_login'
  1. Define the parameter object param, need to use apikey

let apikey ='thisisyourapikey';

let param = { "apikey": apikey, "channel": "bibox_sub_spot_ALL_ALL_login", "event": "addChannel" };

  1. Format the parameter object param to get strParam

let strParam = JSON.stringify(param);

  1. Use apikey's password secret to sign strParam with HmacMD5, and get the signature result sign

let CryptoJS = require("crypto-js");

let secret ='c708ac3e70d115ec29efbee197330627d7edf842';

let sign = CryptoJS.HmacMD5(strParam, secret).toString();

  1. Generate subscription parameters wsparam

let wsparam = { "apikey": apikey, "channel": "bibox_sub_spot_ALL_ALL_login", "event": "addChannel", "sign": sign, };

Response

[
    {
        "channel":"bibox_sub_spot_ALL_ALL_login",
        "binary":"0",
        "data_type":0,
        "data":{
            "result":"Subscribed successfully"
        }
    }
]

Name Description
result "Subscribed successfully" means subscribed successfully
Other fields Ignore

Subscribe to user data to analyze spot assets

assets

Response

[
    {
        "channel":"bibox_sub_spot_ALL_ALL_login",
        "binary":"0",
        "data_type":1,
         "data":{
             "assets":{
                 "normal":{
                     "BIX":{
                         "balance":"497.59601765",
                         "freeze":"0.00000000"
                     },
                     "USDT":{
                         "balance":"20.52027574",
                         "freeze":"22.12000000"
                     }
                 }
             }
         }
    }
]

Name Description
normal Spot account assets
balance Available assets
freeze freeze assets
Other fields Ignore

Subscribe to user data to analyze credit assets

assets

Response

[
    {
        "channel":"bibox_sub_spot_ALL_ALL_login",
        "binary":"0",
        "data_type":1,
         "data":{
             "assets":{
                 "credit":{
                     "BIX_USDT":{
                         "BIX":{
                             "balance":"681.74441804",
                             "freeze":"0.00000000"
                         },
                         "USDT":{
                             "balance":"0.21698199",
                             "freeze":"0.00000000"
                         }
                     },
                     "BTC_USDT":{
                         "BTC":{
                             "balance":"100",
                             "freeze":"0.00000000"
                         },
                         "USDT":{
                             "balance":"10",
                             "freeze":"0.00000000"
                         }
                     }
                 }
             }
         }
    }
]

Name Description
credit Credit account assets
balance Available assets
freeze freeze assets
Other fields Ignore

Subscribe to user data to analyze orders

orderpending

Response

[
    {
        "channel":"bibox_sub_spot_ALL_ALL_login",
        "binary":"0",
        "data_type":1,
        "data":{
            "orderpending":{
                "id":"12875281286404369",
                "client_oid":"0",
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "price":"0.053000",
                "deal_price":"0.000000",
                "amount":"100.0000",
                "vamount":"100.0000",
                "deal_amount":"0.0000",
                "money":"5.30000000",
                "deal_money":"0.00000000",
                "deal_count":0,
                "deal_percent":"0.00%",
                "order_from":1,
                "order_side":2,
                "order_type":2,
                "status":1,
                "unexecuted":"100.0000",
                "createdAt":1604325924719
            }
        }
    }
]

Name Description
state 0 means success, otherwise means failure
count The number of records on the current page, if there is a next page, count=the number of records on the current page+1
page page number, starting from 1
items records
id order id
createdAt Creation time
account_type Account type 0-spot account
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Order price, market order is 0
amount Order quantity
money Order value
deal_amount Deal quantity
deal_percent Deal percentage
unexecuted Unexecuted quantity
status Status, -1 Failed 0 or 1-Pending, 2-Partially completed, 3-Completely completed, 4-Partially cancelled, 5-Completely cancelled, 6
Other fields Ignore

Subscribe to user data to analyze the deal records

history

Response

[
    {
        "channel":"bibox_sub_spot_ALL_ALL_login",
        "binary":"0",
        "data_type":1,
        "data":{
            "history":{
                "id":"2251799825471069694",
                "account_type":0,
                "coin_symbol":"BIX",
                "currency_symbol":"USDT",
                "price":"0.050921",
                "amount":"64.2237",
                "money":"3.27033502",
                "fee":"0.00000000",
                "order_from":0,
                "order_side":1,
                "order_type":2,
                "is_maker":0,
                "relay_id":"12939052839213054",
                "createdAt":1604387364308
            }
        }
    }
]

Name Description
state 0 means success, otherwise means failure
id Deal record id
createdAt Deal record time
account_type Account type, 0-spot account
coin_symbol Trading currency
currency_symbol Pricing currency
order_side Trading direction, 1-buy, 2-sell
order_type Order type, 1-market order, 2-limit order
price Deal price
amount Deal amount
money Deal value
fee fee
is_maker Whether is maker, 0-No, 1-Yes
relay_id associated order id
Other fields Ignore

Errors

错误码

Code 描述 Msg
2003 Cookie 失效 Cookie expired
2033 操作失败!订单已完成或已撤销 Operation failed! Order completed or canceled
2034 操作失败!请检查参数是否正确 Operation failed! Please check parameter
2040 操作失败!没有该订单 Operation failed! No record
2064 订单撤销中,不能再次撤销 Canceling. Unable to cancel again
2065 委托价格设置过高,请重新设置价格 Precatory price is exorbitant, please reset
2066 委托价格设置过低,请重新设置价格 Precatory price is low , please reset
2067 暂不支持市价单 Limit Order Only
2068 下单数量不能低于0.0001 Min Amount:0.0001
2069 市价单无法撤销 Market order can not be canceled
2078 下单价格非法 unvalid order price
2085 币种最小下单数量限制 the trade amount is low
2086 账户资产异常,限制下单 Abnormal account assets, trade is forbiden
2091 请求过于频繁,请稍后再试 request is too frequency, please try again later
2092 币种最小下单金额限制 Minimum amount not met
3000 请求参数错误 Requested parameter incorrect
3002 参数不能为空 Parameter cannot be null
3009 推送订阅channel不合法 Illegal subscription channel
3010 websocket连接异常 websocket connection error
3011 接口不支持apikey请求方式 Illegal subscribe event
3012 apikey无效 Interface does not support apikey request method
3016 交易对错误 Invalid apikey
3017 推送订阅event不合法 Trading pair error
3024 apikey权限不足 apikey authorization insufficient
3025 apikey签名验证失败 apikey signature verification failed
3026 apikey ip受限制 apikey ip is restricted
3027 账户没有apikey No apikey in your account
3028 账户apikey数量超过了限制数量 Account apikey has exceeded the limit amount
3029 apikey允许ip数量超过了限制数量 apikey ip has exceeded the limit amount
3033 查询类请求限制一个cmd query allow only one cmd
3034 最大cmd个数限制 maxinum cmds
3035 cmd请求个数限制 too many cmds
4000 当前网络连接不稳定,请稍候重试 the network is unstable now, please try again later
4003 服务器繁忙,请稍后再试 The server is busy, please try again later