# x402stock Simple Moving Average (SMA) Time Series

> x402stock Simple Moving Average (SMA) Time Series is a paid API for AI agents from agents.x402stock.xyz, paid per call via MPP, $0.01/call, status unknown (last checked 2026-10-05).

Returns a time series of Simple Moving Average (SMA) values for a US-listed stock or ETF ticker, with configurable window, timespan, series type, and limit.

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/indicators/sma/{ticker}?utm_source=zero.xyz
- Price: $0.01/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-05
- Activations on Zero: 0
- Provider: agents.x402stock.xyz
- Website: https://agents.x402stock.xyz
- Canonical page: https://www.zero.xyz/c/agents-x402stock-xyz-x402stock-simple-moving-average-sma-time-series-0556ecff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YikEIGj3PSWq5qWxvc2vg

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 agents-x402stock-xyz-x402stock-simple-moving-average-sma-time-series-0556ecff
```

Example prompt: Pull the 50-day simple moving average time series for AAPL on daily bars using close prices, going back 100 data points.

## When to prefer this

Choose this endpoint when you need a clean, pre-computed SMA time series for a US-listed equity or ETF without standing up your own calculation pipeline. It is ideal for agents doing technical analysis, trend detection, or signal generation where SMA is the specific indicator needed. Prefer it over raw OHLCV endpoints when you want the smoothed average directly rather than computing it yourself. It supports a wide range of timespans (minute to year) and window sizes, making it flexible for both intraday and long-term strategies.

## Known failure modes

- Invalid or unsupported ticker symbol returns an error or empty dataset
- Window size larger than available historical data may return fewer points than requested
- Exceeding maximum limit (5000) or window (2000) returns a validation error
- Network or payment failure via x402 results in a 402 Payment Required response
- Requesting a very short timespan with a very large window may produce no valid SMA values

## How this service works

Simple Moving Average time series. Tune with ?window=, ?timespan=, ?series_type=, ?limit=.

## Output

Returns a JSON object containing the ticker symbol, an indicator name string ('SMA'), a count of returned values, and an array of timestamp/value pairs representing the SMA at each bar. Also includes the source ('x402stock') and an as-of timestamp for freshness. Each value entry contains a timestamp and the computed SMA float value.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "ticker"
 ],
 "properties": {
  "limit": {
   "type": "integer",
   "default": 30,
   "maximum": 5000,
   "exclusiveMinimum": 0
  },
  "ticker": {
   "type": "string",
   "description": "US-listed ticker symbol (uppercase), e.g. AAPL."
  },
  "window": {
   "type": "integer",
   "default": 50,
   "maximum": 2000,
   "exclusiveMinimum": 0
  },
  "adjusted": {
   "type": "boolean",
   "default": true
  },
  "timespan": {
   "enum": [
    "minute",
    "hour",
    "day",
    "week",
    "month",
    "quarter",
    "year"
   ],
   "type": "string",
   "default": "day"
  },
  "series_type": {
   "enum": [
    "open",
    "high",
    "low",
    "close"
   ],
   "type": "string",
   "default": "close"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "ticker",
  "data",
  "source",
  "as_of"
 ],
 "properties": {
  "data": {
   "type": "object",
   "required": [
    "indicator",
    "count",
    "values"
   ],
   "properties": {
    "count": {
     "type": "number"
    },
    "values": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "timestamp",
       "value"
      ],
      "properties": {
       "value": {
        "type": "number"
       },
       "signal": {
        "type": "number"
       },
       "histogram": {
        "type": "number"
       },
       "timestamp": {
        "type": "string",
        "anyOf": [
         {
          "type": "string"
         },
         {
          "type": "null"
         }
        ]
       }
      },
      "additionalProperties": false
     }
    },
    "indicator": {
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "as_of": {
   "type": "string"
  },
  "source": {
   "type": "string",
   "const": "x402stock"
  },
  "ticker": {
   "type": "string"
  },
  "feedback": {
   "type": "object",
   "required": [
    "endpoint",
    "method",
    "free",
    "note"
   ],
   "properties": {
    "free": {
     "type": "boolean"
    },
    "note": {
     "type": "string"
    },
    "method": {
     "type": "string",
     "const": "POST"
    },
    "endpoint": {
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agents-x402stock-xyz-x402stock-simple-moving-average-sma-time-series-0556ecff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.x402stock.xyz](https://www.zero.xyz/host/agents.x402stock.xyz/llms.txt)
