Free Bollinger Bands API
JSON, Inputs & Python
Compare free Bollinger Bands API options, verify symbols, intervals, fields, limits, and freshness, then test an upper, middle, and lower band request.
What a free Bollinger Bands API should provide
A useful technical-indicator API returns Bollinger Bands for a chosen symbol and interval with a documented calculation contract. It should let the application set or verify the moving-average period and standard-deviation multiplier, retrieve timestamped JSON, and connect the result to a chart, scanner, research workflow, or agent without guessing the underlying price series.
Important: “Free” may mean a limited tier, trial, delayed feed, or non-commercial license. Indicator values depend on source prices, adjustment rules, period, deviation multiplier, and warm-up history; they are not investment advice.
Bollinger Bands API inputs and response fields
Symbol, market, and interval
Confirm whether the endpoint supports stocks, forex, or crypto and accepts daily, weekly, or intraday intervals. Check exchange identifiers, timezone, and adjusted versus unadjusted prices.
Period and standard-deviation multiplier
A common default is a 20-period moving average with bands two standard deviations away. Do not assume defaults: send the period, moving-average type, and deviation values when documented.
Upper, middle, and lower band JSON
Require timestamped upper, middle, and lower values plus symbol, interval, period, and calculation metadata. Validate numeric types, chronological order, missing values, and warm-up rows.
API key, limits, freshness, and license
Check authentication, calls per minute or day, historical depth, real-time entitlement, caching, attribution, redistribution, commercial use, and explicit error payloads.
Bandwidth and percent B definitions
Some endpoints add bandwidth and %B, but formulas and zero-width handling must be documented. Common definitions divide band width by the middle band and locate price within the upper-lower range. Preserve the chosen price input, scaling, and null behavior rather than treating similarly named fields as interchangeable.
Squeeze and breakout labels
A “squeeze” requires an explicit bandwidth threshold, comparison history, and confirmation rule; touching or crossing a band is not automatically a breakout or reversal. Prefer raw bands and bandwidth, then version any alert logic in the application so it can be tested without inheriting an opaque provider label.
Session and source-price alignment
Store exchange or venue, timezone, regular versus extended session, candle status, source timestamp, and adjusted-price mode. Equity bands can jump around splits when adjustment is inconsistent, while crypto bands can differ across venues because each feed observes a different traded price.
Why two APIs can return different bands: the usual formula is middle = moving average, upper = middle + k × standard deviation, and lower = middle − k × standard deviation. Results still diverge when providers use SMA versus EMA, population versus sample standard deviation, adjusted versus raw prices, different session boundaries, or different warm-up histories. Treat those choices as part of the data contract—not as implementation trivia.
Reproduce a five-price fixture by hand
Use closing prices 100, 102, 101, 103, 104, a five-period simple moving average, and a multiplier of 2. The middle band is (100+102+101+103+104) ÷ 5 = 102. The squared deviations sum to 10. With population standard deviation (ddof=0), σ is √(10÷5) = 1.4142, so the upper band is 104.8284 and the lower band is 99.1716.
| Convention | Standard deviation | Upper / lower | Result |
|---|---|---|---|
Population, ddof=0 | 1.4142 | 104.8284 / 99.1716 | Common in indicator libraries |
Sample, ddof=1 | 1.5811 | 105.1623 / 98.8377 | Wider bands from the same prices |
Under the population convention, the last close of 104 gives %B = (104−99.1716) ÷ (104.8284−99.1716) = 0.8536. Bandwidth is (104.8284−99.1716) ÷ 102 = 5.55%. Some APIs scale %B to 85.36 instead of 0.8536 or return bandwidth as 0.0555 instead of 5.55%; field units must therefore be part of validation.
Free technical indicator API options to evaluate
The sources below document indicator endpoints or pre-calculated Bollinger Bands. Treat the table as a verification shortlist, not an endorsement; free access and terms can change.
| Source | Useful signal | Verify before use |
|---|---|---|
| Alpha Vantage | Official technical-indicator documentation includes BBANDS inputs for symbol, interval, time period, moving-average type, and deviations. | Current free-key quota, data freshness, market entitlement, output size, and production terms. |
| Twelve Data | Its indicator API documents Bollinger Bands for supported instruments and intervals. | Current free-plan credits, websocket versus REST access, exchange coverage, and real-time status. |
| indictr | The current product page advertises pre-calculated Bollinger Bands, JSON/CSV output, and a limited free tier. | Supported symbols, intervals, calculation parameters, historical depth, uptime, and terms. |
| StockApi | Its Chinese BOLL endpoint documents daily, weekly, and monthly queries with cycle and bandwidth parameters. | A-share coverage, adjustment method, update schedule, authentication, quota, and commercial license. |
Bollinger Bands API Python example and validation
Normalize each provider response into one small contract before the indicator reaches a chart or signal engine. The field names below are illustrative; map the provider’s documented schema rather than assuming it already uses these names.
{
"symbol": "AAPL",
"interval": "1day",
"period": 20,
"deviation": 2,
"moving_average": "SMA",
"standard_deviation": "population",
"adjusted": true,
"values": [
{"timestamp": "2026-07-31T20:00:00Z", "upper": "214.83", "middle": "210.10", "lower": "205.37"}
]
}
The validator deliberately uses Decimal and timezone-aware timestamps. Supply the API response as payload after handling authentication, HTTP status, rate limits, and provider-specific error objects.
from datetime import datetime
from decimal import Decimal, InvalidOperation
def parse_utc(value: str) -> datetime:
parsed = datetime.fromisoformat(value.replace("Z", "+00:00"))
if parsed.tzinfo is None:
raise ValueError("timestamp must include a timezone")
return parsed
def validate_bollinger_payload(payload: dict) -> list[dict]:
required_meta = {
"symbol", "interval", "period", "deviation",
"moving_average", "standard_deviation", "adjusted", "values"
}
missing = required_meta - payload.keys()
if missing:
raise ValueError(f"missing metadata: {sorted(missing)}")
if int(payload["period"]) < 2 or Decimal(str(payload["deviation"])) <= 0:
raise ValueError("period and deviation must be positive")
rows = []
previous_time = None
for raw in payload["values"]:
timestamp = parse_utc(raw["timestamp"])
try:
upper = Decimal(str(raw["upper"]))
middle = Decimal(str(raw["middle"]))
lower = Decimal(str(raw["lower"]))
except (KeyError, InvalidOperation) as exc:
raise ValueError("invalid band row") from exc
if not upper >= middle >= lower:
raise ValueError(f"band order failed at {timestamp.isoformat()}")
if previous_time is not None and timestamp <= previous_time:
raise ValueError("timestamps must be strictly increasing")
rows.append({"timestamp": timestamp, "upper": upper,
"middle": middle, "lower": lower})
previous_time = timestamp
if not rows:
raise ValueError("response contains no completed indicator rows")
return rows
1. Send symbol, interval, period, and deviation
Keep the key server-side and use the documented URL, for example requests.get(url, params={"symbol":"AAPL","interval":"1day","time_period":20,"sd":2,"apikey":api_key}, timeout=20). Parameter names differ by provider.
2. Validate HTTP and JSON fields
Call raise_for_status(), parse JSON, then locate timestamped upper, middle, and lower band values. Reject error payloads, null rows, non-numeric strings, and unexpected schemas.
3. Recalculate a fixture and prevent look-ahead
For each valid row, confirm upper ≥ middle ≥ lower and timestamps are ordered as documented. Recalculate a fixed sample from the same source prices using the provider’s moving-average type, standard-deviation convention, adjustment mode, and window. Exclude warm-up rows and do not let an incomplete current bar or future revision enter a historical signal.
4. Respect limits, freshness, and licensing
Handle 401, 403, 429, and 5xx responses; cache only as allowed; record provider, retrieval time, source timestamp, adjustment method, and entitlement.
5. Test semantic failure cases
Include flat prices that create zero band width, missing candles, a still-forming interval, a corporate-action date, and a long warm-up window. Verify ordering, %B behavior, revisions, and whether the endpoint changes past values after source bars are corrected.
6. Monitor the calculation contract
Track freshness, null rate, band-order violations, fixture deviation, quota use, parameter defaults, schema changes, and methodology notices. If validation fails, label the indicator unavailable rather than carrying old bands into a new trading session.
Bar-state rule: calculate a historical signal only from bars that were complete at the decision time. A still-forming 10:35 five-minute bar, a backfilled missing session, or a split adjustment applied after the original run can all change prior bands. Store the bar-close time, completion status, adjustment mode, source revision, and calculation time. When an input changes, recompute the affected window and version the signal rather than silently overwriting it.
How QVeris helps connect Bollinger Bands APIs
QVeris does not calculate or guarantee a provider’s indicators, grant exchange licenses, or promise trading outcomes. It helps developers and agents discover financial-data capabilities, inspect interfaces, and connect a selected external tool through a consistent workflow.
- Open the QVeris tool details for technical indicator and market-data capabilities.
- Inspect parameters, outputs, authentication, supported markets, documentation, timestamps, and quotas before connecting.
- Use the QVeris Capability Map to explore adjacent data tools; indicator data is not investment advice.
Free Bollinger Bands API FAQ
Is there a free Bollinger Bands API?
Yes. Some providers offer a limited free key or trial. Verify symbols, intervals, freshness, quota, licensing, and current plan access.
What does a Bollinger Bands API return?
Look for timestamped upper, middle, and lower bands plus symbol, interval, period, deviation, and calculation metadata.
How do I get Bollinger Bands data in Python?
Call the documented endpoint, handle HTTP errors, parse JSON, validate the three bands, and confirm chronological ordering.
Can a Bollinger Bands API provide real-time data?
Some support intraday intervals, but real-time exchange data may require a paid entitlement. Inspect timestamps and plan notes.
