MACD Indicator API
The MACD API returns the MACD line, signal line and histogram for any crypto pair, stock or forex symbol. MACD is the go-to momentum indicator for spotting trend changes and crossovers — get all three values in one call, on any timeframe, real-time or historical, with fully customisable fast/slow/signal periods.
Try it in 30 seconds
Code samples: Node · Python · PHP · cURL →[GET] https://v2.taapi.io/indicator/macd
Authorization: Bearer YOUR_API_KEY
?exchange=binance
&symbol=BTC/USDT
&timeframe=1h
{
"valueMACD": [142.83],
"valueMACDSignal": [98.21],
"valueMACDHist": [44.62],
"timestamp": [1718233200]
}
What is MACD?
MACD (Moving Average Convergence Divergence), developed by Gerald Appel, measures the relationship between two exponential moving averages of price — typically the 12-period and 26-period EMA. The MACD line is the difference between these two EMAs; the signal line is a 9-period EMA of the MACD line; the histogram shows the gap between them. Crossovers of the MACD line above or below the signal line are the primary trade signals; the histogram visualises momentum strength.
MACD trading strategies
MACD / signal line crossovers
When the MACD line crosses above the signal line, momentum is turning bullish. When it crosses below, momentum is turning bearish. These are the most widely watched MACD signals — programmable with a single comparison in your code.
Zero-line crossovers
MACD crossing above zero confirms the 12-period EMA has risen above the 26-period EMA — a shift to bullish medium-term momentum. Crossing below zero is the opposite. Zero-line crosses are slower but higher-conviction than signal-line crosses.
MACD divergence
Price makes a new high but MACD makes a lower high — bearish divergence, an early warning of a potential reversal. Combine with Volume Split and RSI for a three-indicator confirmation approach.
Customising MACD
The three parameters — 'fast' (default 12), 'slow' (default 26), and 'signal' (default 9) — control the two EMAs and the signal line period. The 12/26/9 defaults are the industry standard. Crypto traders sometimes use faster settings like 8/21/5 for more responsive signals on shorter timeframes.
See all parameters in the docs →Frequently asked questions
What does the MACD API return?
The MACD endpoint returns three values: 'valueMACD' (the MACD line), 'valueMACDSignal' (the signal line), and 'valueMACDHist' (the histogram — the difference between the MACD and signal lines).
What is a bullish MACD crossover?
A bullish crossover occurs when valueMACD crosses above valueMACDSignal. This signals that short-term momentum has turned positive relative to the longer-term trend. It is most significant when it occurs below the zero line.
What MACD settings work best for crypto?
The standard 12/26/9 works across most timeframes. For faster, more responsive signals on 1m–15m charts, try 8/21/5. For swing trading on the daily, the standard settings or slightly longer periods like 14/30/9 reduce noise.
Can I get historical MACD values?
Yes. Use the 'results' parameter to return MACD values across the past N candles, or 'backtrack' for a single historical candle. All three output values (MACD, signal, histogram) are returned for each candle.
Related indicators
Building with the MACD API?
The developer documentation covers the full technical reference: the /macd endpoint, every parameter, the response schema, rate limits, bulk queries and ready-to-run samples in Node.js, Python, PHP and cURL.
Ready to get started?
Request your free API key and pull MACD values for any market in minutes. 7-day free trial on all paid plans.
Get free API key