NAV Navbar
node.js

Introduction

Welcome to the BTX API! You can use our API to access BTX API endpoints, which can get information on various coin markets in our database.

We have language bindings in node.js! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Our APIs basically follow the rules of bittrex APIs.

Authentication

To authorize, use this code:

const crypto = require("crypto");
const request = require("request");
const querystring = require("querystring");

const BASE_URL = "https://api.btxpro.com/v1.1";
const method = "/market/buylimit";
const publicKey = "90d1415d13d8ea7061ccce5d26d99fe89c29b461";
const secretKey = "b9c100a09d553650dd8cbeaffc21d1";
const url = BASE_URL + method;
const now = Date.now();

const paramObject = {
  apikey: publicKey,
  nonce: now,
  market: "dash-btc",
  quantity: "1",
  rate: "1",
};
const query = querystring.stringify(objectSort(paramObject));
const apisign = crypto
  .createHmac("sha512", secretKey)
  .update(url + "?" + query)
  .digest("hex");

const options = {
  url: url + "?" + query,
  headers: {
    apisign: apisign,
  },
};

request(options, (error, response, body) => {
  if (error || response.statusCode != 200) {
    console.log(error, response.statusCode);
    return;
  }

  console.log(JSON.stringify(body));
});

function objectSort(object) {
  let newObject = Object.create(null);
  for (let key of Object.keys(object).sort()) {
    newObject[key] = object[key];
  }
  return newObject;
}

Make sure to replace publicKey, secretKey with your API keys. and please replace method, parameters with what you want.

BTX uses API keys to allow access to the private APIs. You can register a new BTX API key on our my-page/api page.

BTX expects for the apisign to be included in private API requests to the server in a header that looks like the following:

apisign: 0ba5264acef900423cb31f02a6f1a2933e64004fbeb2f0187135665a73e5afabdd4eef3d41dcf8b9ef929793b332b1e2e75401190411cfb4372bc3eabb6bb40b

Public

getmarkets

// please refer to skeleton codes in our authentication section.
const method = "/public/getmarkets";
const paramObject = {};
const options = {
    url: url
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "MarketCurrency": "BTC",
    "BaseCurrency": "DASH",
    "MarketCurrencyLong": "Bitcoin",
    "BaseCurrencyLong": "Dash",
    "MinTradeSize": 0.001,
    "MarketName": "DASH-BTC",
    "IsActive": true,
    "Created": null
  }, {
    "MarketCurrency": "BTC",
    "BaseCurrency": "BAT",
    "MarketCurrencyLong": "Bitcoin",
    "BaseCurrencyLong": "Basic Attention Token",
    "MinTradeSize": 0.001,
    "MarketName": "BAT-BTC",
    "IsActive": true,
    "Created": null
  }]
}

This endpoint retrieves information of markets.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getmarkets

getcurrencies

// please refer to skeleton codes in our authentication section.
const method = "/public/getcurrencies";
const paramObject = {};
const options = {
    url: url
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "Id": 1001,
    "Currency": "BTC",
    "CurrencyLong": "Bitcoin",
    "MinConfirmation": 6,
    "TxFee": 0.001,
    "IsActive": true,
    "CoinType": null,
    "BaseAddress": null ,
    "DepositEnabled": true,
    "WithdrawalEnabled": true 
  }, {
    "Id": 1012,
    "Currency": "ESN",
    "CurrencyLong": "Ethersocial",
    "MinConfirmation": 30,
    "TxFee": 0,
    "IsActive": true,
    "CoinType": null,
    "BaseAddress": null,
    "DepositEnabled": true,
    "WithdrawalEnabled": true 
  }]
}

This endpoint retrieves information of currencies.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getcurrencies

getticker

// please refer to skeleton codes in our authentication section.
const method = "/public/getticker";
const paramObject = {market: 'btc-eth'};
const options = {
    url: url + "?" + query
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "Bid": null,
    "Ask": 0.2,
    "Last" : 0.2
  }
}

This endpoint retrieves ticker information of the market.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getticker

