NAV Navbar

Txbit.io API

Txbit.io provides a powerful RESTful API, giving you programmatic access to Txbit's trading platform. We offer an easy to manage API Key authenthication method, and you can have multiple API keys, each with their own levels of different permisions.

Content type used for all requests is application/json and go over https.

All requests use GET method. The success flag will denote if your API call succeeded.

The base url is https://api.txbit.io

The endpoint format is as follows:
https://api.txbit.io/api/{method}?param=value

API Endpoint Reference

Txbit API is broken down into three groups, some of which are public and do not require any authentication, as well as private, and do need authentication for access.

Authentication

$apikey='xxx';
$apisecret='xxx'; 
$nonce=time(); 
$uri='https://api.txbit.io/api/market/getopenorders?apikey='.$apikey.'&nonce='.$nonce; 
$sign=hash_hmac('sha512',$uri,$apisecret); 
$ch = curl_init($uri); 
curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign)); 
$execResult = curl_exec($ch); 
$obj = json_decode($execResult);

To create and manage your API keys, go to Profile > Settings > API Keys

API Permissions:

For authentication, we use standard HMAC-SHA512 signing method. Append apikey and nonce to your request and calculate the HMAC hash, then include it under the apisign header.

Public API

/public/getmarkets

JSON Response Example

https://api.txbit.io/api/public/getmarkets

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "MarketCurrency":"XLR",
         "BaseCurrency":"BTC",
         "MarketCurrencyLong":"Solaris",
         "BaseCurrencyLong":"Bitcoin",
         "MinTradeSize":0.00005000,
         "MarketName":"XLR/BTC",
         "IsActive":true,
         "Created":"2018-12-06T12:53:31.16Z"
      },
      {  
         "MarketCurrency":"ETH",
         "BaseCurrency":"BTC",
         "MarketCurrencyLong":"Ethereum",
         "BaseCurrencyLong":"Bitcoin",
         "MinTradeSize":0.00005000,
         "MarketName":"ETH/BTC",
         "IsActive":true,
         "Created":"2018-12-06T12:53:31.16Z"
      }
   ]
}

Used to get the open and available trading markets at Txbit.io along with other meta data.

Request

https://api.txbit.io/api/public/getmarkets

Query Parameters

None

/public/getcurrencies

JSON Response Example

https://api.txbit.io/api/public/getcurrencies

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "Currency":"BTC",
         "CurrencyLong":"Bitcoin",
         "MinConfirmation":6,
         "CoinType":"BTC",
         "TxFee":0.00100000,
         "IsActive":true,
         "BaseAddress":""
      },
      {  
         "Currency":"XLR",
         "CurrencyLong":"Solaris",
         "MinConfirmation":2,
         "CoinType":"BTC",
         "TxFee":0.00000100,
         "IsActive":true,
         "BaseAddress":""
      },
   ]
}

Used to get all supported assets on Txbit.io along with other meta data.

Request

https://api.txbit.io/api/public/getcurrencies

Query Parameters

None

/public/getticker

JSON Response Example

https://api.txbit.io/api/public/getticker?market=XLR/BTC

{  
   "success":true,
   "message":"",
   "result":{  
      "Bid":0.00024856,
      "Ask":0.00024858,
      "Last":0.00024857
   }
}

Used to get current tick values for a market.

Request

https://api.txbit.io/api/public/getticker

Query Parameters

Parameter Required Description
market required a string literal for the market (ex: LTC/BTC)

/public/getmarketsummaries

JSON Response Example

https://api.txbit.io/api/public/getmarketsummaries

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "MarketName":"XLR/BTC",
         "High":0.00024857,
         "Low":0.00024857,
         "Volume":3.00000000,
         "Last":0.00024857,
         "BaseVolume":0.00074571,
         "TimeStamp":"2019-01-05T20:57:46.613Z",
         "Bid":0.00024856,
         "Ask":0.00024858,
         "OpenBuyOrders":216,
         "OpenSellOrders":259,
         "PrevDay":0.00024857,
         "Created":"2018-12-06T12:53:31.16Z",
         "DisplayMarketName":"Solaris - Bitcoin"
      },
      {  
         "MarketName":"ETH/BTC",
         "High":0.40000000,
         "Low":0.40000000,
         "Volume":0.00000000,
         "Last":0.40000000,
         "BaseVolume":0.00000000,
         "TimeStamp":"2018-12-12T11:39:09.713Z",
         "Bid":0.30000000,
         "Ask":0.80000000,
         "OpenBuyOrders":1,
         "OpenSellOrders":1,
         "PrevDay":0.40000000,
         "Created":"2018-12-06T12:53:31.16Z",
         "DisplayMarketName":"Ethereum - Bitcoin"
      },
   ]
}

