Bollinger Bands
Category: Trend · Updated November 2026
The TAAPI.IO Bollinger Bands API returns upper band, middle band, lower band values for the Bollinger Bands indicator as JSON, for crypto pairs and US stocks. Send an exchange, symbol and timeframe to get real-time or historical data, with no candles to download and no calculations to maintain.
| Spec | Value |
|---|---|
| Endpoint | GET https://v2.taapi.io/indicator/bbands |
| Outputs | valueUpperBand, valueMiddleBand, valueLowerBand |
| Markets | Binance, Binance Futures, Bybit, Gate.io, Kraken and US stocks |
| Timeframes | 1m to 1w |
| Delivery | REST, bulk and WebSocket |
Get Bollinger Bands with one API call
This request returns Bollinger Bands for BTCUSDT on 1-hour Binance candles. Add your API key to run it here.
curl -G https://v2.taapi.io/indicator/bbands \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h"
import requests
resp = requests.get(
'https://v2.taapi.io/indicator/bbands',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '1h'},
)
print(resp.json())const params = new URLSearchParams({"exchange": "binance", "symbol": "BTCUSDT", "timeframe": "1h"});
const res = await fetch(`https://v2.taapi.io/indicator/bbands?${params}`, {
headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
console.log(await res.json());Bollinger Bands API response
This response came from the live API on 9 November 2026. Long lists are shortened here.
{
"valueUpperBand": [76349.5737352088],
"valueMiddleBand": [74985.87349999997],
"valueLowerBand": [73622.17326479114],
"timestamp": [1794218400]
}| Field | Type | Description |
|---|---|---|
valueUpperBand | number[] | Upper band |
valueMiddleBand | number[] | Middle band |
valueLowerBand | number[] | Lower band |
timestamp | integer[] | Unix time of each candle, in seconds |
Bollinger Bands API parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
exchange | string | Yes | — | binance, binancefutures, bybit, gateio, kraken or stocks |
symbol | string | Yes | — | Pair or ticker, e.g. BTCUSDT or AAPL |
timeframe | string | Yes | — | 1m 5m 15m 1h 4h 1d 1w |
period | integer | No | 20 | Period |
stddev | number | No | 2 | Stddev |
results | integer | No | 1 | Number of values to return, or max |
backtrack | integer | No | 0 | Candles to skip from the most recent |
What is Bollinger Bands?
Bollinger Bands, developed by John Bollinger in the 1980s, place bands a set number of standard deviations above and below a moving average. Because the width follows volatility, the bands expand in fast markets and contract in quiet ones.
Bollinger Bands formula
| Output | Calculation |
|---|---|
| Middle band | SMA(close, period) |
| Upper band | Middle + stddev × standard deviation |
| Lower band | Middle − stddev × standard deviation |
How to read Bollinger Bands in your code
| Signal | Meaning | Condition |
|---|---|---|
| Upper band tag | Price is high relative to recent range | Close at or above valueUpperBand |
| Lower band tag | Price is low relative to recent range | Close at or below valueLowerBand |
| Squeeze | Volatility contraction | (valueUpperBand − valueLowerBand) at a multi-candle low |
| Band walk | Strong trend | Consecutive closes outside one band |
Limitations: A touch of a band is not a reversal signal. In strong trends price can walk along a band for many candles. Nothing on this page is financial advice.
Bollinger %B and Bandwidth
John Bollinger defined two measures you can calculate from the three values this endpoint returns.
| Measure | Calculation |
|---|---|
| %B | (close − lower band) ÷ (upper band − lower band) |
| Bandwidth | (upper band − lower band) ÷ middle band × 100 |
%B above 1 means the close is over the upper band, and below 0 means it is under the lower band. If you only need width, the Bollinger Bands Width endpoint returns it directly.
Mean reversion or breakout?
The same bands support two opposite approaches, and the market state decides which one applies. In a range, a move to the outer band is often followed by a return to the middle. In a trend or after a squeeze, a close outside the band can be the start of a larger move, and price may then walk along that band.
This is why a band touch is not a signal alone. A trend filter such as ADX, or a Squeeze Momentum reading, helps determine which situation you are in.
Detect a Bollinger Band squeeze with Python
A squeeze is a period when the bands are unusually narrow. This calculates band width across the last 50 closed candles and checks whether the latest one is near the low of that range.
curl -G https://v2.taapi.io/indicator/bbands \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "results=50" \ --data-urlencode "backtrack=1"
import requests
resp = requests.get(
'https://v2.taapi.io/indicator/bbands',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '1h', 'results': 50, 'backtrack': 1},
)
data = resp.json()
widths = [
(upper - lower) / middle * 100
for upper, middle, lower in zip(
data['valueUpperBand'], data['valueMiddleBand'], data['valueLowerBand']
)
]
if widths[-1] <= min(widths) * 1.05:
print(f'Squeeze: band width is {widths[-1]:.2f}%')
else:
print(f'No squeeze: band width is {widths[-1]:.2f}%')Get historical Bollinger Bands values
Add results to return a series for backtesting or charting. The last element is the most recent candle.
curl -G https://v2.taapi.io/indicator/bbands \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "results=100"
Get Bollinger Bands for multiple symbols
Combine Bollinger Bands with other indicators in one request. Each exchange, symbol and timeframe combination is one construct: Basic allows 1 per request, Pro 3 and Expert 10.
curl -X POST https://v2.taapi.io/bulk \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"constructs": [
{
"id": "btc_1h",
"exchange": "binance",
"symbol": "BTCUSDT",
"timeframe": "1h",
"indicators": [
{
"id": "bbands",
"indicator": "bbands"
},
{
"id": "rsi",
"indicator": "rsi"
}
]
}
]
}'Stream Bollinger Bands in real time
Subscribe over WebSocket to receive new values every 5 seconds while the candle is forming. Streaming supports 1m, 5m, 15m and 1h, and uses interval where REST uses timeframe.
{
"type": "subscribe",
"id": "bbands",
"exchange": "binance",
"symbol": "BTCUSDT",
"interval": "1m",
"indicator": "bbands"
}Common Bollinger Bands settings
These are starting points, not recommendations. Test any setting on your own market and timeframe.
| Settings | Character | Typical use |
|---|---|---|
| 20, 2 | Standard | Default suggested by Bollinger |
| 10, 1.5 | Tighter, faster | Short-term charts |
| 50, 2.5 | Wider, slower | Longer-term charts |
Why Bollinger Bands values can differ between platforms
- Exchange data: The bands are built from the closes of the exchange you request.
- Open candle: The newest bands change with every update until the candle closes.
- Settings: Check that
periodandstddevmatch your chart. The defaults are 20 and 2. - Deviation method: Tools can differ in how they calculate standard deviation, which slightly changes the band width.
Bollinger Bands API FAQ
What does the Bollinger Bands API return?
It returns valueUpperBand, valueMiddleBand, valueLowerBand, plus a timestamp for the request. Results are JSON.
Is the latest Bollinger Bands value final?
No. The newest value belongs to the candle still forming and can change until it closes. Add backtrack=1 to read the last closed candle.
Which Bollinger Bands settings can I change?
You can set period, stddev. See the parameters table above for defaults.
Can I get Bollinger Bands for US stocks?
Yes. Use exchange=stocks with a ticker such as AAPL. US stocks are included on the Pro plan and above.
Can I change the Bollinger Bands width?
Yes. Set stddev for the multiplier and period for the lookback. The defaults are 2 and 20.
Related indicators
See the full list of indicators, or start for free.