URL Parameters

Parameter Description
market The market currency pair to get ticker information (ex : eth-btc)

getmarketsummaries

// please refer to skeleton codes in our authentication section.
const method = "/public/getmarketsummaries";
const paramObject = {};
const options = {
    url: url
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "MarketName": "BAT-ETH",
    "High": 0.0000052,
    "Low": 0.0000048,
    "Volume": 300.15877811,
    "Last": 0.0000051,
    "BaseVolume": 0.511223547,
    "TimeStamp" : "2018-12-20T2:30:51.47",
    "Bid" : 0.0000051,
    "Ask" : 0.00000512,
    "OpenBuyOrders" : 7,
    "OpenSellOrders" : 8,
    "PrevDay" : 0.000005,
    "Created" : "2018-11-21T8:52:00.00"
  }, {
    "MarketName": "BTC-ETH",
    "High": 0.0000054,
    "Low": 0.0000049,
    "Volume": 5778.12215788,
    "Last": 0.000005,
    "BaseVolume": 0.4,
    "TimeStamp" : "2018-12-20T2:30:51.47",
    "Bid" : 0.000005,
    "Ask" : 0.00000492,
    "OpenBuyOrders" : 20,
    "OpenSellOrders" : 55,
    "PrevDay" : 0.000004,
    "Created" : "2018-11-21T8:52:00.00"
  }]
}

This endpoint retrieves summaries of markets.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getmarketsummaries

getmarketsummary

// please refer to skeleton codes in our authentication section.
const method = "/public/getmarketsummary";
const paramObject = {market: 'btc-eth'};
const options = {
    url: url + "?" + query
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "MarketName": "BTC-ETH",
    "High": 0.0000054,
    "Low": 0.0000049,
    "Volume": 5778.12215788,
    "Last": 0.000005,
    "BaseVolume": 0.4,
    "TimeStamp" : "2018-12-20T2:30:51.47",
    "Bid" : 0.000005,
    "Ask" : 0.00000492,
    "OpenBuyOrders" : 20,
    "OpenSellOrders" : 55,
    "PrevDay" : 0.000004,
    "Created" : "2018-11-21T8:52:00.00"
  }]
}

This endpoint retrieves a summary of the market.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getmarketsummary

URL Parameters

Parameter Description
market The market currency pair to get a summary (ex : eth-btc)

getorderbook

// please refer to skeleton codes in our authentication section.
const method = "/public/getorderbook";
const paramObject = {market: 'btc-eth', type: 'both'};
const options = {
    url: url + "?" + query
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "buy": [{
        "Quantity": 29, 
        "Rate": 0.5
    }],
    "sell" : [{
        "Quantity": 3, 
        "Rate": 2
      }, {
        "Quantity": 1.5, 
        "Rate": 1
    }]
  }
}

This endpoint retrieves an order book of the market.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getorderbook

URL Parameters

Parameter Description
market The market currency pair to get an order book (ex : eth-btc)
type The type of orders to get an order book (buy, sell, both)

getmarkethistory

// please refer to skeleton codes in our authentication section.
const method = "/public/getmarkethistory";
const paramObject = {market: 'btc-eth'};
const options = {
    url: url + "?" + query
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "Id": null,
    "TimeStamp": "2018-12-20T2:30:51.47",
    "Quantity": 60.18415689,
    "Price": 0.00001,
    "Total": 0.00060184,
    "FillType": null,
    "OrderType" : "BUY"
  }, {
    "Id": null,
    "TimeStamp": "2018-12-20T2:30:51.47",
    "Quantity": 21.18785511,
    "Price": 0.122,
    "Total": 2.58491832,
    "FillType": null,
    "OrderType" : "SELL"
  }]
}

This endpoint retrieves an order history of the market.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getmarkethistory

URL Parameters

Parameter Description
market The market to get an order history (ex : eth-btc)

getservertime

// please refer to skeleton codes in our authentication section.
const method = "/public/getservertime";
const paramObject = {};
const options = {
    url: url
}

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "Time": "2020-06-25T21:17:51.47"
  }
}