Used to get the last 24 hour summary of all active markets.

Request

https://api.txbit.io/api/public/getmarketsummaries

Query Parameters

None

/public/getmarketsummary

JSON Response Example

https://api.txbit.io/api/public/getmarketsummary?market=XLR/BTC

{  
   "success":true,
   "message":"",
   "result":{  
      "MarketName":"XLR/BTC",
      "High":0.00024857,
      "Low":0.00024857,
      "Volume":3.00000000,
      "Last":0.00024857,
      "BaseVolume":0.00074571,
      "TimeStamp":"2019-01-05T20:57:46.613Z",
      "Bid":0.00024856,
      "Ask":0.00024858,
      "OpenBuyOrders":216,
      "OpenSellOrders":259,
      "PrevDay":0.00024857,
      "Created":"2018-12-06T12:53:31.16Z",
      "DisplayMarketName":"Solaris - Bitcoin"
   }
}

Used to get the last 24 hour summary of a specific market.

Request

https://api.txbit.io/api/public/getmarketsummary

Query Parameters

Parameter Required Description
market required a string literal for the market (ex: LTC/BTC)

/public/getorderbook

JSON Response Example

https://api.txbit.io/api/public/getorderbook?market=XLR/BTC&type=both

{
    "success" : true,
    "message" : "",
    "result" : {
        "buy" : [{
                "Quantity" : 51.37001234,
                "Rate" : 0.00522000
            }
        ],
        "sell" : [{
                "Quantity" : 32.87752402,
                "Rate" : 0.00540000
            }, {
                "Quantity" : 24.00780000,
                "Rate" : 0.00550000
            }, {
                "Quantity" : 53.00003500,
                "Rate" : 0.00600000
            }
        ]
    }
}

Used to get retrieve the orderbook for a given market.

Request

https://api.txbit.io/api/public/getorderbook

Query Parameters

Parameter Required Description
market required a string literal for the market (ex: LTC/BTC)
type required buy, sell or both to return specific type of orderbook

/public/getmarkethistory

JSON Response Example

https://api.txbit.io/api/public/getmarkethistory?market=XLR/BTC

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "Id":150586,
         "TimeStamp":"2019-01-05T20:57:46.613Z",
         "Quantity":3.00000000,
         "Price":0.00024857,
         "Total":0.00074571,
         "FillType":"FILL",
         "OrderType":"BUY"
      },
      {  
         "Id":150585,
         "TimeStamp":"2019-01-04T23:56:24.85Z",
         "Quantity":3.00000000,
         "Price":0.00024857,
         "Total":0.00074571,
         "FillType":"FILL",
         "OrderType":"BUY"
      },
      {  
         "Id":150584,
         "TimeStamp":"2019-01-04T23:56:05.233Z",
         "Quantity":3.00000000,
         "Price":0.00024856,
         "Total":0.00074568,
         "FillType":"PARTIAL_FILL",
         "OrderType":"SELL"
      },
      {  
         "Id":150583,
         "TimeStamp":"2019-01-04T21:02:01.27Z",
         "Quantity":3.00000000,
         "Price":0.00024856,
         "Total":0.00074568,
         "FillType":"FILL",
         "OrderType":"BUY"
      }
   ]
}

Used to retrieve the latest trades that have occured for a specific market.

Request

https://api.txbit.io/api/public/getmarkethistory

Query Parameters

Parameter Required Description
market required a string literal for the market (ex: LTC/BTC)

Market API

/market/buylimit

JSON Response Example

https://api.txbit.io/api/market/buylimit?apikey=API_KEY&market=XLR/BTC&quantity=10&rate=0.00034783

{
    "success" : true,
    "message" : "",
    "result" : {
            "uuid" : "212ct4a4-3d13-13e3-9ss5-342371b86ab6"
        }
}

