用户API-HTTP接口
API

HTTPAPI

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

API Domain Name

Domain Addresshttps://www.xt.com/

Instructions

Before using these APIs, you must first obtain two parameters. After logging in to the website, enable the API function and then obtain the API ID and API Secret parameters. With these two parameters, users have advanced permissions such as order placement and currency withdrawal. Please keep all API information confidential. All http interfaces need to be signed. Signature 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: 1spot 2margin
      "state": 1,//situation: 1 run  0 stop -1 delete
      "openTime": 1,//Open 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,//Transaction inquiry address
      "tokenCoinsId": 0,//If it is greater than 0, it is a token of another currency, otherwise it is equal to 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/", //Blokchain query address (block query address)
      "dayFreetrial": "0",
      "marketValue": null,//Total market capitalization
      "minFee": null,
      "teamAddress": null,
      "defaultDecimal": 2,//Currency decimal places (currency accuracy)-the priority is lower than the configuration in the market
      "publishNumber": "14500000.00000000",//published
      "isMining": "0",//Mineable or not
      "name": "btc",//name
      "limitAmount": null,
      "websiteCurrencyId": "223f4d23232",
      "descriptionEnglish": "<p>The BTC is ...</p>",//English description
      "mark": null//symbol
    },
    .....
  ],
  "resMsg": {
    "code": "1",
    "method": null,
    "message": "success !"
  }
}

2Trading API

2.1New Order:

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"  //Order ID
  },
  "resMsg":{
    "code":"1",                        //1 means succeed, others means error and refer to description for error code
    "method":null,
    "message":"success !"
  }
}

2.2Cancel Order

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

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

Return message:

json
{
  "datas":null,
  "resMsg":{
    "code":"1",                        //1 means succeed, others means error and refer to description for error code
    "method":null,
    "message":"success !"
  }
}

2.3Obtaining open orders

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",            //Interval Type 0 Market Price Order 1 Limit interval Order
    "rangeLowPrice": "null",            //lowest price of interval entrustment
    "rangeHighPrice": "null",            //highest price of interval entrustment
    "totalMoney": "5.555",            //total volume
    "entrustId": "E6437955999037923328",            //Order ID
    "type": "0",            //0 卖出 1 购买  -1 取消
    "userId": "test6",            //user id
    "completeAmount": "0",            //amount of completed transactions
    "marketId": "80",            //Market ID
    "dealTimes": "0",            //Number of transactions processed
    "createTime": "1534928321609",            //order time
    "price": "5.05",            //Price
    "completeTotalMoney": "0",            //Total amount completed
    "entrustType": "false",            //Order Type 0 (false) Ordinary Order 1 (true) Margin Order
    "status": "0",            //status: -2unfreezing failed -1insufficient asset 0start 1cancel 2completed 3 partially traded
  }],
  "resMsg": {
    "code": "1",            //1 means succeed, others means error and refer to description for error code
    "method": null,
    "message": "success !"
  }
}