This endpoint retrieves an server time.

HTTP Request

GET https://api.btxpro.com/v1.1/public/getservertime

Market

buylimit

// please refer to skeleton codes in our authentication section.
const method = "/market/buylimit";
const paramObject = {apikey: publicKey, nonce: now, market: 'btc-eth', quantity: '3', rate: '1'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "uuid": 5214
  }
}

This endpoint places an order to buy.

HTTP Request

GET https://api.btxpro.com/v1.1/market/buylimit

Header Settings

Key Description
apisign The api sign of the user to place an order to buy

URL Parameters

Parameter Description
nonce The nonce to place an order to buy (optional)
apikey The api key of the user to place an order to buy
market The market pair of coins to trade with each other (ex : eth-btc)
quantity The market to place an order to buy
rate The market to place an order to buy
walletid The wallet id to place an order to buy (optional - ex : 21)
magic Used to uniquely identify this order (optional - default : 0, max : 65534)

selllimit

// please refer to skeleton codes in our authentication section.
const method = "/market/selllimit";
const paramObject = {apikey: publicKey, nonce: now, market: 'btc-eth', quantity: '3', rate: '1'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "uuid": 1477
  }
}

This endpoint places an order to sell.

HTTP Request

GET https://api.btxpro.com/v1.1/market/selllimit

Header Settings

Key Description
apisign The api sign of the user to place an order to sell

URL Parameters

Parameter Description
nonce The nonce to place an order to sell (optional)
apikey The api key of the user to place an order to sell
market The market to place an order to sell (ex : eth-btc)
quantity The market to place an order to sell
rate The market to place an order to sell
walletid The wallet id to place an order to sell (optional - ex : 21)
magic Used to uniquely identify this order (optional - default : 0, max : 65534)

cancel

// please refer to skeleton codes in our authentication section.
const method = "/market/cancel";
const paramObject = {apikey: publicKey, nonce: now, uuid: '157'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : null
}

This endpoint places an order to cancel.

HTTP Request

GET https://api.btxpro.com/v1.1/market/cancel

Header Settings

Key Description
apisign The api sign of the user to place an order to cancel

URL Parameters

Parameter Description
nonce The nonce to place an order to cancel (optional)
apikey The api key of the user to place an order to cancel
uuid The uuid of the order to place an order to cancel
walletid The wallet id to place an order to sell (optional - ex : 21)
magic Used to uniquely identify this order (optional - default : 0, max : 65534)

getopenorders

// please refer to skeleton codes in our authentication section.
const method = "/market/getopenorders";
const paramObject = {apikey: publicKey, nonce: now, market: 'btc-eth'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "Uuid": null,
    "OrderUuid": "523",
    "Exchange": "BTC-ETH",
    "OrderType": "LIMIT_SELL",
    "Quantity": 15,
    "QuantityRemaining": 5,
    "Limit": 1,
    "Magic": 0,
    "CommissionPaid": 0,
    "Price": 0,
    "PricePerUnit": null,
    "Opened": "2018-12-23T12:10:35.12",
    "Closed": null,
    "CancelInitiated": false,
    "ImmediateOrCancel": false,
    "IsConditional": false,
    "Condition": null,
    "ConditionTarget": null
  }, {
    "Uuid": null,
    "OrderUuid": "578",
    "Exchange": "ETH-BTC",
    "OrderType": "LIMIT_BUY",
    "Quantity": 25,
    "QuantityRemaining": 5,
    "Limit": 1,
    "Magic": 0,
    "CommissionPaid": 0,
    "Price": 0,
    "PricePerUnit": null,
    "Opened": "2018-12-23T12:10:35.12",
    "Closed": null,
    "CancelInitiated": false,
    "ImmediateOrCancel": false,
    "IsConditional": false,
    "Condition": null,
    "ConditionTarget": null
  }]
}

This endpoint retrieves open orders information of the market.

HTTP Request

GET https://api.btxpro.com/v1.1/market/getopenorders

Header Settings

