The Taurus API allows you to integrate the Taurus trading platform with third party applications, such as trading applications, charting programs, point of sale systems, and much more. Below you will find details on how the system functions, along with examples in common programming languages.
The Taurus API is fully compatible with the Bitstamp Exchange API.
Major denotes any of the Cryptocurrencies such as Bitcoin (BTC) or any other cryptocurrency which is added to the Taurus trading platform in the future.
Minor denotes fiat currencies such as Canadian Dollar (CAD), etc.
An order book is always referred to in the API as "Major_Minor". For example: "btc_cad"
GET https://api.taurusexchange.com/ticker
The above url will return trading information from the specified book. Currently, the book will default to the only one available: btc_cad
Returns JSON dictionary:
GET https://api.taurusexchange.com/order_book
List of all open orders
Params:
Returns JSON dictionary with "bids" and "asks". Each is a list of open orders and each order is represented as a list of price and amount.
GET https://api.taurusexchange.com/transactions
List of recent trades
Params:
Returns descending JSON list of transactions. Every transaction (dictionary) contains:
To setup an API within your account, go to Settings & Security and scroll down to "API Setup".
When setting up a new API, you will need to choose an API Name to identify your API. This name will never be shown anywhere apart from on your API Index page within your account. In addition to the name, an API Secret must be chosen. The field is pre-populated with a random number of characters, but can be changed at your discretion. Finally, you have the option of adding a Withdrawal Bitcoin Address, which can be used to lock the API Withdrawal function to a specific Bitcoin address of your choosing. This field is optional.
Make a note of these 2 fields as they are needed to authenticate you on the server when making requests to the private APIs. To generate a new API Secret, click on the icon next to the current secret. Note that this will instantly change the key, and cannot be undone.
You need to POST 3 fields as a JSON payload to the API in order to perform authentication.
The signature has to be created using a concatenation of the nonce, the API key, your client id and using the API Secret as key. The pseudo-algorithm is shown below and you will find code examples in the Appendix.
HMAC_SHA256 ( nonce + key + client , secret )
Using the API shown in Figure 2, the JSON payload will be:
{ key: "JJHlXeDcFM", nonce: 1391683499, signature: "cdbf5cc64c70e1485fcf976cdf367960c2b28cfc28080973ce677cebb6db9681" }
The signature being calculated using:
HMAC_SHA256 ( 1391683499 + 3 + JJHlXeDcFM , 230664ae53cbe5a07c6c389910540729)
HMAC_SHA256 ( 13916834993JJHlXeDcFM , 230664ae53cbe5a07c6c389910540729 )
= cdbf5cc64c70e1485fcf976cdf367960c2b28cfc28080973ce677cebb6db9681
POST https://api.taurusexchange.com/balance
Returns JSON dictionary of all balances, e.g.:
POST https://api.taurusexchange.com/user_transactions
Returns descending JSON list of transactions. Every transaction (dictionary) contains:
POST https://api.taurusexchange.com/open_orders
Returns JSON list of open orders. Each order is represented as dictionary:
POST https://api.taurusexchange.com/lookup_order
Returns JSON list of details about 1 or more orders. Each order is represented as dictionary:
POST https://api.taurusexchange.com/cancel_order
Returns 'true' if order has been found and canceled.
POST https://api.taurusexchange.com/buy
Returns JSON dictionary representing order:
POST https://api.taurusexchange.com/buy
Returns JSON dictionary representing market order:
POST https://api.taurusexchange.com/sell
Returns JSON dictionary representing order:
POST https://api.taurusexchange.com/sell
Returns JSON dictionary representing market order:
POST https://api.taurusexchange.com/bitcoin_deposit_address
Returns a bitcoin deposit address for funding your account.
POST https://api.taurusexchange.com/bitcoin_withdrawal
OK or error
Ruby wrapper for Taurus: https://github.com/yerofeyev/taurusruby.
Java integration for Taurus (xChange): https://github.com/timmolter/XChange.
You must be familiar with PHP - https://php.net - and the CURL extension - https://php.net/curl
$ch = curl_init('http://api.taurusexchange.com/ticker'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); $result = curl_exec($ch);
{ "high":"8650.00", "last":"8500.00", "timestamp":"1410341807", "bid":"8310.00", "vwap":"8414.15", "volume":"107.05882350", "low":"8480.00", "ask":"8500.00" }
$nonce = time(); // Unix timestamp $key = 'JJHlXeDcFM'; // My API Key $client = 3; // My Client ID $secret = '230664ae53cbe5a07c6c389910540729'; // my secret $signature = hash_hmac('sha256', $nonce . $key . $client, $secret); // Hashing it $data = array( 'key' => $key, 'nonce' => $nonce, 'signature' => $signature ); $data_string = json_encode($data); $ch = curl_init('https://api.taurusexchange.com/open_orders'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json; charset=utf-8', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch);
$nonce = time(); // Unix timestamp $key = 'JJHlXeDcFM'; // My API Key $client = 3; // My Client ID $secret = '230664ae53cbe5a07c6c389910540729'; // my secret $signature = hash_hmac('sha256', $nonce . $key . $client, $secret); // Hashing it $data = array( 'key' => $key, 'nonce' => $nonce, 'signature' => $signature, 'amount' => 2.34, 'price' => 8469 ); $data_string = json_encode($data); $ch = curl_init('https://api.taurusexchange.com/buy'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json; charset=utf-8', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch);