# x402stock.xyz MACD Indicator

> x402stock.xyz MACD 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-14).

Returns MACD (Moving Average Convergence Divergence) technical indicator values for a given stock ticker, including histogram and signal line data.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/indicators/macd/AAPL
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-xyz-d1c1e49e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jt4hEsNe2ekrLzC3xtP-k

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-xyz-d1c1e49e
```

Example prompt: Can you pull the MACD for AAPL using daily close prices with standard 12/26/9 windows, adjusted for splits, and give me the last 30 data points?

## When to prefer this

Use this endpoint when you need MACD technical indicator data for US-listed equities and want configurable short/long/signal windows plus multiple timespans. Prefer this over raw price APIs when the goal is momentum or trend analysis without computing the indicator yourself.

## Known failure modes

- Invalid or unknown ticker symbol returns empty data or 404
- Unsupported timespan enum value returns validation error
- window parameters exceeding maximum of 2000 return error
- Insufficient historical data for the requested window sizes yields fewer results than limit
- Payment failure (402) if USDC balance is insufficient

## How this service works

MACD time series with value, signal line, and histogram. Tune with `?short_window=`, `?long_window=`, `?signal_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

Returns a JSON object with the ticker symbol, source, as-of date, and a data block containing the indicator name ('MACD'), count of values, and an array of timestamped MACD entries each with value (MACD line), signal, and histogram fields.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "limit": 30,
   "adjusted": true,
   "timespan": "day",
   "long_window": 26,
   "series_type": "close",
   "short_window": 12,
   "signal_window": 9
  }
 }
}
```

## 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",
      "series_type",
      "adjusted",
      "short_window",
      "long_window",
      "signal_window",
      "limit"
     ],
     "properties": {
      "limit": {
       "type": "integer",
       "default": 30,
       "maximum": 5000,
       "exclusiveMinimum": 0
      },
      "adjusted": {
       "type": "boolean",
       "default": true
      },
      "timespan": {
       "enum": [
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
       ],
       "type": "string",
       "default": "day"
      },
      "long_window": {
       "type": "integer",
       "default": 26,
       "maximum": 2000,
       "exclusiveMinimum": 0
      },
      "series_type": {
       "enum": [
        "open",
        "high",
        "low",
        "close"
       ],
       "type": "string",
       "default": "close"
      },
      "short_window": {
       "type": "integer",
       "default": 12,
       "maximum": 2000,
       "exclusiveMinimum": 0
      },
      "signal_window": {
       "type": "integer",
       "default": 9,
       "maximum": 2000,
       "exclusiveMinimum": 0
      }
     },
     "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"
  
… (truncated)
```

## More

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