Key Description
apisign The api sign of the user to get open orders information

URL Parameters

Parameter Description
nonce The nonce to get open orders information (optional)
apikey The api key of the user to get open orders information
market The market to get open orders information (optional - ex : eth-btc)
walletid The wallet id to get open orders infromation (optional - ex : 21)

Account

getbalances

// please refer to skeleton codes in our authentication section.
const method = "/account/getbalances";
const paramObject = {apikey: publicKey, nonce: now};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "Currency": "BTC",
    "Balance": 1061.499124105,
    "Available": 1059.270898105,
    "Pending": 2.228226,
    "CryptoAddress": "9Reb9uFHVhiAyHLF2XpWX1S3Y9UN5Gsc8N",
    "Requested": false,
    "Uuid": null
  }, {
    "Currency": "ETH",
    "Balance": 104845.910165684,
    "Available": 104840.905165684,
    "Pending": 5.005,
    "CryptoAddress": "MRWo92GtfAxVyJogQVf24mNKpdvmWfrGBJ",
    "Requested": false,
    "Uuid": null
  }]
}

This endpoint retrieves balances information.

HTTP Request

GET https://api.btxpro.com/v1.1/account/getbalances

Header Settings

Key Description
apisign The api sign of the user to get balances information

URL Parameters

Parameter Description
nonce The nonce to get balances information (optional)
apikey The api key of the user to get balances information
walletid The wallet id to get balances information (optional - default : the first trade wallet)

getbalance

// please refer to skeleton codes in our authentication section.
const method = "/account/getbalance";
const paramObject = {apikey: publicKey, nonce: now, currency: 'btc'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "Currency": "BTC",
    "Balance": 1061.499124105,
    "Available": 1059.270898105,
    "Pending": 2.228226,
    "CryptoAddress": "36FzdbtJB2WJyxFr1VKeTMtc4ncea9SfU4",
    "Requested": false,
    "Uuid": null
  }
}

This endpoint retrieves balance information of the wallet.

HTTP Request

GET https://api.btxpro.com/v1.1/account/getbalance

Header Settings

Key Description
apisign The api sign of the user to get balance information

URL Parameters

Parameter Description
nonce The nonce to get balance information (optional)
apikey The api key of the user to get balance information
walletid The wallet id to get balance information (optional - default : the first trade wallet)
currency The currency to get balance information

getdepositaddress

// please refer to skeleton codes in our authentication section.
const method = "/account/getdepositaddress";
const paramObject = {apikey: publicKey, nonce: now, currency: 'btc'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "Currency": "BTC",
    "Address" : "3QR6Hr2pzRDCLgEqbFw4pJHJp5BVaDeYrL"
  }
}

This endpoint retrieves a deposit address.

HTTP Request

GET https://api.btxpro.com/v1.1/account/getdepositaddress

Header Settings

Key Description
apisign The api sign of the user to get a deposit address

URL Parameters

Parameter Description
nonce The nonce to get a deposit address (optional)
apikey The api key of the user to get a deposit address
walletid The wallet id to get a deposit address (optional - default : the first trade wallet)
currency The currency to get a deposit address

withdraw

// please refer to skeleton codes in our authentication section.
const method = "/account/withdraw";
const paramObject = {apikey: publicKey, nonce: now, currency: 'btc', 
      address: '32vuyKYN7wPzjPfWcjL7CZaq1XfV5TRmy5', quantity: '1', memo: 'hello'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "uuid": "1234455"
  }
}

This endpoint withdraw the amount of the currency.

HTTP Request

GET https://api.btxpro.com/v1.1/account/withdraw

Header Settings

Key Description
apisign The api sign of the user to withdraw

URL Parameters

Parameter Description
nonce The nonce to withdraw (optional)
apikey The api key of the user to withdraw
walletid The wallet id to withdraw (optional - default : the first trade wallet)
currency The currency to withdraw
address The address of the wallet to withdraw
quantity The amount of currencies to withdraw
memo A simple memo to specify the purpose of this withdraw (optional - maximum of 50 characters)
blockchainMemo A receiver address linked with blockchain memo (optional)

