🔍

By default every indicator call returns one value — the most recent calculated result. The results and backtrack parameters let you retrieve a window of historical values without making multiple requests.

These parameters work on all single indicator requests and on each indicator within a bulk call. The candles endpoint also accepts results and backtrack with the same semantics.

The results parameter

Set results to an integer to receive that many consecutive values ending at the most recent candle.

Request — last 10 RSI values
GET https://v2.taapi.io/indicator/rsi
  ?exchange=binance
  &symbol=BTCUSDT
  &timeframe=1h
  &results=10
Response
{
  "value":     [61.2, 63.4, 58.9, 67.1, 62.3, 55.8, 70.2, 48.6, 59.1, 64.7],
  "timestamp": [1708243200, 1708246800, 1708250400, 1708254000, 1708257600,
                1708261200, 1708264800, 1708268400, 1708272000, 1708275600]
}
TODO(human): Confirm whether index 0 is the oldest or most recent result. This must be verified against the live API — the spec does not state it.

Using max

Pass results=max to return all available historical values for this symbol/timeframe combination.

All available RSI values
GET /indicator/rsi?exchange=binance&symbol=BTCUSDT&timeframe=1h&results=max
TODO(human): Confirm the upper limit on results for indicator calls and for candle calls. The spec does not state a numeric cap — the candles data-injection endpoint documents a 500-candle max, but this does not necessarily apply to exchange-fetched results.

The backtrack parameter

backtrack shifts the result window back in time by N candles. The default is 0 (no shift — the most recent candle is the last in the window).

A useful mental model: the API computes the indicator as if the current time were N candles ago. Combined with results, this lets you page through history without overlap.

RSI as it was 24 candles ago (on 1h, that's 24 hours back)
GET /indicator/rsi?exchange=binance&symbol=BTCUSDT&timeframe=1h&backtrack=24
Window of 10 values starting 50 candles ago
GET /indicator/rsi?exchange=binance&symbol=BTCUSDT&timeframe=1h&results=10&backtrack=50

In the second example, the result contains 10 values from 59 candles ago through 50 candles ago (the window ends at backtrack).

In bulk requests

results and backtrack can be set per-indicator inside a bulk construct:

Bulk with historical results
{
  "constructs": [
    {
      "id": "btc_1h",
      "exchange": "binance",
      "symbol": "BTCUSDT",
      "timeframe": "1h",
      "indicators": [
        { "id": "rsi_hist", "indicator": "rsi", "results": 5, "backtrack": 0 }
      ]
    }
  ]
}