Integration – Client

With this method, the TAAPI.IO Client does the heavy lifting of fetching candle data from the exchanges, and passing it on to the API. This means that it’s the client talking directly to the exchanges, and therefore, you need to watch your usage and stay under the exchange’s rate-limits. For more information on an exchange’s rate-limits, you need to find their technical documentation on their home page.

Pros

  • Calculate TA for any crypto asset, for any  market / symbol / time frame on 124 different crypto exchanges.
  • Candles are pulled instantly from the exchanges, making TA indicator calculations real time.
  • Use this client as a wrapper, if you use NodeJS.

Cons

  • You need to watch the rate-limits for the exchange yourself.
  • One extra step if you’re not using NodeJS (More info below).

Why do it like this?

It’s a tall order to fetch all symbols on all time frames for all the exchanges, and guarantee that this is reliable, and always up-to-date. However, we are working on exactly this, and this service is available for the crypto exchange “Binance”, via the Direct Integration Method.

Getting Started

Our client is NodeJS based (check the NPM Package on npmjs.com), and that can be used either as a wrapper or as a server. Below are some guides based on programming language and operation systems:

NodeJS

If you’re working with NodeJS, then things are very simple, as you already have NodeJS installed on your platform. Simply install our NPM Package (taapi), and you’re good to go:

Make sure you have your project setup, otherwise, create a new one:

  • Create a new folder: mkdir myCryptoProject
  • Enter that folder: cd myCryptoProject
  • Init a new project: npm init
  • Install TAAPI.IO npm package: npm i taapi
  • Create your entry file: touch index.js
  • Start up your favorite IDE, and paste the below into index.js
// Require taapi: npm i taapi --save
const taapi = require("taapi");
 
// Setup client with authentication
const client = taapi.client("MY_SECRET");
 
// Get the BTC/USDT RSI value on the 1 minute time frame from binance
client.getIndicator("rsi", "binance", "BTC/USDT", "1m").then(function(result) {
    console.log("Result: ", result);
})
.catch(function(error){
    console.log(error.message);
});

See more info / examples at the NPM Package

Be sure to check out the below required and optional parameters!

Other programming languages

To get started with anything but NodeJS, you need to install the taapi npm package and run it as a server. Don’t be scared if this is already getting too geeky. It really is fairly simple. Follow these steps (unix commands used):

  • Visit NodeJS’s download page, download and install.
  • Once installed, create a folder for the taapi local server: mkdir taapiServer and cd to this directory: cd taapiServer .
  • Init a new NPM project: npm init (and follow the init steps)
  • Install taapi: npm install taapi
  • Create an empty index.js file: touch index.js
  • Boot up your favorite editor and paste the below into the index.js file:
// Require taapi
const taapi = require("taapi");
 
// Setup client with authentication
const server = taapi.server("MY_SECRET");
 
// Define port - Optional and defaults to 4101
// server.setServerPort(3000);
 
// Start the server
server.start();

Your terminal should now display something like:

TAAPI.IO Local API Running on localhost:4101!

You’re now up and running and can use this server with your favorite programming language.

Hint: Use PM2 (Process Manager for NodeJS). It makes it easy to run the server as a background process.

  • npm install pm2 -g // Install pm2 globally
  • pm2 start index.js –name ‘taapi-server’ // Start the taapi server in the background
  • pm2 status // Check the status
  • pm2 log taapi-server // Check the log
  • pm2 –help

PHP

// Define query
$query = http_build_query(array(
  'indicator' => 'rsi',
  'exchange' => 'binance',
  'symbol' => 'BTC/USDT',
  'interval' => '1h'
));
 
// Define endpoint. Change the port if you changed it when setting up the server
$url = "http://localhost:4101/indicator?{$query}";
 
// create curl resource 
$ch = curl_init(); 
 
// set url 
curl_setopt($ch, CURLOPT_URL, $url); 
 
//return the transfer as a string 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
 
// $output contains the output string 
$output = curl_exec($ch); 
 
// close curl resource to free up system resources 
curl_close($ch);
 
// View result
print_r(json_decode($output));

