用户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:post
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 :post
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",//lohgo
      "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 !"
  }
}

2Acquire the Interface of User Information

2.1Acquire the Interface of User Information

path:https://www.xt.com/exchange/user/controller/website/UserController/getUserInfo
Request method:get
Request message

None

Successful return message

{
"datas":{
"loginMobileAuth":0,//mobile authentication or not:0:No,1:Yes
"googleStatus":0,//examining status:0:not yet,1:pending
"isAlipay":"",//bind Alipay or not 1Yes 0No
"loginPwd":"1",//set login password or not:0:no,1:yes
"externalUidType":null,//type of external user id
"isWechat":"",//bind Wechat or not 1yes 0no
"loginAuth":3,//login authentication(1-password 2-remote login auth 4-google auth, free combination, default 3
"merchantName":"",//merchant name
"countryCode":null,//country code
"loginName":"13068859717",//login name
"loginGoogleAuth":1,//Google auth or not:0:no,1:yes
"email":null,//email
"nickName":"13068859717",//nick name
"isBank":"",//bind bank account or not
"mobileAuth":1,//
"mobile":"+86 13068859717",//Phone number
"userId":"test6",//user id
"recommendCode":"dGVzdDY=\u000a",//recommendation code
"realName":"",//real name
"withdrawAuth":3,//withdrawal auth(1-assets passcode 2-message/email auth 4-google auth code default asset password+message/email = 3)
"recommendCount":null,//recommendation amount
"externalUserId":null,//type of external user id
"mobileStatus":0,//examining status:0:not yet,1:pending
"safePwdAuth":1,//set security code:0:no,1:yes
"googleAuth":1,//Google auth or not:0:no,1:yes
"loginEmailAuth":0,//google auth or not:0:no,1:yes
"tradeAuth":1,//email auth:0:no,1:yes
"status":1//trade auth(1-never fill in asset psw 2-do not fill in asset psw in 6h 3-fill in asset psw in each trade)
},
"resMsg":{
"code":"1",
"method":null,
"message":"success !"
}
}

3Trading API

3.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,                       //entrustment type,only current price entrustment is supported at present 0:current price  1 interval
  "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 !"
  }
}

3.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 !"
  }
}

3.3Inquire On-Going Entrustment

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

marketId: 90                    //market ID

Return message:

json
{
  "datas": [{
    "amount": "1.1",            //Amount
    "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 sell  1 buy  -1 cancel
    "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.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",            //Amount
    "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 sell  1 buy  -1 cancel
    "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 !"
  }
}

3.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",            //Amount
    "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 sell  1 buy  -1 cancel
    "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 !"
  }
}

4 Finance API

4.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 !"
    }
}

4.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:not arrive yet  1:already arrived  '

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

4.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 !"
    }
}

4.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 !"
    }
}

4.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 !"
    }
}

5 Signature Rules

5.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

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   pm3:48
 * @Modified By:
 */
public class SignUtils {

    /**
     *  Set based on your demand, usually one in one serve
     */
    public static String ID_NAME = "Apiid";

    /**
     *  Not empty、not empty character string、not double quotation mark、not empty{}
     *
     * @param source
     * @return
     */
    public static boolean isEmpty(String source) {
        return source == null || source.isEmpty() || source.equals("\"\"") || source.trim().equals("{}");
    }

    /**
     *  acquire signature header when param is formdata key value, or get param format
     * @param parameters
     * @return
     */
    public static Map getHeaderOfKeyValue(String id, String secret,Map<String, Object> 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.<String, Object>comparingByKey()).forEachOrdered(e -> contentSb.append(e.getKey() + e.getValue()));
        }

        header.put(ID_NAME,id);
        header.put("Timestamp", String.valueOf(time));
        header.put("Sign", encryptMD5(id + time + contentSb.toString() + secret));
        return header;

    }

    /**
     *  acquire signature header when param is empty
     * @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("Sign", encryptMD5(id + time + secret));
        return header;

    }

    /**
     *  acquire signature header when param is body json format
     * @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("Sign", encryptMD5(id + time + params + secret));
        return header;
    }

    public static String encryptMD5(String 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;
        }
    }
}

6Interface 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.

6.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]]

6.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]]

6.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]

6.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]

6.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]]

7 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 Chinese Description English Description
1000 系统错误 system error
1003 无效的参数 param invalid
2000 参数错误 parameter error
2001 委托价格类型为空 entrust price range type null
2002 委托类型错误 rangeType [ 0,1] error
2003 委托价格异常 entrust price abnormal
2004 市场ID不能为空 market id null
2012 委托信息不存在或状态异常 entrust not exists or status abnormal
2014 缓存中无该该委托单 entrust not exists in cache
2015 委托单已取消或数据库中不存在 entrust already canceled or not exists in database
2016 分页index,pageSize参数有误 paging:index or pageSize invalid
2017 交易货币量为空 entrust amount null
2019 委托单ID不能为空 entrustId null
2020 委托类型不能为空 entrustType null
2022 交易货币量小于最小值 entrust amount low min limit
2999 内部错误 system error
6002 授权失效,需要重新登录 Authorization invalid, please sign in again.
6021 限制提币操作 Limit the withdraw operation
6076 安全密码错误,请重新输入 Security password error, please enter again!
6095 用户不存在 User does not exist
6096 无效的参数 Invalid parameter
6114 提币地址为空 Please select a currency address!
6124 审核失败 Audit failure!
6126 审核通过 Audit Approve!
6115 提交提币申请失败 Submit a withdrawal application failure!
6125 无效的货币类型 An invalid currency type!
6130 没有选取币种 No selection of currency, Please try again!
6894 时间过长,API签名已失效 The time is too long,sign for api is invalid now!
6895 校验API权限失败,接口不属于授权API Failed to verify the API permission. This interface is not a authorize API!
6896 校验API权限失败,Userid和Apiid不匹配 Failed to verify the API permission. The Userid is not matching with Apiid!
6897 校验API权限失败,请确认是否开启Api权限 Failed to verify the API permission. Please confirm whether to enable API permission!
6898 多次校验API权限失败,请确认是否开启Api权限 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 Chinese Description English Description
1000 系统错误 system error
5010 参数错误 param is invalid
5016 数据不存在 rdata not exist
5017 该市场不存在 market not exist
5019 你的IP一分钟内访问次数超过1000次 your ip has been accessed more than 1000 times a minute
会话

{{selectedConversation.conversationName}}

Send Message
{{curr.unreadCount}}

{{curr.conversationName}}

Send Message

{{item.senderInfo.nickname}}