Indicators›Trend›Bollinger Bands
GET/indicator/bbands

Bollinger Bands

Category: Trend · Updated November 2026


The TAAPI.IO Bollinger Bands API returns the upper, middle and lower bands as JSON for crypto pairs and US stocks. Send an exchange, symbol and timeframe to get real-time or historical values, with no candles to download and no calculations to maintain.

What one request returns

  • The three bands: the middle band (valueMiddleBand), a 20-period moving average, and the upper and lower bands (valueUpperBand, valueLowerBand), two standard deviations either side of it.
  • A series, with results: one set of bands per candle, oldest first, to measure how wide the bands are compared with their recent history.
  • Bands and price together, with /bulk: add the price indicator to compare the latest close with the bands in the same request.

So one call answers two questions: is price stretched, and is volatility about to change?

Example: a squeeze, then a walk down the lower band, 8 to 14 November 2026

Request: GET /indicator/bbands for SOLUSDT on 4-hour Binance candles, with results=50 and backtrack=1, so the last 50 closed candles. Sent at 21:59 UTC on 14 November with the default settings of 20 and 2. Three of the 50 candles are below, with closes from candles.

CandleSOL closeUpperMiddleLowerWidthReading
8 Nov 16:0089.6090.6389.8889.131.66%Squeeze: the narrowest bands in six weeks
8 Nov 20:0086.5491.3289.7088.073.62%Close 1.7% below the lower band
14 Nov 16:0072.2487.0479.8472.6418.04%Still closing below the lower band

How to interpret this: For 20 candles, from 5 November at 12:00 to 8 November at 16:00, SOL closed between 89.32 and 90.75. With so little movement, the standard deviation shrank and the bands closed to 1.66% of price, the narrowest since the end of September. Narrow bands mean low volatility, and low volatility rarely lasts. The next candle fell 3.4% and closed 1.7% below the lower band, and the squeeze turned into a trend. Over the next 36 candles SOL fell to 72.24, 16.5% below the breakout close. It closed below the lower band 11 times and never once closed above the middle band, while the bands widened to 18.04%. This is what John Bollinger calls walking the band. For a mean-reversion trader, every close below the lower band looked like a buy. The first one, at 86.54, only reached the middle band on 11 November because the middle band had fallen to 85.59 to meet it, so it closed for a 1.1% loss. The next one, at 78.47 on 13 November, was 7.9% down by 14 November. A breakout trader reading the same bands sold the first close below the lower band and has been on the right side since.

SOLUSDT 4-hour candles with Bollinger Bands 20, 2 and band width, 1 to 14 November 2026 On 8 November at 16:00 the bands narrowed to 1.66% of price, the narrowest in six weeks. The next candle closed 1.7% below the lower band. Over the next 36 candles SOL fell from 89.60 to 72.24, closed below the lower band 11 times and never closed above the middle band. 70 75 80 85 90 95 100 105 0% 10% 20% Band width, % of the middle band 1 Nov 3 Nov 5 Nov 7 Nov 9 Nov 11 Nov 13 Nov 8 Nov 16:00: 1.66%, narrowest in six weeks Squeeze, then a close 1.7% below the lower band. 11 closes below it since, none above the middle 18.0% Outer bands Middle (SMA 20) Close below band Band width SOLUSDT · Binance 4h candles · Bollinger Bands 20, 2 · 1 – 14 Nov 2026 (closed candles)
Top: 4-hour candles with Bollinger Bands 20, 2. The shaded area is between the upper and lower bands, and the dashed line is the middle band. Red circles mark closes below the lower band after the squeeze. Bottom: the band width as a percentage of the middle band.

Values are from the production API on 14 November 2026, using closed 4-hour candles from 29 September. One squeeze is an illustration, not a backtest, and nothing here is financial advice.

SpecValue
EndpointGET https://v2.taapi.io/indicator/bbands
OutputsUpper band, middle band, lower band, timestamp
Default settingsPeriod 20, 2 standard deviations
MarketsBinance, Binance Futures, Bybit, Gate.io, Kraken and US stocks
Timeframes1m to 1w
DeliveryREST, 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"

Bollinger Bands API response

This response came from the live API on 9 November 2026.

200 OK
{
  "valueUpperBand": [76349.5737352088],
  "valueMiddleBand": [74985.87349999997],
  "valueLowerBand": [73622.17326479114],
  "timestamp": [1794218400]
}
FieldTypeDescription
valueUpperBandnumber[]Upper band
valueMiddleBandnumber[]Middle band
valueLowerBandnumber[]Lower band
timestampinteger[]Unix time of each candle, in seconds

Bollinger Bands API parameters

NameTypeRequiredDefaultDescription
exchangestringYes—binance, binancefutures, bybit, gateio, kraken or stocks
symbolstringYes—Pair or ticker, e.g. BTCUSDT or AAPL
timeframestringYes—1m 5m 15m 1h 4h 1d 1w
periodintegerNo20Number of closes in the moving average and the standard deviation
stddevnumberNo2Distance of the outer bands from the middle band, in standard deviations
resultsintegerNo1Number of values to return, or max
backtrackintegerNo0Candles to skip from the most recent