transferbetweenmywallets

const method = "/account/transferbetweenmywallets";
const paramObject = {apikey: publicKey, nonce: now, currency: 'btc', 
      senderwalletid: '21', receiverwalletid: '1', quantity: '1', memo1: 'hello', memo2: 'ok'};
{
  "success" : true,
  "message" : "",
  "result" : {
    "uuid": "1234455"
  }
}

This endpoint transfer currencies between your wallets.

HTTP Request

GET https://api.btxpro.com/v1.1/account/transferbetweenmywallets

Header Settings

Key Description
apisign The api sign of the user to transfer

URL Parameters

Parameter Description
nonce The nonce to transfer (optional)
apikey The api key of the user to transfer
senderwalletid The wallet id to send
receiverwalletid The wallet id to receive
currency The currency to transfer
quantity The amount of currencies to transfer
memo1 Memo to specify the purpose of this transfer (optional - maximum of 50 characters)
memo2 Memo to leave on the receiving wallet (optional - maximum of 50 characters)

gettransactionhistory

const method = "/account/gettransactionhistory";
const paramObject = {apikey: publicKey, nonce: now, currency: 'btc', 
      walletid: '21', count: '1'};
{
  "success" : true,
  "message" : "",
  "result" : [{
    "id": "3435922142",
    "Type": "Credit",
    "Subtype": "Deposit",
    "WalletId": 21,
    "Currency": "DASH",
    "Amount": 0.002,
    "Fee": 0.00001,
    "Memo": "Hello",
    "AvailableBalance": 151535.15,
    "BalanceInUse": 0,
    "JobId": 159,
    "Time": "2018-12-25T09:10:35.12"
  },  {
    "id": "3435922142",
    "Type": "Credit",
    "Subtype": "Deposit",
    "WalletId": 21,
    "Currency": "DASH",
    "Amount": 0.002,
    "Fee": 0.00001,
    "Memo": "Hello",
    "AvailableBalance": 151535.15,
    "BalanceInUse": 0,
    "JobId": 159,
    "Time": "2018-12-25T09:10:35.12"
  }]
}

This endpoint retrieves transaction history data of the given wallet.

HTTP Request

GET https://api.btxpro.com/v1.1/account/gettransactionhistory

Header Settings

Key Description
apisign The api sign of the user to get transaction history data

URL Parameters

Parameter Description
nonce The nonce to get transaction history (optional)
apikey The api key of the user to get transaction history
walletid The wallet id to get transaction history (optional - ex : 21)
currency The currency to get transaction history
count The specific amount of the transaction history data (optional - default : 100, max : 1000)

getorder

// please refer to skeleton codes in our authentication section.
const method = "/account/getorder";
const paramObject = {apikey: publicKey, nonce: now, uuid: '2457'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "AccountId": null,
    "Uuid": null,
    "OrderUuid": "2457",
    "Exchange": "BTC-ETH",
    "OrderType": "LIMIT_SELL",
    "Quantity": 1,
    "QuantityRemaining": 0,
    "Limit": 1,
    "Magic": 0,
    "Reserved": 1,
    "ReserveRemaining": 0,
    "CommissionReserved": 0,
    "CommissionReserveRemaining": 0,
    "CommissionPaid": 1,
    "Price": 1,
    "PricePerUnit": 1,
    "Opened": "2018-12-20T2:25:46.19",
    "Closed": "2018-12-20T4:14:28.98",
    "IsOpen": false,
    "Sentinel": null,
    "CancelInitiated": false,
    "ImmediateOrCancel": false,
    "IsConditional": false,
    "Condition": null,
    "ConditionTarget": null
  }
}

This endpoint retrieves information of the order.

HTTP Request

GET https://api.btxpro.com/v1.1/account/getorder

Header Settings

Key Description
apisign The api sign of the user to get information of the order

URL Parameters

Parameter Description
nonce The nonce to get information of the order (optional)
apikey The api key of the user to get information of the order
uuid The uuid of the order to get information of the order