Used to place a Buy Limit order in a specific market. Must meet a minimum order total of 0.0005. Must authenticate and have proper permissions set up on the API keys(ALLOW TRADING).

Request

https://api.txbit.io/api/market/buylimit

Query Parameters

Parameter Required Description
market required a string literal for the market (ex: LTC/BTC)
quantity required the amount to purchase (ex: LTC/BTC)
rate required the price at which the order will be placed (ex: LTC/BTC)

/market/selllimit

JSON Response Example

https://api.txbit.io/api/market/selllimit?apikey=API_KEY&market=XLR/BTC&quantity=10&rate=0.00034783

{
    "success" : true,
    "message" : "",
    "result" : {
            "uuid" : "212ct4a4-3d13-13e3-9ss5-342371b86ab6"
        }
}

Used to place a Sell Limit order in a specific market. Must meet a minimum order total of 0.0005. Must authenticate and have proper permissions set up on the API keys(ALLOW TRADING).

Request

https://api.txbit.io/api/market/selllimit

Query Parameters

Parameter Required Description
market required a string literal for the market (ex: LTC/BTC)
quantity required the amount to purchase (ex: LTC/BTC)
rate required the price at which the order will be placed (ex: LTC/BTC)

/market/cancel

JSON Response Example

https://api.txbit.io/api/market/cancel?apikey=API_KEY&uuid=ORDER_UUID

Returns you the order uuid

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

Used to cancel a buy or sell order. Must authenticate and have proper permissions set up on the API keys(ALLOW TRADING).

Request

https://api.txbit.io/api/market/cancel

Query Parameters

Parameter Required Description
uuid required uuid of buy or sell order

/market/getopenorders

JSON Response Example

https://api.txbit.io/api/market/getopenorders?apikey=API_KEY&market=XLR/BTC

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "OrderType":"LIMIT_BUY",
         "Uuid":null,
         "OrderUuid":"8a19789b-d2bc-4dae-9c49-95e8bb3c16a5",
         "Exchange":"XLR/BTC",
         "Quantity":2.00000000,
         "QuantityRemaining":2.00000000,
         "Limit":0.30000000,
         "CommissionPaid":0.00000000,
         "Price":0.00000000,
         "PricePerUnit":null,
         "Opened":"2018-10-15T11:39:13.603Z",
         "Closed":null,
         "CancelInitiated":false,
         "ImmediateOrCancel":false,
         "IsConditional":false,
         "Condition":null,
         "ConditionTarget":null
      },
      {  
         "OrderType":"LIMIT_SELL",
         "Uuid":null,
         "OrderUuid":"7aba324a-7b55-4015-bcfe-e79ebd47f1c9",
         "Exchange":"XLR/BTC",
         "Quantity":200.00000000,
         "QuantityRemaining":200.00000000,
         "Limit":0.80000000,
         "CommissionPaid":0.00000000,
         "Price":0.00000000,
         "PricePerUnit":null,
         "Opened":"2018-12-12T11:39:43.87Z",
         "Closed":null,
         "CancelInitiated":false,
         "ImmediateOrCancel":false,
         "IsConditional":false,
         "Condition":null,
         "ConditionTarget":null
      }
   ]
}

Get all orders that you currently have opened. A specific market can be requested. Must authenticate and have proper permissions set up on the API keys(ALLOW TRADING).

Request

https://api.txbit.io/api/market/getopenorders

Query Parameters

Parameter Required Description
market optional a string literal for the market (ex: LTC/BTC)

Account API

/account/getbalances

JSON Response Example

https://api.txbit.io/api/account/getbalances?apikey=API_KEY

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "Uuid":"090782ee-2191-47b9-841c-f20eff999860",
         "Currency":"BTC",
         "Balance":4.21365932,
         "Available":3.48274152,
         "Pending":0.73091780,
         "CryptoAddress":"3N8UvMn15KQeJFK5WvAuQjvEjbDRJmguUEo",
         "Requested":false
      },
      {  
         "Uuid":"ed6fd2f1-3003-4cf9-8d49-976cf3742a07",
         "Currency":"ETH",
         "Balance":92.04664999,
         "Available":92.04664999,
         "Pending":0.00000000,
         "CryptoAddress":"0x235cb9192f62509649Dc6a2cb57eeD696e59C6bf",
         "Requested":false
      }
   ]
}