What are 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

OutputCalculation
Middle bandSimple moving average of the last 20 closes
Standard deviationStandard deviation of the same 20 closes, divided by 20 (not 19)
Upper bandMiddle band + 2 × standard deviation
Lower bandMiddle band − 2 × standard deviation

In the example, the 20 closes up to 8 November 16:00 average 89.88 with a standard deviation of 0.37. So the bands are 89.88 ± 0.75: 89.13 and 90.63.

How to read Bollinger Bands in your code

SignalMeaningCondition
Upper band tagPrice is high relative to its recent rangeClose at or above valueUpperBand
Lower band tagPrice is low relative to its recent rangeClose at or below valueLowerBand
SqueezeVolatility has contractedBand width at its lowest for many candles
BreakoutVolatility is expandingFirst close outside a band after a squeeze
Band walkStrong trendRepeated closes at or outside one band, none past the middle band

Limitations: A touch of a band is not a reversal signal. In strong trends price can walk along a band for many candles, as in the example above. 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.

MeasureCalculation
%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. The breakout candle in the example had a %B of −0.47. If you only need the 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 an outer band is often followed by a return to the middle. After a squeeze, a close outside a band can be the start of a larger move, and price may then walk along that band, as SOL did in November.

Check the bands' width before you buy a lower-band close. A close outside a band almost always widens the bands by itself: on SOL's 4-hour chart, 27 of the 28 closes below the lower band since October came with wider bands than the candle before. So a widening band doesn't tell a breakout from a bounce, but a squeeze just before does. A trend filter such as ADX, or a Squeeze Momentum reading, also helps tell the two apart.

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"

Detect a squeeze breakout with Python

The squeeze check above tells you the bands are narrow. A breakout trader waits for the next step: the first close outside a band right after the squeeze. This request returns 50 sets of bands and the last close in one /bulk call, and fits on the Basic plan because it uses one construct.

POST/bulk
curl -X POST https://v2.taapi.io/bulk \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "constructs": [
    {
      "id": "sol_4h",
      "exchange": "binance",
      "symbol": "SOLUSDT",
      "timeframe": "4h",
      "indicators": [
        {
          "id": "bb",
          "indicator": "bbands",
          "results": 50,
          "backtrack": 1
        },
        {
          "id": "close",
          "indicator": "price",
          "backtrack": 1
        }
      ]
    }
  ]
}'

The response at 21:59 UTC on 14 November, with each band shortened to its last two values. The candle before was 16.18% wide, far from the six-week low, so the script prints No squeeze breakout, band width 18.04%. With backtrack set to 36 for both indicators, the request ends at the 8 November 20:00 candle, and the same script prints Squeeze breakout down.

200 OK
{
  "sol_4h": {
    "bb": {
      "valueUpperBand": [86.92980171845332, 87.03847109568737],
      "valueMiddleBand": [80.42400000000019, 79.83800000000019],
      "valueLowerBand": [73.91819828154706, 72.63752890431302],
      "timestamp": [1794657600, 1794672000]
    },
    "close": {
      "value": [72.24],
      "timestamp": [1794672000]
    }
  }
}

Not every breakout follows through. In the six weeks before 14 November this rule fired twice on SOL. One was the November breakdown. The other was on 28 October at 08:00, when SOL closed at 102.75, just 0.02 above the upper band. That breakout failed: a day and a half later SOL closed at 95.64, below the lower band and 6.9% lower. Requiring the close to clear the band by a margin, or confirming with volume, filters out the weakest breakouts.

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.

POST/bulk
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.

WSSwss://v2.taapi.io/streaming
{
  "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.

SettingsCharacterTypical use
20, 2StandardDefault suggested by Bollinger
10, 1.5Tighter, fasterShort-term charts
50, 2.5Wider, slowerLonger-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 period and stddev match your chart. The defaults are 20 and 2.
  • Deviation method: TAAPI.IO divides by the number of closes (20), as Bollinger does. Tools that divide by 19 draw slightly wider bands.

Bollinger Bands API FAQ

What does the Bollinger Bands API return?

Four arrays: valueUpperBand, valueMiddleBand, valueLowerBand and a timestamp for each candle.

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.

How do I detect a Bollinger Band squeeze?

Request results=50, calculate the width of each set of bands, and check whether the latest width is at or near the lowest of the series. See Detect a Bollinger Band squeeze with Python.

Is a close below the lower band a buy signal?

Not on its own. In a range it can be, but after a squeeze it is often the start of a trend, as in the example above, where SOL closed below the lower band 11 times in six days while it fell 16.5%.

Can I change the Bollinger Bands width?

Yes. Set stddev for the multiplier and period for the lookback. The defaults are 2 and 20.

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.

Build with Bollinger Bands on Binance, Bybit or US stocks. Start for free or browse all 262 indicators.