For a better experience, please use Google Chrome
用户API-HTTP接口
API

HTTPAPI

XT provides users with a simple and powerful API, designed to help users quickly and efficiently integrate XT transaction function into their applications.

API Domain Name

Domain Addresshttps://www.xt.com/

Instructions

Before utilizing these API, you need to get two params-API ID and API Secret-by logging in API function. Using these two params to own advanced authorities such as making a transaction, withdrawing and so on. Please keep it confidential. All HTTP interfaces need to be signed, whose rules are explained later.

1Configuration & Basic Function API

1.1Acquire Market List

path:https://www.xt.com/exchange/config/controller/website/MarketController/getByWebId
Request method:get
Request message

None

Successful return message


{
  { "datas": [
    {
      "amountDecimal": 8,//quantity accuracy
      "minAmount": "0.0001000000",//minimum quantity
      "buyerCurrencyId": "2",//buyer’s currency
      "priceDecimal": 8,//price accuracy
      "serverId": "entrust-server-001",//service ID
      "marketId": "70",//market ID
      "webId": "100", //station ID
      "modifyTime": 0,
      "sellerCurrencyId": "19",//Seller’s currency
      "createTime": 1522400906009,
      "defaultFee": "0.00050000",//Default rate
      "name": "zt_btc",//market name
      "leverType": "1",//margin trade type: 1stock 2margin
      "state": 1,//situation: 1 run, 0 stop -1 delete
      "openTime": 1,//opening time
    },
    ....
  ],
  "resMsg": {
    "code": "1",
    "method": null,
    "message": "success !"
  }
}

1.2Get Currency List

path:https://www.xt.com/exchange/config/controller/website/CurrencyController/getCurrencyList
Request method :get
Request message

None

Successful return message

{
  "datas": [
    {
      "totalNumber": "230000000.00000000",//Total
      "tradeSearchUrl": null,//trade search address
      "tokenCoinsId": 0,//the token of another currency if >0,otherwise =0
      "minCash": null,
      "tokenName": null,//
      "description": "BTC",//Detail
      "arithmetic": null,   //consensus algorithm
      "dailyDrawLimit": 10000,
      "remark": null,   //
      "isLegalCoin": 0, //legal tender or not, 1Yes, 0No
      "outConfigTimes": 0,//
      "timesFreetrial": "0",//
      "hourFreetrial": "0",//
      "inConfigTimes": 6,//
      "alias": "b",//alias
      "logo": "market-btc.png",//logo
      "needBlockUrl": 0,//need block address or not,0No 1Yes
      "currencyId": "2",//currency id
      "drawFlag": 1,
      "rechargeFlag": 1,
      "onceDrawLimit": 100,
      "founder": null,
      "drawFee": "0.00100000",
      "blockChainUrl": "https://blockchain.info/tx/", //blockchain search address
      "dayFreetrial": "0",
      "marketValue": null,//market value
      "minFee": null,
      "teamAddress": null,
      "defaultDecimal": 2,//currency accuracy- lower priority to the configuration in market
      "publishNumber": "14500000.00000000",//published
      "isMining": "0",//provide mining or not
      "name": "btc",//name
      "limitAmount": null,
      "websiteCurrencyId": "223f4d23232",
      "descriptionEnglish": "<p>The BTC is ...</p>",//English description
      "mark": null//mark
    },
    .....
  ],
  "resMsg": {
    "code": "1",
    "method": null,
    "message": "success !"
  }
}

2Trading API

2.1New Entrustment:

path:https://www.xt.com/exchange/entrust/controller/website/EntrustController/addEntrust
Request method:post
Request message:

json
{
  "amount": 0,                          //order amount
  "rangeType": 0,                       //委托类型,目前仅支持现价委托  0:现价委托  1 区间委托
  "type": 0,                            //type:0 sell 1 buy
  "marketId": "90",                     //market ID
  "price": 0                            //Price
}

Return message:

json
{
  "datas":{
    “entrustId”:"E6419466484531482624"  //entrustmentID
  },
  "resMsg":{
    "code":"1",                        //1success,see other error codes in the end
    "method":null,
    "message":"success !"
  }
}

2.2Cancel Entrustment

path:https://www.xt.com/exchange/entrust/controller/website/EntrustController/cancelEntrust
Request method:post
Request message:

json
{
  "entrustId": "E6419466484531482624",  //entrustment ID which needs to be camcelled
  "marketId": "90"                     //market ID
}

Return message:

json
{
  "datas":null,
  "resMsg":{
    "code":"1",                        //1success,see other error codes in the end
    "method":null,
    "message":"success !"
  }
}

2.3Inquire On-Going Entrustment

path: https://www.xt.com/exchange/entrust/controller/website/EntrustController/getUserEntrustRecordFromCacheWithPage
Request method:get
Request message:

marketId: 90                    //market ID

Return message:

json
{
  "datas": [{
    "amount": "1.1",            //Quantity
    "rangeType": "0",            //entrustment type 0 current price 1 interval
    "rangeLowPrice": "null",            //lowest price of interval entrustment
    "rangeHighPrice": "null",            //highest price of interval entrustment
    "totalMoney": "5.555",            //total volume
    "entrustId": "E6437955999037923328",            //entrustmentID
    "type": "0",            //0 卖出 1 购买  -1 取消
    "userId": "test6",            //user id
    "completeAmount": "0",            //amount of completed transactions
    "marketId": "80",            //Market ID
    "dealTimes": "0",            //times of transaction dealing
    "createTime": "1534928321609",            //time of order
    "price": "5.05",            //Unit Price
    "completeTotalMoney": "0",            //total volume of completed transactions
    "entrustType": "false",            //entrustment type 0(false)normal 1(true)margin
    "status": "0",            //status: -2unfreezing failed -1insufficient asset 0start 1cancel 2successful 3 part of transaction
  }],
  "resMsg": {
    "code": "1",            //1success,see other error codes in the end
    "method": null,
    "message": "success !"
  }
}

2.4Inquiry Historical Entrustment in Paging(only for entrustments done or cancelled)

paht: https://www.xt.com/exchange/entrust/controller/website/EntrustController/getUserEntrustList
Request method:get
Request message:

marketId:   90                      //market ID
pageIndex:  1               //page
pageSize:   10              //quantity showed in each page

Return message:

json
{
  "datas": [{
    "amount": "1.1",            //Quantity
    "rangeType": "0",            //entrustment type 0 current price 1 interval
    "rangeLowPrice": "null",            //lowest price of interval entrustment
    "rangeHighPrice": "null",            //highest price of interval entrustment
    "totalMoney": "5.555",            //total volume
    "entrustId": "E6437955999037923328",            //entrustmentID
    "type": "0",            //0 卖出 1 购买  -1 取消
    "userId": "test6",            //user id
    "completeAmount": "0",            //amount of completed transactions
    "marketId": "80",            //Market ID
    "dealTimes": "0",            //times of transaction dealing
    "createTime": "1534928321609",            //time of order
    "price": "5.05",            //Unit Price
    "completeTotalMoney": "0",            //total volume of completed transactions
    "entrustType": "false",            //entrustment type 0(false)normal 1(true)margin
    "status": "0",            //status: -2unfreezing failed -1insufficient asset 0start 1cancel 2successful 3 part of transaction
  }],,
  "totalPage": "2",            //number of total pages of entrustment records
  "currentPage": "1",            //current page number
  "resMsg": {
    "code": "1",            //1success,see other error codes in the end
    "method": null,
    "message": "success !"
  }
}

2.5Inquiry Entrustment Record according to Entrustment ID

path: https://www.xt.com/exchange/entrust/controller/website/EntrustController/getEntrustById
Request method:get
Request param:

marketId:   90                      //market ID
entrustId:  E6419443135315070976    // entrustment ID to inquiry

Return message:

{
  "datas": [{
    "amount": "1.1",            //Quantity
    "rangeType": "0",            //entrustment type 0 current price 1 interval
    "rangeLowPrice": "null",            //lowest price of interval entrustment
    "rangeHighPrice": "null",            //highest price of interval entrustment
    "totalMoney": "5.555",            //total volume
    "entrustId": "E6437955999037923328",            //entrustmentID
    "type": "0",            //0 卖出 1 购买  -1 取消
    "userId": "test6",            //user id
    "completeAmount": "0",            //amount of completed transactions
    "marketId": "80",            //Market ID
    "dealTimes": "0",            //times of transaction dealing
    "createTime": "1534928321609",            //time of order
    "price": "5.05",            //Unit Price
    "completeTotalMoney": "0",            //total volume of completed transactions
    "entrustType": "false",            //entrustment type 0(false)normal 1(true)margin
    "status": "0",            //status: -2unfreezing failed -1insufficient asset 0start 1cancel 2successful 3 part of transaction
  }],,
  "resMsg": {
    "code": "1",            // 1success,see other error codes in the end
    "method": null,
    "message": "success !"
  }
}

3 Finance API

3.1 Acquire deposit address

path:https://www.xt.com/exchange/fund/controller/website/FundController/getPayinAddress
Request method:get
Request message

{
    “currencyTypeName”:"btc" // currency type name (necessary)
}

Return message


{
    "datas": {
        "address": "19cdJwd3j6ArHNhiYoWpN8cJq9ash7WDDC",// deposit address
        "wallet": "merchants014"
    },
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

3.2 Inquiry Deposit Record

path:https://www.xt.com/exchange/fund/controller/website/FundController/getPayinCoinRecord
Request method:post
Request message

{
    “currencyTypeName”:“qtum”, // currency type
    “sort”:1 // no param- reverse chronological order,param- chronological order
    "pageNum":1
    "pageSize":20
}

Return message

{
    "datas": {
        "totalRow": 1,  // total row
        "totalPage": 1, // total page
        "pageSize": 20, // amount in each page
        "list": [
            {
                "currencyTypeId": 1,// currency type id
                "depositId": “f3342424”,// deposit key
                "amount": "10.0",// deposit amount
                "confirmTimes": "4",// Confirmation Times
                "createTime": "2018-03-10 10:22:09.0",// deposit time
                "depositAddress": "1BKd2sSPYzxC2XHurR6oQWc2wzSx2rZzck",// deposit address
                "txId": "6378183001917882368",// trade id
                "userId": "1",// user id
                "status": 1,//' 0:未到账  1:已到账  '

            }
        ],
        "pageNum": 1
    },
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

3.3 Inquiry Withdrawal Record

path:https://www.xt.com/exchange/fund/controller/website/FundWebSiteController/getPayoutCoinRecord
Request method:get
Request message

currencyId=1    // currency id (necessary)
tab=all         // (necessary) | all, wait(submitted,not verify yet), success(verified), fail(failed), cancel(user cancel)
pageIndex=1     // selectable, default 1
pageSize=10     // selectable, default 10

Return message

{
    "datas": {
        "totalRow": 34,                                          // total row
        "totalPage": 4,                                          // total page
        "pageSize": 10,                                          // amount in each page
        "list": [
            {
                "modifyUid": null,                               // modify id
                "withdrawalId": "W6419027628808093696",          // withdrawal id
                "fees": "0.001000000000000000",                  // Service Fees
                "amount": "10.000000000000000000",               // withdrawal amount
                "userApplyWithdrawId": "7eBDJ5PKbSK",            // withdrawal record id
                "verifyRemark": null,                            // verify remark
                "remark": null,                                  //  Remark 
                "verifyTime": 0,                                 // verify time
                "userName": "994709373@qq.com",                  // Username
                "userId": "7e9ioSoVXcW",                         // user id
                "actuallyAmount": "10.000000000000000000",       // actual amount
                "modifyTime": 0,                                 // modify time
                "verifyStatus": 0,                               // verify status (0 yet to verify , 1 success -1 fail)
                "createTime": 1530415446577,                    // time
                "state": 1,                                                             // status(-1 cancelled, 1 normal)
                "currencyId": "2",                                                          // currency id
                "withdrawalAddress": "1JimMZks39eVqU6T3v6wvz1m4LtJ3tPjGL",                  // Withdrawal address 
                "verifyUid": null                                                           // verify id
            }
        ],
        "pageNum": 1
    },
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

3.4 Acquire All Assets Information

path:https://www.xt.com/exchange/fund/controller/website/FundController/findByPage
Request method:get
Request message


{
    "pageSize":30,       #  row in each page(selectable)
    "pageNum":1          #  page number(selectable)
}

Return message

{
    "datas": {
        "totalRow": null,
        "totalPage": null,
        "pageSize": 30,
        "list": [
            {
                "currencyTypeId": 1,                    // currency type id
                "amount": "971.174000000000000000",     // amount of current assets available
                "freeze": "122.000000000000000000",     // amount of assets frozen
                "createTime": "2018-02-19 10:02:33",
                "depositAddress": null,
                "userId": "1"
            },
            {
                "currencyTypeId": 2,
                "amount": "768.368000000000000000",
                "freeze": "131.000000000000000000",
                "createTime": "2018-02-19 10:02:33",
                "depositAddress": null,
                "userId": "1"
            }
        ],
        "pageNum": 1
    },
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

3.5 Inquiry Withdrawal Address

path:https://www.xt.com/exchange/fund/controller/website/FundWebSiteController/getWithdrawAddress
Request method:get
Request message

currencyId=2          // (neseccary)
pageIndex=1           // (selectable, default 1)
pageSize=10           // ( selectable, default 10)

Return message

{
    "datas": {
        "totalRow": 2,
        "totalPage": 1,
        "pageSize": 10,
        "list": [
            {
                "address": "1DkwrD4bMtjd6kcZw8CxM9r3z4AGVFfSRz",    // address
                "modifyTime": 1524217688882,                        // modify time
                "currencyName": "btc",                              // currency name
                "createTime": 1523185357488,                        // time
                "userFundAddressId": "7bwK95B7jTk",                 // address id
                "remark": "correct",                                //  Remark 
                "currencyId": "2",                                  // currency id
                "type": 1,                                          // (1-withdrawal address, 2-deposit address)
                "userName": "Mr.牛",                                // Username
                "userId": "7e8fMkzTlL6",                            // user id
                "status": "1"                                       // status(-1 cancelled, 1 normal)
            }
        ],
        "pageNum": 1
    },
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

4 Signature Rules

4.1 Signature Rules

The signature string sign=md5 (Apiid+Timestamp+ parameter content string + signature secret key); the signature secret key is Api Secret, and Apiid will be acquired by enabling Api function on the website. There are three parameter string content rules: empty string ''"" ,when header param only, JSON string format for body JSON format parameter, key-value, and GET string param format for all params sorted according to the initial value of the key value and then spelled in the form of key1+value1+key2+value2... After signing, put Apiid, Timestamp, Sign into the header requested, pay attention to the initial capitalization and the whole lowercase.
Eg: open the API function on the website to get the following two parameters, Apiid=7eESLc0x69I7eESLc0x69J, Apisecret = 87ceba599b6d39a39deb01cf71eacd57, Timestamp=1526886847,
a, Body JSON format parameters

 Param content json character string:{"userId":"u111","name":"zhangsan"}
Param conten collage string:{"userId":"u111","name":"zhangsan"}
Then Sign = md5(7eESLc0x69I7eESLc0x69J1526886847000{"userId":"u111","name":"zhangsan"}87ceba599b6d39a39deb01cf71eacd57)
= 1429945054c993ea3e22a28227bf7b25   

b、 No body or get param

 No param in content collage string Then
Sign = md5(7eESLc0x69I7eESLc0x69J152688684700087ceba599b6d39a39deb01cf71eacd57)
= 735aeffac07c60ddeb2d6f18115c1946 

c、formdata key-value, or get param

 Param content:userid=10,status=1,acount = 10
Param conten collage string:account10status1userid10
Then Sign = md5(7eESLc0x69I7eESLc0x69J1526886847000account10status1userid1087ceba599b6d39a39deb01cf71eacd57)
= 1d83cb6bde160eff50fbb13a407e7804   

Signature codes for Java are as follows. For other language please implement your own code writing

package com.xt.api.demo;

import com.alibaba.fastjson.JSON;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author: cai.zhenghao
 * @Description:
 * @Date: Created in 2018/6/26   下午3:48
 * @Modified By:
 */
public class SignUtils {

    /**
     * 自行根据需要设置,一般认为一个服务里使用的只有一个
     */
    public static String ID_NAME = "Apiid";
    private static final Integer CLIENT_TYPE = 5;//API调用

    /**
     * 不为空、不为空字符串、不为双引号、不为空{}
     *
     * @param source
     * @return
     */
    public static boolean isEmpty(String source) {
        return source == null || source.isEmpty() || source.equals("\"\"") || source.trim().equals("{}");
    }

    /**
     * 参数是formdata key value,或者get参数 形式的情况下获取签名header
     *
     * @param parameters
     * @return
     */
    public static Map getHeaderOfKeyValue(String id, String secret, Map parameters) {
        long time = System.currentTimeMillis();
        Map header = new HashMap();
        StringBuffer contentSb = new StringBuffer();
        if (parameters != null) {
            parameters.entrySet().stream()
                    .filter(a -> a != null && (!isEmpty(a.getKey()) || !isEmpty((String) a.getValue()))).
                    sorted(Map.Entry.comparingByKey()).forEachOrdered(e -> contentSb.append(e.getKey() + e.getValue()));
        }
        header.put(ID_NAME, id);
        header.put("Timestamp", String.valueOf(time));
        header.put("Clienttype", "" + CLIENT_TYPE);
        header.put("Sign", encryptMD5(id + time + contentSb.toString() + secret));
        return header;

    }

    /**
     * 参数为空情况下获取签名header
     *
     * @return
     */
    public static Map getHeaderOfNoParams(String id, String secret) {
        Map header = new HashMap();
        long time = System.currentTimeMillis();
        header.put(ID_NAME, id);
        header.put("Timestamp", String.valueOf(time));
        header.put("Clienttype", "" + CLIENT_TYPE);
        header.put("Sign", encryptMD5(id + time + secret));
        return header;

    }

    /**
     * 参数是body json形式的情况下获取签名header
     *
     * @param object
     * @return
     */
    public static Map getHeaderOfBodyJson(String id, String secret, Object object) {
        Map header = new HashMap();
        long time = System.currentTimeMillis();
        String params = JSON.toJSONString(object);

        header.put(ID_NAME, id);
        header.put("Timestamp", String.valueOf(time));
        header.put("Clienttype", "" + CLIENT_TYPE);
        header.put("Sign", encryptMD5(id + time + params + secret));
        return header;
    }

    public static String encryptMD5(String str) {
        System.out.println("params: " + str);
        return digest("MD5", str);
    }

    public static String digest(String code, String str) {
        try {
            MessageDigest messageDigest = MessageDigest.getInstance(code);
            messageDigest.reset();
            messageDigest.update(str.getBytes());
            byte[] byteArray = messageDigest.digest();
            StringBuffer md5StrBuff = new StringBuffer();

            for (int i = 0; i < byteArray.length; ++i) {
                if (Integer.toHexString(255 & byteArray[i]).length() == 1) {
                    md5StrBuff.append("0").append(Integer.toHexString(255 & byteArray[i]));
                } else {
                    md5StrBuff.append(Integer.toHexString(255 & byteArray[i]));
                }
            }

            return md5StrBuff.toString();
        } catch (NoSuchAlgorithmException var6) {
            var6.printStackTrace();
            return null;
        }
    }
}

5Interface of Market Quotations

Please note that the domain name of the interface of market quotations is different from the previous HTTP interfaces, and no signature is required, and the header does not need the parameters of the signature. Each IP can only access this interface 1000 times in a minute. Please control the frequency.

5.1 24H Quotation of All Markets

This data server will be updated every 10 seconds. Please do not acquire the data too frequently.
path:https://kline.xt.com/api/data/v1/tickers
Request method:get
Request message

isUseMarketName=true          //required, choose ‘ true“ to replace marketID with names like BTC_USDT; choose “false”to use marketId

Two formats of return message
When isUseMarketName=fasle

{
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    },
    "datas": [
        [
            99,
            "0.0",
            "0",
            "0",
            "0",
            "0.0",
            "[]",
            "9.396",
            "9.08",
            "21469873.428"
        ],
        [
            90,
            "8249994.968",
            "8257720.9458",
            "8207608.58",
            "1080294.9779",
            "0.51",
            "[[1, 8219706.597], [2, 8249994.998]]",
            "7418805.42381067",
            "7418805.425",
            "21469873.428"
        ]
    ]
}

When isUseMarketName=true

{
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    },
    "datas": {
        "ETC_USDT": [
            99,
            "0.0",
            "0",
            "0",
            "0",
            "0.0",
            "[]",
            "9.296",
            "9.708",
            "21469873.428"
        ],
        "BTC_KRW": [
            90,
            "8245004.195",
            "8257720.93",
            "8207608.57",
            "1187226.0187",
            "0.45",
            "[[1, 8219706.597], [2, 8245004.125]]",
            "7418805.413",
            "7418805.47",
            "21469873.408"
        ]
    }
}

Data explanation

[Market ID, latest transaction price, highest price, lowest price, 24h volume, 24h change, list of closing prices in last 6H, top buying price, top selling price, 24h volume (in unit of the buyer's currency)]

List of closing prices in last 6h in chronological order, data explanation:

[[serial number, closing price], [serial number, closing price], [serial number, closing price]]

5.2 24H Quotation of Single Market

This data server will be updated every 10 seconds. Please do not acquire the data too frequently.
path:https://kline.xt.com/api/data/v1/ticker
Request method:get
Request message

marketId=90          //either market id or market name
marketName=ETC_USDT          //either market name or market id

Return message

{
    "datas": [
        90,
        "8268227.40230003",
        "8268227.40230003",
        "8207608.58629997",
        "1725211.1401",
        "0.73",
        "[[1, 8219706.597], [2, 8266335.7998], [3, 8268227.4023]]",
        "7418805.4126",
        "7418805.4237",
        "21469873.408"
    ],
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

Data explanation

[Market ID, latest transaction price, highest price, lowest price, 24h volume, 24h change, list of closing prices in last 6H, top buying price, top selling price, 24h volume (in unit of the buyer's currency)]

List of closing prices in last 6h in chronological order, data explanation:

[[serial number, closing price], [serial number, closing price], [serial number, closing price]]

5.3 K Line

path:https://kline.xt.com/api/data/v1/klines
Request method:get
Request message

marketId=90                     //either market id or market name
marketName=ETC_USDT             //either market name or market id
type=1M                         //K line type, support 1M,5M,15M,30M,1H,1D,1W, which stand for 1-30m,1h,1day,1week
dataSize=5                      //data size, maximum 100

Return message

{
    "datas": [
        [
            "K",
            "90",
            "btc_krw",
            "1532181600",
            "8266335.737",
            "8279949.6898",
            "8266003.6894",
            "8269418.0781",
            "492264.06",
            "0.04",
            "1",
            "1H",
            "false"
        ],
        ..........
    ],
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

Data explanation

[data type, market id, market name, time stamp, opening data, highest price, lowest price, closing price, volume, change, US dollar exchange rate, k-line cycle, whether is converted]

5.4 Trading History

path:https://kline.xt.com/api/data/v1/trades
Request method:get
Request message

marketId=90                     //either market id or market name
marketName=ETC_USDT             //either market name or market id
dataSize=10                     //data size, maximum 20

Return message

{
    "datas": [
        [
            "T",
            "90",
            "1532183063",
            "BTC_KRW",
            "bid",
            "8271173.90",
            "515.50"
        ],
        ..........
    ],
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

Data explanation

[Data type, market ID, token information, time stamp, type (asks or bids), price, amount]

5.5 Market Data (Market Depth)

A maximum of 50 data of selling and buying can be returned
path:https://kline.xt.com/api/data/v1/entrusts
Request method:get
Request message

marketId=90                     //either market id or market name
marketName=ETC_USDT             //either market name or market id

Return message

{
    "datas": {
        "asks": [
            [
                "8247657.898",
                "5.95"
            ],
            [
                "7418805.435",
                "4.88"
            ],
            [
                "7418805.47",
                "0.01"
            ]
        ],
        "bids": [
            [
                "0.81945643",
                "24.32"
            ],
            [
                "0.847",
                "2.064"
            ],
            [
                "0.516",
                "17.043"
            ]
        ],
        "timestamp": "1532183394"
    },
    "resMsg": {
        "code": "1",
        "method": null,
        "message": "success !"
    }
}

Data explanation

asks: [[price, amount]]
bids: [[price, amount]]

6 External of Interface and Error Code

Failed return message

{
    "datas": null,
    "resMsg": {
        "code": "1000",
        "method": null,
        "message": "param invalid"
    }
}

Error Code List:
For configuration and basic function API, acquire interface of user information, transaction API, finance API

Error Code Description
1000 system error
1003 Invalid parameter
2000 Parameter error
2001 Delegated price type is empty
2002 Wrong delegate type
2003 Abnormal entrusted price
2004 Market ID cannot be empty
2012 entrust not exists or status abnormal
2014 There is no such order in the cache.
2015 The delegation order has been cancelled or does not exist in the database.
2016 paging:index or pageSize invalid
2017 Transaction currency quantity is empty.
2019 Delegation ID cannot be empty
2020 Delegate type cannot be empty
2022 Transaction currency amount is less than minimum value.
2999 Internal error
6002 Authorization is invalid and requires login again.
6021 Limit the withdraw operation
6076 The transaction password is incorrect, please re-enter
6095 User does not exist.
6096 Invalid parameter
6114 The withdrawal address is empty!
6124 Audit failed!
6126 Review passed
6115 Failed to submit application for withdrawal of currency!
6125 Invalid currency type!
6130 No currency selected!
6894 The time is too long,sign for api is invalid now!
6895 Failed to verify the API permission. This interface is not a authorize API!
6896 Failed to verify the API permission. The Userid is not matching with Apiid!
6897 Failed to verify the API permission. Please confirm whether to enable API permission!
6898 Failed to verify the API permission for multiple times. Please confirm whether to enable API permission!
10012 unknown error!

For quotations, market data (market depth), k line and trading history

Error Code Description
1000 system error
5010 Parameter error
5016 rdata not exist
5017 market not exist
5019 your ip has been accessed more than 1000 times a minute