Used to retrieve all balances from your account. Must authenticate and have proper permissions set up on the API keys(ALLOW READING).

Request

https://api.txbit.io/api/account/getbalances

Query Parameters

None

/account/getbalance

JSON Response Example

https://api.txbit.io/api/account/getbalance?apikey=API_KEY&currency=BTC

{  
   "success":true,
   "message":"",
   "result":{  
      "Uuid":"090782ee-2191-47b9-841c-f20eff999860",
      "Currency":"BTC",
      "Balance":4.21365932,
      "Available":3.48274152,
      "Pending":0.73091780,
      "CryptoAddress":"2N8UvMn15KQeJFK5WvAuQjvEjbDRJmguUEo",
      "Requested":false
   }
}

Used to retrieve the balance from your account for a specific asset. Must authenticate and have proper permissions set up on the API keys(ALLOW READING).

Request

https://api.txbit.io/api/account/getbalance

Query Parameters

Parameter Required Description
currency required a string literal for the market (ex: BTC)

/account/getdepositaddress

JSON Response Example

https://api.txbit.io/api/account/getdepositaddress?apikey=API_KEY&currency=BTC

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

Used to retrieve or generate an address for a specific currency. If one does not exist, the call will fail and return ADDRESS_GENERATING until one is available. Must authenticate and have proper permissions set up on the API keys(ALLOW READING).

Request

https://api.txbit.io/api/account/getdepositaddress

Query Parameters

Parameter Required Description
currency required a string literal for the market (ex: BTC)

/account/withdraw

JSON Response Example

https://api.txbit.io/api/account/withdraw?apikey=API_KEY&currency=BTC&quantity=3.19752&address=BTC_ADDRESS

{  
   "success":true,
   "message":"",
   "result":{  
      "uuid":"0476b3c7-9bc1-49ca-ae35-cadef6861f84"
   }
}

Used to withdraw funds from your account. Note: please account for txfee. Must authenticate and have proper permissions set up on the API keys(ALLOW WITHDRAWAL).

Request

https://api.txbit.io/api/account/withdraw

Query Parameters

Parameter Required Description
currency required a string literal for the market (ex: BTC)
quantity required amount to withdraw
address required asset will be sent to this address
paymentid optional used for CryptoNotes/BitShareX/Nxt/XRP and any other coin that has a memo/message/tag/paymentid option

/account/getorder

JSON Response Example

https://api.txbit.io/api/account/getorder&uuid=0476b3c7-9bc1-49ca-ae35-cadef6861f84

{  
   "success":true,
   "message":"",
   "result":{  
      "Type":"LIMIT_BUY",
      "AccountId":null,
      "CommissionReserved":0.00000000,
      "CommissionReserveRemaining":0.00000000,
      "Sentinel":null,
      "IsOpen":false,
      "OrderUuid":"0476b3c7-9bc1-49ca-ae35-cadef6861f84",
      "Exchange":"XLR/BTC",
      "Quantity":1.00000000,
      "QuantityRemaining":0.99000000,
      "Limit":0.40000000,
      "CommissionPaid":0.00000000,
      "Price":0.00000000,
      "PricePerUnit":null,
      "Opened":"2018-10-15T11:38:45.947Z",
      "Closed":null,
      "CancelInitiated":true,
      "ImmediateOrCancel":false,
      "IsConditional":false,
      "Condition":null,
      "ConditionTarget":null
   }
}

Used to retrieve a single order by uuid. Must authenticate and have proper permissions set up on the API keys(ALLOW READING).

Request

https://api.txbit.io/api/account/getorder

Query Parameters

Parameter Required Description
uuid required the uuid of the buy or sell order

/account/getorderhistory

JSON Response Example

https://api.txbit.io/api/account/getorderhistory

