Head and Shoulders
Category: Chart patterns · Updated November 2026
The TAAPI.IO Head and Shoulders API returns h1 timestamp, h1 price, l1 timestamp, l1 price values for the Head and Shoulders 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/headandshoulders |
| Outputs | h1_timestamp, h1_price, l1_timestamp, l1_price, h2_timestamp, h2_price and more |
| Markets | Binance, Binance Futures, Bybit, Gate.io, Kraken and US stocks |
| Timeframes | 1m to 1w |
| Delivery | REST, bulk and WebSocket |
Get Head and Shoulders with one API call
This request returns Head and Shoulders for BTCUSDT on 1-hour Binance candles. Add your API key to run it here.
curl -G https://v2.taapi.io/indicator/headandshoulders \ -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/headandshoulders',
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/headandshoulders?${params}`, {
headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
console.log(await res.json());Head and Shoulders API response
This response came from the live API on 9 November 2026 for ETHUSDT on 1h candles. Long lists are shortened here.
{
"h1_timestamp": [1790265600],
"h1_price": [2706],
"l1_timestamp": [1790319600],
"l1_price": [2672.04],
"h2_timestamp": [1790334000],
"h2_price": [2743],
"l2_timestamp": [1790348400],
"l2_price": [2686.9],
"h3_timestamp": [1790409600],
"h3_price": [2697.79],
"neckline_left_timestamp": [1790319600],
"neckline_left_price": [2672.04],
"neckline_right_timestamp": [1790481600],
"neckline_right_price": [2755.6275000000005],
"neckline_at_h2": [2679.4700000000003],
"breakout_occurred": [false],
"is_confirmed": [false],
"breakout_timestamp": [null],
"breakout_price": [null],
"breakout_neckline_price": [null],
"projection_price": [null],
"direction": ["bearish"],
"status": ["invalidated"],
"status_reason": ["bullish_structure_resumed"],
"pattern_index": [2],
"timestamp": [1794218400]
}This response can be null or empty when there is nothing to report for the requested candles, so handle that case in your code.
| Field | Type | Description |
|---|---|---|
h1_timestamp | number[] | Unix timestamp of the left shoulder peak (H1). |
h1_price | number[] | Price level at the left shoulder peak (H1). |
l1_timestamp | number[] | Unix timestamp of the first trough (L1) separating the left shoulder from the head. |
l1_price | number[] | Price level at the first trough (L1). |
h2_timestamp | number[] | Unix timestamp of the head peak (H2). |
h2_price | number[] | Price level at the head peak (H2). |
l2_timestamp | number[] | Unix timestamp of the second trough (L2) separating the head from the right shoulder. |
l2_price | number[] | Price level at the second trough (L2). |
h3_timestamp | number[] | Unix timestamp of the right shoulder peak (H3). |
h3_price | number[] | Price level at the right shoulder peak (H3). |
neckline_left_timestamp | number[] | Unix timestamp of the neckline start anchor (L1). |
neckline_left_price | number[] | Price level of the neckline start anchor (L1). |
neckline_right_timestamp | number[] | Timestamp denoting where the neckline extends to on the right. |
neckline_right_price | number[] | The price level of the neckline at the right endpoint. |
neckline_at_h2 | number[] | The calculated price of the neckline directly beneath the head peak (H2), used to measure pattern height. |
breakout_occurred | boolean[] | Boolean flag (true/false) indicating if price successfully broke below the neckline. |
is_confirmed | boolean[] | Explicit boolean flag (true/false) indicating if the Head and Shoulders pattern is fully confirmed (synonymous with breakout_occurred). |
breakout_timestamp | array | Unix timestamp of the candle that triggered the confirmation breakdown. |
breakout_price | array | The closing price of the candle that triggered the confirmation breakdown. |
breakout_neckline_price | array | The specific price of the sloped neckline at the exact moment of the breakout. |
projection_price | array | The theoretical downside price target calculated by subtracting the pattern's height from the breakout neckline price. |
direction | string[] | The inherent bias of the pattern. Always 'bearish' for a Head and Shoulders. |
status | string[] | The current state of the pattern: 'forming', 'confirmed', or 'invalidated'. |
status_reason | string[] | Context detailing why the pattern holds its current status (e.g. 'awaiting_breakout'). |
pattern_index | number[] | A sequential integer index uniquely identifying this specific pattern instance. |
timestamp | integer[] | Unix time of each candle, in seconds |
Head and Shoulders 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 |
depth | integer | No | 10 | Lookback and lookforward period for pivot detection. Controls the width of structural swings. |
deviationATR | number | No | 1 | Minimum retracement required to form a valid structural swing, expressed as a multiple of ATR. |
deviationType | string | No | atr | Type of deviation filter to use: 'atr' (Average True Range) or 'percent'. |
source | string | No | wick | Whether to use 'wick' (high/low) or 'body' (open/close) prices for pivot detection. |
heikinashi | boolean | No | True | Set to true to calculate pivots based on smoothed Heikin-Ashi candles rather than raw market prices. |
atrPeriod | integer | No | 14 | The lookback period used for the Average True Range (ATR) calculation if deviationType is 'atr'. |
headProminenceATR | number | No | 1.2 | Minimum required prominence of the head relative to both shoulders, normalized by ATR. |
shoulderToleranceATR | number | No | 1.5 | Maximum allowed price difference between the left and right shoulders, normalized by ATR. |
minDepthATR | number | No | 1 | Minimum depth of the two troughs (L1 and L2), ensuring distinct shoulders. |
symmetryMin | number | No | 0.5 | Minimum ratio of time spent forming the left half vs the right half of the pattern. |
symmetryMax | number | No | 3.5 | Maximum ratio of time spent forming the left half vs the right half of the pattern. |
breakoutLookahead | integer | No | 20 | Number of candles to look ahead after the right shoulder to confirm a breakdown. |
necklineBuffer | number | No | 0.2 | ATR-based buffer below the neckline to filter out false breakdowns during formation. |
results | integer | No | 1 | Number of values to return, or max |
backtrack | integer | No | 0 | Candles to skip from the most recent |
What is Head and Shoulders?
Head and Shoulders is a bearish reversal pattern with three peaks, the middle one highest, and a neckline joining the troughs. The endpoint returns each peak and trough, the neckline and a projected target.
Head and Shoulders formula
| Output | Calculation |
|---|---|
| Target | Neckline − (head − neckline) |
How to read Head and Shoulders in your code
| Signal | Meaning | Condition |
|---|---|---|
| Forming or confirmed | Detection status | status and is_confirmed |
| Breakout | Price closed below the neckline | breakout_occurred is true |
| Target | Measured-move projection | projection_price |
Limitations: Geometric pattern detection depends on pivot settings, so tune deviationATR and depth or lookback values on your own market. A confirmed pattern is not a guaranteed move. Nothing on this page is financial advice.
Read Head and Shoulders from Python
Use backtrack=1 to read the result as of the last closed candle.
curl -G https://v2.taapi.io/indicator/headandshoulders \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "backtrack=1"
import requests
resp = requests.get(
'https://v2.taapi.io/indicator/headandshoulders',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '1h', 'backtrack': 1},
)
data = resp.json()
print(data['h1_timestamp'])Get historical Head and Shoulders 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/headandshoulders \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "results=100"
Get Head and Shoulders for multiple symbols
Combine Head and Shoulders 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": "headandshoulders",
"indicator": "headandshoulders"
},
{
"id": "rsi",
"indicator": "rsi"
}
]
}
]
}'Stream Head and Shoulders 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": "headandshoulders",
"exchange": "binance",
"symbol": "BTCUSDT",
"interval": "1m",
"indicator": "headandshoulders"
}Head and Shoulders API FAQ
What does the Head and Shoulders API return?
It returns h1_timestamp, h1_price, l1_timestamp, l1_price, h2_timestamp, h2_price, l2_timestamp, l2_price, h3_timestamp, h3_price, neckline_left_timestamp, neckline_left_price, neckline_right_timestamp, neckline_right_price, neckline_at_h2, breakout_occurred, is_confirmed, breakout_timestamp, breakout_price, breakout_neckline_price, projection_price, direction, status, status_reason, pattern_index, plus a timestamp for the request. Results are JSON.
Is the latest Head and Shoulders 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 Head and Shoulders settings can I change?
You can set depth, deviationATR, deviationType, source, heikinashi, atrPeriod. See the parameters table above for defaults.
Can I get Head and Shoulders for US stocks?
Yes. Use exchange=stocks with a ticker such as AAPL. US stocks are included on the Pro plan and above.
Related indicators
See the full list of indicators, or start for free.