Python

# Import the requests library 
import requests 
  
# Define endpoint 
endpoint = 'http://localhost:4101/indicator'
  
# Define a parameters dict for the parameters to be sent to the API 
parameters = {
    'indicator': 'rsi',
    'exchange': 'binance',
    'symbol': 'BTC/USDT',
    'interval': '1h'
    } 
  
# Send get request and save the response as response object 
response = requests.get(url = endpoint, params = parameters)
  
# Extract data in json format 
result = response.json() 

# Print result
print(result)

Mandatory Parameters

Using this “Client” method requires at least the below parameters:

ParameterTypeDescription
indicatorStringThe desired Indicator to calculate TA of.
exchangeStringThe exchange you want to calculate TA from: [binance, kucoin, …]
symbolStringSymbol names are always upper-case, with the coin separated by a forward slash and the market: COIN/MARKET. Example: ‘BTC/USDT’ Bitcoin to Tether, or LTC/BTC Litecoin to Bitcoin.
intervalStringInterval or time frame: Binance have the following time frames or intervals: [“1m”, “3m”, “5m”, “15m”, “30m”, “1h”, “2h”, “4h”, “6h”, “8h”, “12h”, “1d”, “3d”, “1w”, “1M”].

Depending on the indicator you call, there may or may not be more mandatory parameters. Additionally, there may be several other optional paramters, also depending on the indicator. Please refer to the Indicators page for more information.

Optional Parameters

Below is a list of optional parameters that all the indicators will take:

ParameterType
backtrackIntegerThis ‘backtrack’ parameter, removes candles from the data set, and thus calculates the indicator value, x amount of candles back. So, if you’re fetching the RSI on the hourly, and you want to know what the RSI was 5 hours ago, set backtrack=5. Default here is 0, and a max of 50.

Note on exchanges and limits

The different exchanges have different limits as to how many candles one can fetch in one go. Therefore, a default of 100 is set here. We’re updating our documentation to reflect each exchange’s individual limits. But for now, it’s best to double check that the amount of candles that you expect are returned (use the /candles endpoint), and check that the last one has the expected timestamp. Candles are always returned with the oldest first and newest last.

You can override how many candles the client should attempt to fetch. See more info / examples at the NPM Package

Supported Exchanges

Supported Exchanges

The ccxt library currently supports the following 124 cryptocurrency exchange markets and trading APIs:

       logo        id name ver doc certified