getorderhistory

// please refer to skeleton codes in our authentication section.
const method = "/account/getorderhistory";
const paramObject = {apikey: publicKey, nonce: now, market: 'btc-eth'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "OrderUuid": "17",
    "Exchange": "BTC-ETH",
    "TimeStamp": "2018-12-23T12:10:35.12",
    "OrderType": "LIMIT_BUY",
    "Limit": 0.00000002,
    "Magic": 0,
    "Quantity": 2,
    "QuantityRemaining": 2000,
    "Commission": 0,
    "Price": 2,
    "PricePerUnit": 2,
    "IsConditional": false,
    "Condition": null,
    "ConditionTarget": null,
    "ImmediateOrCancel": false
  }, {
    "OrderUuid": "2457",
    "Exchange": "BTC-ETH",
    "TimeStamp": "2018-12-20T4:14:28.98",
    "OrderType": "LIMIT_SELL",
    "Limit": 1,
    "Magic": 0,
    "Quantity": 1,
    "QuantityRemaining": 0,
    "Commission": 0.001,
    "Price": 1,
    "PricePerUnit": 1,
    "IsConditional": false,
    "Condition": null,
    "ConditionTarget": null,
    "ImmediateOrCancel": false
  }]
}

This endpoint retrieves an order history of markets.

HTTP Request

GET https://api.btxpro.com/v1.1/account/getorderhistory

Header Settings

Key Description
apisign The api sign of the user to get an order history

URL Parameters

Parameter Description
nonce The nonce to get an order history (optional)
apikey The api key of the user to get an order history
market The market to get an order history (optional - ex : eth-btc)
walletid The wallet Id to get an order history (optional - ex : 21)
count The specific amount of the order history data (optional - default : 300, max : 1000)
startat The specific microtime to start reverse counting from (optional)

getwithdrawalhistory

// please refer to skeleton codes in our authentication section.
const method = "/account/getwithdrawalhistory";
const paramObject = {apikey: publicKey, nonce: now, currency: 'btc'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "PaymentUuid": "159",
    "Currency": "DASH",
    "Amount": 0.002,
    "Address": "9Hj3NDfdrhoNrBa9N1yr93WwrF4UwLhpFR",
    "Opened": "2018-11-26T1:25:17.82",
    "Authorized": true,
    "PendingPayment": false,
    "TxCost": 0,
    "TxId": "dea9c085e2574b41d804dd4e85c2d39206429ad6346bde05052775a538f32c0b",
    "Canceled": false,
    "InvalidAddress": false
  }, {
    "PaymentUuid": "3435921815",
    "Currency": "ETH",
    "Amount": 20,
    "Address": "0xf7723c7f5f4354bcdc7c3496749b4e51ff37d93f",
    "Opened": "2018-12-23T09:10:35.12",
    "Authorized": true,
    "PendingPayment": false,
    "TxCost": 0.2,
    "TxId": "0x938e96a86906de800c7d479eb7b33474b5975ac5b600f27b56d2a0254b84fa4c",
    "Canceled": false,
    "InvalidAddress": false
  }]
}

This endpoint retrieves a withdrawal history of the currency.

HTTP Request

GET https://api.btxpro.com/v1.1/account/getwithdrawalhistory

Header Settings

Key Description
apisign The api sign of the user to get a withdrawal history

URL Parameters

Parameter Description
nonce The nonce to get a withdrawal history (optional)
apikey The api key of the user to get a withdrawal history
currency The currency to get a withdrawal history (optional)
count The specific amount of the withdrawal history data (optional - default : 100, max : 1000)

getdeposithistory

