# Simple Moving Average (SMA) by Massive

> Simple Moving Average (SMA) by Massive is a paid API for AI agents from agent.massive.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Returns the simple moving average (SMA) values for a given stock ticker over a configurable time range, window size, and aggregate timespan.

## Facts

- Endpoint: GET https://agent.massive.com/v1/indicators/sma/:stockTicker
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/simple-moving-average-sma-by-massive-34624f60
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5HikOW7ShftsibUzDt1J8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability simple-moving-average-sma-by-massive-34624f60
```

Example prompt: Can you get me the 50-day simple moving average for AAPL using daily close prices, returning the last 30 data points in descending order?

## When to prefer this

Use this endpoint when you need smoothed price trend data for a stock using the classic simple moving average calculation. Prefer this over raw OHLC data when you want noise-reduced trend signals. Choose SMA over EMA (also available on this platform) when you want equal weighting across all periods in the window rather than recency-biased weighting. Ideal for technical analysis agents, charting workflows, or momentum detection pipelines.

## Known failure modes

- Invalid or unsupported ticker symbol returns an error or empty result
- Requesting data before a ticker's listing date returns no results
- Window size larger than available data may return sparse or no values
- Invalid timestamp format causes a query error
- Exceeding the maximum limit of 5000 returns a validation error
- Network or provider outage returns a 5xx error

## How this service works

Get the simple moving average (SMA) for a ticker symbol over a given time range. Can't find what you're looking for? POST feedback to /feedback, no charge.

## Output

Returns a time-ordered list of SMA data points, each containing the calculated SMA value and corresponding timestamp. Includes metadata such as the window size, timespan, and series type used. Supports pagination via limit and order parameters.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "stockTicker"
     ],
     "properties": {
      "stockTicker": {
       "type": "string",
       "description": "Specify a case-sensitive ticker symbol for which to get simple moving average (SMA) data. For example, AAPL represents Apple Inc."
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "limit": {
       "type": "integer",
       "default": 10,
       "maximum": 5000,
       "description": "Limit the number of results returned, default is 10 and max is 5000"
      },
      "order": {
       "enum": [
        "asc",
        "desc"
       ],
       "type": "string",
       "default": "desc",
       "description": "The order in which to return the results, ordered by timestamp."
      },
      "window": {
       "type": "integer",
       "default": 50,
       "description": "The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average."
      },
      "adjusted": {
       "type": "boolean",
       "default": true,
       "description": "Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits."
      },
      "timespan": {
       "enum": [
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
       ],
       "type": "string",
       "default": "day",
       "description": "The size of the aggregate time window."
      },
      "timestamp": {
       "type": "string",
       "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp."
      },
      "series_type": {
       "enum": [
        "open",
        "high",
        "low",
        "close"
       ],
       "type": "string",
       "default": "close",
       "description": "The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/simple-moving-average-sma-by-massive-34624f60/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.massive.com](https://www.zero.xyz/host/agent.massive.com/llms.txt)
