# Simple Moving Average (SMA) Technical Indicator

> Simple Moving Average (SMA) Technical Indicator is a paid API for AI agents from marketdata.use.x402atlas.com, paid per call via x402, $0.015/call, status unknown (last checked 2026-09-15).

Returns SMA trend-smoothing values for any stock, crypto, forex, or options ticker over a configurable lookback window and timespan.

## Facts

- Endpoint: GET https://marketdata.use.x402atlas.com/sma
- Price: $0.015/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-technical-indicator-c3524300
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b7dH_qHrJ_Li-RYXXPQt9

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-technical-indicator-c3524300
```

Example prompt: What's the 50-day simple moving average for AAPL using the daily close price — give me the last 30 data points in descending order.

## When to prefer this

Use this endpoint when you need trend-smoothing analysis via SMA for any supported asset class (stocks, crypto, forex, options). Prefer this over raw OHLC endpoints when you want pre-computed moving averages rather than raw candlestick data. Choose this over RSI when the user needs trend direction rather than momentum/overbought-oversold signals.

## Known failure modes

- Missing required 'ticker' parameter returns 400 validation error
- Invalid ticker symbol returns empty results or 404
- Window size outside valid range causes parameter error
- Payment not provided or insufficient USDC balance returns 402 Payment Required
- Timespan value not in allowed enum causes rejection
- Limit value outside 1-5000 range causes validation error

## How this service works

Simple Moving Average (SMA) technical indicator for any ticker — trend-smoothing analytics for stocks, crypto, forex and options.

## Output

A time series of SMA values computed over the specified window size and timespan for the given ticker, returned as an array of timestamp-value pairs. Includes computed moving average readings based on the chosen series type (open, high, low, or close).

## 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"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "ticker"
     ],
     "properties": {
      "limit": {
       "type": "integer",
       "maximum": 50000,
       "minimum": 1,
       "description": "Max points returned"
      },
      "order": {
       "enum": [
        "asc",
        "desc"
       ],
       "type": "string",
       "description": "Result ordering"
      },
      "ticker": {
       "type": "string",
       "description": "Asset-prefixed ticker, e.g. AAPL, X:BTCUSD"
      },
      "window": {
       "type": "integer",
       "maximum": 50000,
       "minimum": 1,
       "description": "Lookback window size"
      },
      "timespan": {
       "enum": [
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
       ],
       "type": "string",
       "description": "Aggregate window unit used to compute the indicator"
      },
      "series_type": {
       "enum": [
        "open",
        "high",
        "low",
        "close"
       ],
       "type": "string",
       "description": "Price field used to compute the indicator"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "queried_at",
      "ticker",
      "indicator",
      "points"
     ],
     "properties": {
      "points": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "time",
         "value"
        ],
        "properties": {
         "time": {
          "type": "string",
          "format": "date-time",
          "description": "Reading timestamp."
         },
         "value": {
          "type": "number",
          "description": "Indicator value."
         }
        }
       },
       "description": "Normalized indicator readings, oldest or newest first per `order`."
      },
      "ticker": {
       "type": "string",
       "description": "Echo of the requested ticker."
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "points": [
   {
    "time": "2024-01-02T00:00:00Z",
    "value": 182.34
   }
  ],
  "ticker": "AAPL",
  "indicator": "sma",
  "queried_at": "2024-01-02T12:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/simple-moving-average-sma-technical-indicator-c3524300/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from marketdata.use.x402atlas.com](https://www.zero.xyz/host/marketdata.use.x402atlas.com/llms.txt)