// please refer to skeleton codes in our authentication section.
const method = "/account/getdeposithistory";
const paramObject = {apikey: publicKey, nonce: now, currency: 'btc'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : [{
    "PaymentUuid": "3435922142",
    "Currency": "DASH",
    "Amount": 0.002,
    "Address": "9Hj3NDfdrhoNrBa9N1yr93WwrF4UwLhpFR",
    "Opened": "2018-11-28T5:41:33.27",
    "Authorized": false,
    "PendingPayment": true,
    "TxCost": 0,
    "TxId": "dea9c085e2574b41d804dd4e85c2d39206429ad6346bde05052775a538f32c0b",
    "Canceled": false,
    "InvalidAddress": false
  },  {
    "PaymentUuid": "3883828",
    "Currency": "ETH",
    "Amount": 0.0012,
    "Address": "Xfc8DRahhdcbjunLWsdxmMUgdcg4C1nVrD",
    "Opened": "2018-12-25T09:10:35.12",
    "Authorized": true,
    "PendingPayment": false,
    "TxCost": 0.0000012,
    "TxId": "7dad1bb25a4756e9869d79ee32f0443e7d95571d9862266345915a5396fc1bca",
    "Canceled": false,
    "InvalidAddress": false
  }]
}

This endpoint retrieves a deposit history of the currency.

HTTP Request

GET https://api.btxpro.com/v1.1/account/getdeposithistory

Header Settings

Key Description
apisign The api sign of the user to get a deposit history

URL Parameters

Parameter Description
nonce The nonce to get a deposit history (optional)
apikey The api key of the user to get a deposit history
currency The currency to get a deposit history (optional)
count The specific amount of the deposit history data (optional - default : 100, max : 1000)

addwallet

// please refer to skeleton codes in our authentication section.
const method = "/account/addwallet";
const paramObject = {apikey: publicKey, nonce: now, type: '1', name: 'walletName'};

The above command returns JSON structured like this:

{
  "success" : true,
  "message" : "",
  "result" : {
    "walletid": 25
  }
}

This endpoint creates a wallet.

HTTP Request

GET https://api.btxpro.com/v1.1/account/addwallet

Header Settings

Key Description
apisign The api sign of the user to get a deposit history

URL Parameters

Parameter Description
nonce The nonce to get a deposit history (optional)
apikey The api key of the user to get a deposit history
type type. (0 - general, 1 - trade)
name wallet name

Errors

The BTX API uses the following error messages:

Error Message Meaning
NETWORK_ERROR Network Error.
DB_ERROR DB Error.
UNEXPECTED_ERROR Unexpected Error.
NO_DATA There is no data.
ACCOUNT_LOCKED The user account is locked.
WITHDRAWAL_NOT_AVAILABLE The withdrawal request for the currency is not available.
VERIFICATION_NEEDED_FOR_WITHDRAWAL You need higher verification level to make withdrawal requests.
EXCEEDED_WITHDRAWAL_LIMIT The withdrawal request is exceeded the one day withdrawal limit.
BELOW_MIN_WITHDRAWAL_LIMIT The withdrawal request is below the minimum withdrawal limit.
NOT_ENOUGH_BALANCE The wallet doesn't have enough currency. Check your available balance.
TOO_MANY_ORDERS You have too many open orders.
WRONG_KEY There is a no api key.
NO_PERMISSION The api key has no permission.
KEY_NOT_MATCHING The api key doesn't match with yours.
INVALID_MARKET The market name is wrong.
INVALID_TYPE The order type is wrong.
INVALID_NONCE The nonce is wrong.
INVALID_NUMBER The number is wrong.
INVALID_ORDER_ID The order id is wrong.
INVALID_CURRENCY The currency is wrong.
INVALID_ADDRESS The address is wrong.
INVALID_WALLETID The wallet id is wrong.
INVALID_QUANTITY_OR_RATE The quantity or the rate is wrong.
INVALID_RANGE_OF_TOTAL The total is over the range.
INVALID_UUID The uuid is wrong.
INVALID_SIGN The sign is wrong.
MARKET_NOT_PROVIDED The market name is missing.
TYPE_NOT_PROVIDED The order type is missing.
CURRENCY_NOT_PROVIDED The currency is missing.
QUANTITY_NOT_PROVIDED The quantity is missing.
UUID_NOT_PROVIDED The uuid is missing.
APIKEY_OR_APISIGN_NOT_PROVIDED The api key or the apisign is missing.