Skip to main content

Migrating from API v1 to v2: what changed

Everything you need to change in your code to move from v1 to v2 of the TAAPI.IO API

Version 2 of the TAAPI.IO API is faster and more consistent, but requests are built differently and it uses a new API key. This guide lists everything you need to change when moving your integration from v1 to v2. The full v2 documentation is at docs.taapi.io.

Quick comparison

v1:

https://api.taapi.io/rsi?secret=YOUR_V1_KEY&exchange=binance&symbol=BTC/USDT&interval=1h

v2:

curl "https://v2.taapi.io/indicator/rsi?exchange=binance&symbol=BTCUSDT&timeframe=1h" \
-H "Authorization: Bearer YOUR_V2_KEY"

1. Generate a v2 API key

Your v1 key does not work with v2, and a v2 key does not work with v1. To get a v2 key:

  1. Log in to the dashboard at app.taapi.io.

  2. Open API Keys in the menu.

  3. Click Generate (or Regenerate v2 API key) to create your v2 key. It is shown as your Production key and starts with taapi_live_sk_.

Your v1 key is listed on the same page as Legacy API key (v1). Both keys work side by side, so you can move your code to v2 step by step. The v1 API will be switched off at a later date, so plan your migration in good time.

2. New base URL and paths

Requests go to https://v2.taapi.io, and every indicator lives under /indicator/. For example, /rsi becomes /indicator/rsi, and /macd becomes /indicator/macd.

3. Your API key goes in a header

The secret URL parameter is gone. Send your v2 key as a Bearer token on every request:

Authorization: Bearer YOUR_V2_KEY

For examples in curl, JavaScript and Python, see How do I send my API key? (Bearer authentication). If you get a 401 error, see this article.

4. Renamed parameters

  • interval is now timeframe (for example timeframe=1h). Supported values are 1m, 5m, 15m, 1h, 4h, 1d and 1w.

  • US stocks use exchange=stocks instead of type=stocks, for example exchange=stocks&symbol=AAPL.

  • For crypto symbols, the recommended format is BTCUSDT (no slash). This is the format returned by the symbols endpoint. BTC/USDT is still accepted.

5. Responses are always arrays, with timestamps

v1 returned a single value. v2 always returns arrays, even for one result, together with the timestamp of each candle:

v1: { "value": 58.62 }
v2: { "value": [58.62], "timestamp": [1793653200] }

Update your code to read value[0]. When you request several results, the arrays are ordered oldest to newest, so the most recent value is the last item. Multi-output indicators return a named array for each output. For example, MACD returns valueMACD, valueMACDSignal and valueMACDHist.

The first time you request a symbol and timeframe, you may get an HTTP 202 response with { "pending": true } while the data is fetched. Repeat the same request after 1–2 seconds.

6. Parameters that were removed

  • addResultTimestamp: no longer needed, because timestamps are always included.

  • fromTimestamp / toTimestamp: not available in v2. Use results (with backtrack if needed) to get historical values instead. See Historical Values.

results and backtrack work as before.

7. Bulk queries use "constructs"

POST https://v2.taapi.io/bulk takes a list of constructs. Each construct is one exchange + symbol + timeframe with up to 20 indicators. How many constructs you can send in one request depends on your plan:

  • Basic: 1

  • Pro: 3

  • Expert: 10

  • Enterprise: 15+ (agreed individually)

The id you give each construct and indicator becomes a key in the response. See What are bulk queries for an example.

8. Renamed and new endpoints

  • /candles: raw OHLCV candles (replaces the candle indicator).

  • /exchanges and /exchanges/{exchange}/symbols: replace /exchange-symbols.

  • POST /indicator/{name} and POST /bulk-candles: calculate indicators on your own candles.

  • WebSocket streaming at wss://v2.taapi.io/streaming: live indicator updates without polling. See Getting started with real-time WebSocket streaming.

Migration checklist

  1. Generate a v2 API key under API Keys at app.taapi.io.

  2. Change the base URL to https://v2.taapi.io and add /indicator/ to indicator paths.

  3. Send your v2 key in the Authorization: Bearer header instead of ?secret=.

  4. Rename interval to timeframe, and use exchange=stocks for stocks.

  5. Read values from arrays (value[0], or the last item for the most recent value).

  6. Retry requests that return 202 after 1–2 seconds.

  7. Remove addResultTimestamp, fromTimestamp and toTimestamp.

  8. Rewrite bulk request bodies in the constructs format, within your plan's construct limit.

Related articles

Did this answer your question?