{
    "success" : true,
    "message" : "",
    "result" : [{
            "OrderUuid" : "0476b3c7-9bc1-49ca-ae35-cadef6861f84",
            "Exchange" : "XLR/BTC",
            "TimeStamp" : "2018-10-15T11:38:45.947Z",
            "OrderType" : "LIMIT_BUY",
            "Limit" : 0.00000001,
            "Quantity" : 100000.00000000,
            "QuantityRemaining" : 100000.00000000,
            "Commission" : 0.00000000,
            "Price" : 0.00000000,
            "PricePerUnit" : null,
            "IsConditional" : false,
            "Condition" : null,
            "ConditionTarget" : null,
            "ImmediateOrCancel" : false
        }, {
            "OrderUuid" : "0476b3c7-9bc1-49ca-ae35-cadef6861f84",
            "Exchange" : "ETH/BTC",
            "TimeStamp" : "2018-10-15T11:38:45.947Z",
            "OrderType" : "LIMIT_SELL",
            "Limit" : 0.00002950,
            "Quantity" : 667.03644955,
            "QuantityRemaining" : 0.00000000,
            "Commission" : 0.00004921,
            "Price" : 0.01968424,
            "PricePerUnit" : 0.00002950,
            "IsConditional" : false,
            "Condition" : null,
            "ConditionTarget" : null,
            "ImmediateOrCancel" : false
        }
    ]
}

Used to retrieve your order history. Must authenticate and have proper permissions set up on the API keys(ALLOW READING).

Request

https://api.txbit.io/api/account/getorderhistory

Query Parameters

Parameter Required Description
market optional a string literal for the market (ie. BTC-LTC). If omitted, will return for all markets.

/account/getwithdrawalhistory

JSON Response Example

https://api.txbit.io/api/account/getwithdrawalhistory?currency=XLR

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "PaymentUuid":"004bad1c-4812-49f3-8033-406573d0b635",
         "Currency":"XLR",
         "Amount":1.00000100,
         "Address":"SeqiWTaoJx2wh8cCCHWdcVN7VuDJfV1vri",
         "Opened":"2018-09-07T07:46:20.903Z",
         "Authorized":false,
         "PendingPayment":false,
         "TxCost":0.00000100,
         "TxId":null,
         "Canceled":true,
         "InvalidAddress":false
      },
      {  
         "PaymentUuid":"2582709a-7fc5-482a-8714-3aafd5030cc9",
         "Currency":"XLR",
         "Amount":5.00000000,
         "Address":"ABtvkdKvyzJGmpqXPmjcaEbnKQBevTwXh8",
         "Opened":"2018-10-22T11:30:33.283Z",
         "Authorized":true,
         "PendingPayment":true,
         "TxCost":0.00000100,
         "TxId":null,
         "Canceled":false,
         "InvalidAddress":false
      }
   ]
}

Used to retrieve your withdrawal history. Must authenticate and have proper permissions set up on the API keys(ALLOW READING).

Request

https://api.txbit.io/api/account/getwithdrawalhistory

Query Parameters

Parameter Required Description
currency optional a string literal for the asset (ie. BTC). If omitted, will return for all assets.

/account/getdeposithistory

JSON Response Example

https://api.txbit.io/api/account/getdeposithistory?currency=XLR

{  
   "success":true,
   "message":"",
   "result":[  
      {  
         "PaymentUuid":"01f125c9-ae8e-4b66-8788-b2c5fa09a2a6",
         "Currency":"XLR",
         "Amount":0.01000000,
         "Address":"SY7bo3jiyaptre1fsdgvq3QbcwDfUmeeWd",
         "Opened":"2018-12-27T13:25:55.88Z",
         "Authorized":true,
         "PendingPayment":false,
         "TxCost":0.00000000,
         "TxId":"be15b6ffffb4ad7a1a18519a8bc4138502f018194863b7028a10b6e75a6500af",
         "Canceled":false,
         "InvalidAddress":false
      },
      {  
         "PaymentUuid":"be09b806-756c-4817-9cc9-58351bc57bf9",
         "Currency":"XLR",
         "Amount":60.00000000,
         "Address":"9t8cqMJWc9UYEf3HJRT2UAfTMtXhxE1gMi",
         "Opened":"2018-11-19T18:00:27.643Z",
         "Authorized":true,
         "PendingPayment":false,
         "TxCost":0.00000000,
         "TxId":"2b5a5e1991e12b2f6d193bfc84c0546fca677e7685da2ddb26aee89a33263bd9",
         "Canceled":false,
         "InvalidAddress":false
      }
   ]
}

Used to retrieve your deposit history. Must authenticate and have proper permissions set up on the API keys(ALLOW READING).

Request

https://api.txbit.io/api/account/getorderhistory

Query Parameters

Parameter Required Description
currency optional a string literal for the asset (ie. BTC). If omitted, will return for all assets.