_1btcxe _1btcxe 1BTCXE * API
acx acx ACX 2 API
adara adara Adara 1 API
allcoin allcoin Allcoin 1 API
anxpro anxpro ANXPro * API
bcex bcex BCEX 1 API
bequant bequant Bequant 2 API
bibox bibox Bibox 1 API
bigone bigone BigONE 3 API
binance binance Binance * API CCXT Certified
binanceje binanceje Binance Jersey * API
binanceus binanceus Binance US * API
bit2c bit2c Bit2C * API
bitbank bitbank bitbank 1 API
bitbay bitbay BitBay * API
bitfinex bitfinex Bitfinex 1 API CCXT Certified
bitfinex2 bitfinex2 Bitfinex 2 API
bitflyer bitflyer bitFlyer 1 API
bitforex bitforex Bitforex 1 API
bithumb bithumb Bithumb * API
bitkk bitkk bitkk 1 API
bitlish bitlish Bitlish 1 API
bitmart bitmart BitMart 2 API
bitmax bitmax BitMax 1 API
bitmex bitmex BitMEX 1 API
bitso bitso Bitso 3 API
bitstamp bitstamp Bitstamp 2 API
bitstamp1 bitstamp1 Bitstamp 1 API
bittrex bittrex Bittrex 1.1 API CCXT Certified
bitz bitz Bit-Z 2 API
bl3p bl3p BL3P 1 API
bleutrade bleutrade Bleutrade 2 API
braziliex braziliex Braziliex * API
btcalpha btcalpha BTC-Alpha 1 API
btcbox btcbox BtcBox 1 API
btcchina btcchina BTCChina 1 API
btcmarkets btcmarkets BTC Markets * API
btctradeim btctradeim BtcTrade.im * API
btctradeua btctradeua BTC Trade UA * API
btcturk btcturk BTCTurk * API
buda buda Buda 2 API
bw bw BW 1 API
bytetrade bytetrade ByteTrade * API CCXT Certified
cex cex CEX.IO * API
chilebit chilebit ChileBit 1 API
cobinhood cobinhood COBINHOOD 1 API
coinbase coinbase Coinbase 2 API
coinbaseprime coinbaseprime Coinbase Prime * API
coinbasepro coinbasepro Coinbase Pro * API
coincheck coincheck coincheck * API
coinegg coinegg CoinEgg * API
coinex coinex CoinEx 1 API
coinfalcon coinfalcon CoinFalcon 1 API
coinfloor coinfloor coinfloor * API
coingi coingi Coingi * API
coinmarketcap coinmarketcap CoinMarketCap 1 API
coinmate coinmate CoinMate * API
coinone coinone CoinOne 2 API
coinspot coinspot CoinSpot * API
coolcoin coolcoin CoolCoin * API
coss coss COSS 1 API CCXT Certified
crex24 crex24 CREX24 2 API
deribit deribit Deribit 1 API
digifinex digifinex DigiFinex 3 API
dsx dsx DSX 3 API
exmo exmo EXMO 1 API
exx exx EXX * API
fcoin fcoin FCoin 2 API
fcoinjp fcoinjp FCoinJP 2 API
flowbtc flowbtc flowBTC 1 API
foxbit foxbit FoxBit 1 API
ftx ftx FTX * API CCXT Certified
fybse fybse FYB-SE * API
gateio gateio Gate.io 2 API
gemini gemini Gemini 1 API
hitbtc hitbtc HitBTC 1 API
hitbtc2 hitbtc2 HitBTC 2 API
huobipro huobipro Huobi Pro 1 API
huobiru huobiru Huobi Russia 1 API
ice3x ice3x ICE3X 1 API
idex idex IDEX * API CCXT Certified
independentreserve independentreserve Independent Reserve * API
indodax indodax INDODAX 1.8 API
itbit itbit itBit 1 API
kkex kkex KKEX 2 API
kraken kraken Kraken 0 API CCXT Certified
kucoin kucoin KuCoin 2 API CCXT Certified
kuna kuna Kuna 2 API
lakebtc lakebtc LakeBTC 2 API
latoken latoken Latoken 1 API
lbank lbank LBank 1 API
liquid liquid Liquid 2 API
livecoin livecoin LiveCoin * API
luno luno luno 1 API
lykke lykke Lykke 1 API
mandala mandala Mandala 2 API
mercado mercado Mercado Bitcoin 3 API
mixcoins mixcoins MixCoins 1 API
oceanex oceanex OceanEx 1 API
okcoincny okcoincny OKCoin CNY 1 API
okcoinusd okcoinusd OKCoin USD 1 API
okex okex OKEX 1 API
okex3 okex3 OKEX 3 API
paymium paymium Paymium 1 API
poloniex poloniex Poloniex * API CCXT Certified
rightbtc rightbtc RightBTC * API
southxchange southxchange SouthXchange * API
stex stex STEX 3 API
stronghold stronghold Stronghold 1 API
surbitcoin surbitcoin SurBitcoin 1 API
theocean theocean The Ocean 1 API
therock therock TheRockTrading 1 API
tidebit tidebit TideBit 2 API
tidex tidex Tidex 3 API
timex timex TimeX 1 API
upbit upbit Upbit 1 API CCXT Certified
vaultoro vaultoro Vaultoro 1 API
vbtc vbtc VBTC 1 API
virwox virwox VirWoX * API
whitebit whitebit WhiteBit 2 API
xbtce xbtce xBTCe 1 API
yobit yobit YoBit 3 API
zaif zaif Zaif 1 API
zb zb ZB 1 API

The good folks over at CCXT has done a fantastic job implementing all of these exchanges, for people to query and fetch data in a unified format. Please be sure to shoot them a donation!