An exponential moving average weights recent prices more heavily than a simple average over the same window.
The EMA endpoint uses the same interval, series type, time period, and limit rules as SMA, but each body point exposes an EMA value instead of SMA. Send one ticker per request. This post documents the EMA path only.
To access this endpoint, you must obtain an API key: Get your API key
The Endpoint
GET /v1/markets/indicators/ema returns the exponential moving average for one ticker. The sample request is ticker=AAPL, interval=1d, series_type=close, time_period=50, and limit=50. Meta identifies the indicator as Exponential Moving Average (EMA).
Parameters
- ticker: Required. One ticker per request. The example is
AAPL. A comma-separated list is not accepted on this endpoint. - interval: Required. Same set as SMA:
1m— about 1 day5m— about 1 month15m— about 1 month30m— about 1 month1d— about 5 years1wk— about 5 years1mo— about 10 years3mo— about 10 years
- series_type: Use
open,close,high, orlow. The example usesclose. - time_period: The window length. The example is
50. - limit: How many points to return. The example is
50. The docs say the default limit is 50.
Python Example
The script requests a 50-period EMA on daily closes for AAPL and prints each timestamp and EMA. Send a Bearer token from your Mboum API key.
import requests
url = "https://api.mboum.com/v1/markets/indicators/ema"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {
"ticker": "AAPL",
"interval": "1d",
"series_type": "close",
"time_period": 50,
"limit": 50,
}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
payload = response.json()
for item in payload["body"]:
print(item["timestamp"], item["EMA"])
Understanding the Response
A successful response has meta and body. Meta includes the indicator name so you can confirm you hit EMA. Each body item has timestamp and EMA. The shortened example below is one point.
{
"meta": {
"symbol": "AAPL",
"interval": "1d",
"series_type": "close",
"indicator": "Exponential Moving Average (EMA)",
"time_period": 50
},
"body": [
{
"timestamp": 1700000000,
"EMA": 186.4
}
]
}
Iterate the body and print or store timestamp with EMA. Use meta to verify the interval and series type you intended. If you also call SMA with the same parameters, keep the response keys separate. SMA rows use SMA. EMA rows use EMA.
Key Fields
- symbol, interval, series_type, indicator, and time_period: Meta for the request. In the sample, the indicator is Exponential Moving Average (EMA), the symbol is
AAPL, the interval is1d, the series type isclose, and the time period is 50. - timestamp: The point’s time. The shortened example uses 1700000000.
- EMA: The exponential moving average at that timestamp. The shortened example uses 186.4. Do not read this key as
SMA.
Practical Use Cases
Comparing EMA with the same SMA inputs
Mirror a familiar SMA setup when you want a comparable EMA: ticker=AAPL, interval=1d, series_type=close, time_period=50, and limit=50. That keeps the window and candle size aligned. Check that meta indicator reads Exponential Moving Average (EMA), then print each timestamp and EMA.
One symbol per call
One ticker per request. A comma-separated list is rejected. If you need a shorter or longer history, change interval first, then decide whether time_period still matches the smoothing you want on that candle size.
Learn more or explore other endpoints: EMA indicator