MACD is the Moving Average Convergence/Divergence indicator you use when you need the MACD line, the signal line, and the histogram for one ticker on a shared timestamp grid.
This guide covers GET /v1/markets/indicators/macd only. Send one ticker per request. There is no time_period parameter on MACD. You set fast_period, slow_period, and signal_period instead.
To access this endpoint, you must obtain an API key: Get your API key
The Endpoint
Method: GET
Endpoint: https://api.mboum.com/v1/markets/indicators/macd
Documentation: MACD indicator
The sample request uses daily closes with fast_period=12, slow_period=26, signal_period=9, and limit=50 for ticker=AAPL. That combination is enough to confirm the three output keys and the meta fields.
Parameters
- ticker: Required. One ticker per request. The example is
AAPL. If you need another name, make a second request. - interval:
1m,5m,15m,30m,1d,1wk,1mo, or3mo. Documented ranges:1mabout 1 day;5m,15m, and30mabout 1 month;1dand1wkabout 5 years;1moand3moabout 10 years. The example uses1d. Intraday intervals cover a shorter window than daily or weekly. - series_type:
open,close,high, orlow. The example usesclose. Match it to the price series you actually chart. - fast_period: Example
12. There is notime_periodon this endpoint. - slow_period: Example
26. - signal_period: Example
9. Period control is only throughfast_period,slow_period, andsignal_period. - limit: Example
50. The docs default is 50. Raise or lower it only after the first page of points parses cleanly.
Python Example
The script requests MACD for AAPL on daily closes and prints timestamp, MACD, MACD_Signal, and MACD_Hist for the first few points. Send a Bearer token from your Mboum API key.
import requests
url = "https://api.mboum.com/v1/markets/indicators/macd"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {
"ticker": "AAPL",
"interval": "1d",
"series_type": "close",
"fast_period": "12",
"slow_period": "26",
"signal_period": "9",
"limit": "50",
}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
for point in response.json().get("body", [])[:5]:
print(point["timestamp"], point["MACD"], point["MACD_Signal"], point["MACD_Hist"])
Understanding the Response
A successful response has meta and body. The indicator label is Moving Average Convergence/Divergence (MACD). body is a list. The shortened example below shows the key names. Values in the body item are placeholders for shape only.
{
"meta": {
"symbol": "AAPL",
"interval": "1d",
"series_type": "close",
"indicator": "Moving Average Convergence/Divergence (MACD)",
"fast_period": 12,
"slow_period": 26,
"signal_period": 9
},
"body": [
{
"timestamp": "...",
"MACD": "...",
"MACD_Signal": "...",
"MACD_Hist": "..."
}
]
}
Read timestamp, MACD, MACD_Signal, and MACD_Hist together so the histogram stays aligned with the two lines on the same timestamp. When you store rows, keep the key names exactly as returned.
Key Fields
- symbol, interval, series_type, and indicator: Meta for the request. The sample indicator is Moving Average Convergence/Divergence (MACD), the symbol is
AAPL, the interval is1d, and the series type isclose. - fast_period, slow_period, and signal_period: The period trio echoed in meta. The sample uses 12, 26, and 9. This endpoint does not return a
time_periodfield. - timestamp, MACD, and MACD_Signal: The shared time plus the MACD line and the signal line. Keep those key names as returned.
- MACD_Hist: The histogram. Read it next to
MACDandMACD_Signal. Do not rename those keys.
Practical Use Cases
Reading the three series together
Call the endpoint with ticker=AAPL, interval=1d, series_type=close, fast_period=12, slow_period=26, signal_period=9, and limit=50. Confirm meta.indicator and the three period fields match what you sent. Print timestamp, MACD, MACD_Signal, and MACD_Hist for the first few body items and plot or store them without renaming keys.
Changing the chart settings
Once the three series parse on daily closes, change interval or the period trio only when your chart settings change. Keep one ticker per request. Pick interval with the documented history ranges in mind.
Learn more or explore other endpoints: MACD indicator