2.4Pagination query order history (only query the records of orders that have been completed and 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              //Records showed per page

Return message:

json
{
  "datas": [{
    "amount": "1.1",            //Quantity
    "rangeType": "0",            //Interval Type 0 Market Price Order 1 Limit interval Order
    "rangeLowPrice": "null",            //lowest price of interval entrustment
    "rangeHighPrice": "null",            //highest price of interval entrustment
    "totalMoney": "5.555",            //total volume
    "entrustId": "E6437955999037923328",            //Order ID
    "type": "0",            //0 卖出 1 购买  -1 取消
    "userId": "test6",            //user id
    "completeAmount": "0",            //amount of completed transactions
    "marketId": "80",            //Market ID
    "dealTimes": "0",            //Number of transactions processed
    "createTime": "1534928321609",            //order time
    "price": "5.05",            //Price
    "completeTotalMoney": "0",            //Total amount completed
    "entrustType": "false",            //Order Type 0 (false) Ordinary Order 1 (true) Margin Order
    "status": "0",            //status: -2unfreezing failed -1insufficient asset 0start 1cancel 2completed 3 partially traded
  }],,
  "totalPage": "2",            //number of total order records
  "currentPage": "1",            //current page number
  "resMsg": {
    "code": "1",            //1 means succeed, others means error and refer to description for error code
    "method": null,
    "message": "success !"
  }
}

2.5Query order records based on order ID

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

marketId:   90                      //market ID
entrustId:  E6419443135315070976    // Order ID to query

Return message:

{
  "datas": [{
    "amount": "1.1",            //Quantity
    "rangeType": "0",            //Interval Type 0 Market Price Order 1 Limit interval Order
    "rangeLowPrice": "null",            //lowest price of interval entrustment
    "rangeHighPrice": "null",            //highest price of interval entrustment
    "totalMoney": "5.555",            //total volume
    "entrustId": "E6437955999037923328",            //Order ID
    "type": "0",            //0 卖出 1 购买  -1 取消
    "userId": "test6",            //user id
    "completeAmount": "0",            //amount of completed transactions
    "marketId": "80",            //Market ID
    "dealTimes": "0",            //Number of transactions processed
    "createTime": "1534928321609",            //order time
    "price": "5.05",            //Price
    "completeTotalMoney": "0",            //Total amount completed
    "entrustType": "false",            //Order Type 0 (false) Ordinary Order 1 (true) Margin Order
    "status": "0",            //status: -2unfreezing failed -1insufficient asset 0start 1cancel 2completed 3 partially traded
  }],,
  "resMsg": {
    "code": "1",            // 1 means succeed, others means error and refer to description for error code
    "method": null,
    "message": "success !"
  }
}

3 Finance API

3.1 Obtain deposit address

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

{
    “currencyTypeName”:"btc" // Currency name (required)
}

Return message


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

3.2 Obtain 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 Query withdrawal records

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

currencyId=1    // currency ID (necessary
tab=all         // (Required) | all (all) wait (submitted but not reviewed) success (approved) fail (rejected) 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",                  // Fee
                "amount": "10.000000000000000000",               // withdrawal amount
                "userApplyWithdrawId": "7eBDJ5PKbSK",            // withdrawal record id
                "verifyRemark": null,                            // verify remark
                "remark": null,                                  //  Remark 
                "verifyTime": 0,                                 // verify time
                "userName": "[email protected]",                  // Username
                "userId": "7e9ioSoVXcW",                         // user id
                "actuallyAmount": "10.000000000000000000",       // Actual amount received
                "modifyTime": 0,                                 // modify time
                "verifyStatus": 0,                               // Review status (0 pending, 1 approved, -1 failed)
                "createTime": 1530415446577,                    // Withdrawal 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 Obtain User 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 available assets
                "freeze": "122.000000000000000000",     // amount of frozen assets
                "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 Query withdrawal address

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

currencyId=2          // (required)
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,                        // Withdrawal 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); Timestamp is in milliseconds; the signature secret key is API Secret and API ID which will be acquired by enabling API function on the website. There are three types of parameter string content rules. Only the header parameter is an empty string."" ,The body JSON format parameter is the JSON string format of the body parameter key-value and GET format parameter string.All parameters are sorted by the first letter of the key value and then spelled in the form of key1 + value1 + key2 + value2 ...After signing, put ApiID, Timestamp, and Sign into the request header. Note that the first letter is uppercase and all lowercase.
For example, after opening the API function on the website, got the following two parameters ApiID = 7eESLc0x69I7eESLc0x69J Apisecret = 87ceba599b6d39a39deb01cf71eacd57 Timestamp = 1526886847000,
a,Body JSON format parameters

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

b、 No body or get parameters

 Parameter content string is empty Then
Sign = md5(7eESLc0x69I7eESLc0x69J152688684700087ceba599b6d39a39deb01cf71eacd57)
= 735aeffac07c60ddeb2d6f18115c1946 

c、formdata key-value, Or get parameter

 Parameter content is:userid=10,status=1,acount = 10
Parameter content string is: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 get 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
The format when isUseMarketName is Fasle is as follows

{
    "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"
        ]
    ]
}

The format when isUseMarketName is True is as follows

{
    "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 trade price  highest price  lowest price  24h volume  24h change  list of closing prices in last 6H  buy 1 price  sell 1 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 get 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 trade price  highest price  lowest price  24h volume  24h change  list of closing prices in last 6H  buy 1 price  sell 1 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 Transaction Records

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 (ask or bid) 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 XT.com external 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 obtain 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 Order not exists or status abnormal
2014 There is no such order in the cache.
2015 The order has been cancelled or does not exist in the database.
2016 The pagination index pageSize parameter is incorrect
2017 Transaction currency quantity is empty.
2019 Order ID cannot be empty
2020 Order 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 Review not successful
6126 Examination Passed
6115 Failed to submit withdrawal request!
6125 Invalid currency type!
6130 No currency selected!
6894 Too long API signature has expired!
6895 Failed to verify the API permission. This interface is not an authorized API!
6896 Failed to grant the API permission. The User ID is not matching with API ID!
6897 Failed to verify the API permission. Please confirm whether API is enabled!
6898 Failed to verify the API permission for multiple times. Please confirm whether to enable API permission!
10012 unknown error!

Explanation of error codes of four types of APIs: market prices, 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 more than 1,000 visits in a minute