You can query the API with a simple GET request. All that is needed
is to send your request to: https://api.taapi.io with at least the mandatory parameters.
Pro’s
- Very easy to get started.
Con’s
- Only Binance supported.
- Candles only update on candle close.
Getting started
To get started, simply make an HTTP GET Request or call in your browser:
[GET] https://api.taapi.io/rsi?secret=MY_SECRET&exchange=binance&symbol=BTCUSDT&interval=1h
A JSON Response is returned:
{
"value": 69.8259211745199
}
Mandatory Parameters
Using this “Direct” method requires at least the below parameters:
Parameter | Type | Description |
---|---|---|
secret | String | The secret which is emailed to you when you Request an API key. |
exchange | String | The exchange you want to calculate TA from: [“binance”] . So far TAAPI.IO only supports Binance for this integration method. For other crypto / stock exchanges, please refer to our Client or Manual integration methods. |
symbol | String | Symbol 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. |
interval | String | Interval 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:
Parameter | Type | |
---|---|---|
backtrack | Integer | This ‘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. |
Examples
Below you’ll find some examples, how to connect, authenticate and query the API:
NodeJS
// Require taapi (using the NPM client: 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);
});
// --- Or ---
// Require axios: npm i axios
var axios = require('axios');
axios.get('https://api.taapi.io/rsi', {
params: {
secret: MY_SECRET,
exchange: "binance",
symbol: "BTCUSDT",
interval: "1h",
}
})
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error.response.data);
});
PHP
<?php
$query = http_build_query(array(
'secret' => MY_SECRET,
'exchange' => 'binance',
'symbol' => 'BTCUSDT',
'interval' => '1h'
));
// Define endpoint
$url = "https://api.taapi.io/rsi?{$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 urllib.request
url = "https://api.taapi.io/rsi?secret=MY_SECRET&exchange=binance&symbol=BTCUSDT&interval=1h"
print(urllib.request.urlopen(url).read())
Ruby
require 'net/http'
uri = URI("https://api.taapi.io/rsi?secret=MY_SECRET&exchange=binance&symbol=BTCUSDT&interval=1h")
puts Net::HTTP.get(uri)
Curl
curl "https://api.taapi.io/rsi?secret=MY_SECRET&exchange=binance&symbol=BTCUSDT&interval=1h"
Note
Using this method means that TAAPI.IO is fetching candle data from the exchanges. The exchanges unfortunately have a habit of suddenly changing their rate-limits based on their load / terms of service etc…, this means that TAAPI.IO will in no way guarantee that there won’t be a problem in our data synchronization, and TAAPI.IO will in no way be held responsible for any result due to miss-calculation of indicator values based on incorrect / or incomplete candle data. Please check out our complete Terms of service. To validate and verify exchange data your-self, please use our Client or Manual integration methods. This being said, we of course do our absolute best to adapt to any changes that the exchanges may have, but we simply cannot legally guarantee 100% error free candles 100% of the time!