# x402stock SMA Indicator

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

Returns Simple Moving Average (SMA) values for a given stock ticker over a configurable timespan, window, and price series type.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/indicators/sma/%7Bticker%7D
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-08
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-sma-indicator-76a6dd51
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9ZPr6mNCXnWjOzTtB3VSp

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-76a6dd51
```

Example prompt: What's the 50-day simple moving average for AAPL using daily closing prices? Give me the last 30 data points.

## When to prefer this

Use this endpoint when you need Simple Moving Average technical indicator data for US stocks or ETFs without setting up an API key or subscription. It is ideal for AI agents doing technical analysis, trend detection, or signal generation on a pay-per-call basis using USDC on Base.

## Known failure modes

- Invalid or unsupported ticker symbol returns an error or empty data
- Window size exceeding maximum of 2000 returns a validation error
- Limit exceeding 5000 returns a validation error
- Unsupported timespan or series_type enum value returns a 400-level error
- Payment failure via x402/USDC results in a 402 Payment Required response
- Insufficient historical data for the requested window may return fewer values than expected

## How this service works

Pay-per-call market and economic data API for AI agents: US stocks, ETFs and options, forex, crypto and on-chain perps, energy commodities, US and global macro (Fed, CPI, jobs, GDP, Treasury, World Bank), SEC filings, congressional trades, and market sentiment. No API keys, no accounts. Pay per request in USDC via x402 on Base.

## Output

A JSON object containing the ticker symbol, indicator name ('sma'), a count of returned values, an array of timestamp/value pairs representing historical SMA readings, the data source ('x402stock'), and an as-of timestamp.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "pathParams": {
   "ticker": "AAPL"
  },
  "queryParams": {
   "limit": 30,
   "window": 50,
   "adjusted": true,
   "timespan": "day",
   "series_type": "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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "timespan",
      "window",
      "series_type",
      "adjusted",
      "limit"
     ],
     "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
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "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": {
            "anyOf": [
             {
              "type": 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "count": 2,
   "values": [
    {
     "value": 275.2846,
     "timestamp": "2026-05-28T12:00:00.000Z"
    },
    {
     "value": 274.0422,
     "timestamp": "2026-05-27T12:00:00.000Z"
    }
   ],
   "indicator": "sma"
  },
  "as_of": "2026-05-28T12:00:00.000Z",
  "source": "x402stock",
  "ticker": "AAPL"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-sma-indicator-76a6dd51/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402stock.xyz](https://www.zero.xyz/host/x402stock.xyz/llms.txt)
