# x402stock MACD Indicator API

> x402stock MACD Indicator API 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 MACD (Moving Average Convergence Divergence) technical indicator values for a given ticker symbol, including MACD line, signal line, and histogram.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/indicators/macd/%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-macd-indicator-api-e0ad4a61
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Wsx25-oRZLPKc0grdf1Aw

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-macd-indicator-api-e0ad4a61
```

Example prompt: Can you get the MACD indicator for AAPL using daily close prices, with short window 12, long window 26, and signal window 9, for the last 30 bars?

## When to prefer this

Use this endpoint when you need MACD technical analysis data for stocks, ETFs, forex, or crypto without managing API keys or subscriptions — paying only $0.01 USDC per call via x402 on Base. Prefer it over other technical indicator APIs when you need pay-per-use access or are building autonomous AI agents that self-fund API calls.

## Known failure modes

- Invalid or unsupported ticker returns an error or empty data array
- Payment not made via x402 results in 402 Payment Required response
- Invalid timespan or series_type enum value returns a 400 validation error
- Window parameters out of allowed range return a 400 error
- Network timeout or upstream data unavailability returns 5xx error

## 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, source, as_of timestamp, and a data block with the indicator name ('macd'), count of returned values, and an array of value objects each containing a timestamp, MACD value, signal line value, and histogram value.

## 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)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "count": 1,
   "values": [
    {
     "value": 10.3904,
     "signal": 9.7754,
     "histogram": 0.615,
     "timestamp": "2026-05-28T12:00:00.000Z"
    }
   ],
   "indicator": "macd"
  },
  "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-macd-indicator-api-e0ad4a61/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)
