An EMA never fully forgets an old price, it just gives it less and less weight as newer bars arrive. That is the difference from a simple moving average, which drops a price entirely once it falls out of the window. Massive's ema endpoint does the arithmetic server-side from a ticker, a timespan and a window.
Applies to
- Plans: every plan, including the free Basic tier.
- Endpoints: /v1/indicators/ema/{ticker}, with timespan and window.
- Asset classes: stocks, options, indices, forex and crypto, using that asset class's ticker format.
How to call it
curl -X GET "https://api.massive.com/v1/indicators/ema/AAPL?timespan=day&window=14&limit=1&apiKey=YOUR_API_KEY"
Response
{
"results": {
"values": [
{ "timestamp": 1789012800000, "value": 318.7208330253207 }
]
},
"status": "OK"
}
timespan is the bar size the indicator is computed on, and window is how many of those bars it looks back over. A 14 on a day timespan and a 14 on a minute timespan are entirely different indicators.
How to read it
Compared with a simple average of the same window it turns sooner when the price changes direction, at the cost of reacting to moves that turn out to be noise. Which of those you want is the whole reason both exist.
Choosing a window
A shorter window reacts sooner and produces more signals, most of which are noise; a longer one is steadier and later. There is no correct value, and the common choices are conventions rather than findings. Pick the window from the horizon you actually trade or analyze on, and use the same one consistently rather than tuning it until the history looks good, which is the quickest route to a result that does not repeat.
If you see an error
An empty values array usually means you asked for fewer bars than the window needs. The indicator cannot produce its first point until window bars have closed.
A jump on a single date is usually a stock split rather than the market. Bars are split-adjusted by default, so mixing adjusted and unadjusted history will show up here.
{"status":"NOT_AUTHORIZED"} is about the asset class rather than the indicator: it follows the same subscription as the bars underneath.

