# x402stock SMA Indicator

> x402stock SMA Indicator is a paid API for AI agents from agents.x402stock.xyz, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-27).

Returns a Simple Moving Average (SMA) time series for a given stock ticker, configurable by window size, timespan, series type, and result limit.

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/indicators/sma/:ticker?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-sma-indicator-2c489103
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GZ9qcSuz7BwQUojU-_QdT

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 x402stock-sma-indicator-2c489103
```

Example prompt: What's the 50-day simple moving average on AAPL's daily close prices for the last 60 data points?

## When to prefer this

Choose this endpoint when you need a ready-computed SMA time series without building your own OHLCV pipeline — ideal for technical analysis tasks where you need moving average values quickly, pay per call with no API key, and want configurable window/timespan/series_type tuning. Prefer this over raw OHLCV endpoints when the downstream task only needs smoothed price signals rather than raw candles.

## Known failure modes

- Invalid or unsupported ticker symbol returns an error or empty result
- Window or limit value outside allowed range (0 < window ≤ 2000, 0 < limit ≤ 5000) returns a validation error
- Unsupported timespan or series_type enum value returns a 400 error
- Payment not fulfilled via x402/USDC results in a 402 Payment Required response
- Insufficient historical data for the requested window/timespan combination may return fewer points than expected

## How this service works

Simple Moving Average time series. Tune with `?window=`, `?timespan=`, `?series_type=`, `?limit=`. From x402stock, a pay-per-call market & economic data API for AI agents. No API key or account; pay in USDC via x402.

## Output

An array of timestamped SMA data points for the requested ticker, computed over the specified window and timespan on the chosen price series (open, high, low, or close). Each entry contains a timestamp and the SMA value for that period.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "ticker": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "limit": {
       "type": "integer",
       "default": 30,
       "maximum": 5000,
       "exclusiveMinimum": 0
      },
      "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"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-sma-indicator-2c489103/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)
