# Stock Trends Historical Sector Leadership Rotation

> Stock Trends Historical Sector Leadership Rotation is a paid API for AI agents from api.stocktrends.com, paid per call via x402, $0.3/call, status unknown (last checked 2026-09-13).

Returns historical sector leadership rotation data including bullish share, average RSI, trend maturity, leadership score, and weekly rank derived from Stock Trends trend distribution and relative performance measures.

## Facts

- Endpoint: GET https://api.stocktrends.com/v1/leadership/rotation/history
- Price: $0.3/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-stocktrends-com-26079f02
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_abux7wsS42YuKVuq6p2nA

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 api-stocktrends-com-26079f02
```

Example prompt: Show me the historical sector leadership rotation on NASDAQ (Q) from January 1 2023 to December 31 2023, grouped by week, with the top 5 sectors and at least 25 constituents per sector.

## When to prefer this

Use this endpoint when you need historical perspective on which sectors led the market over time, want to study sector rotation patterns, or need to backtest strategies based on sector leadership trends. Prefer this over the current leadership endpoint when temporal analysis, backtesting, or multi-period comparison is required.

## Known failure modes

- Invalid date range (start after end) returns 400 error
- Exchange enum value not in allowed set (N, Q, A, B, T, I) returns validation error
- top_k exceeds maximum of 50 returns 400
- min_constituents exceeds 5000 returns 400
- No data available for the requested date range returns empty result set
- Payment not provided or insufficient USDC returns 402

## How this service works

Historical sector leadership rotation derived from Stock Trends trend distribution, relative performance, and trend maturity measures.

## Output

A time series of weekly sector leadership snapshots, each including the sector name, bullish share percentage, average RSI, trend maturity score, a composite leadership_score, and the sector's rank among peers — covering the requested date range and filtered by exchange and minimum constituent count.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "end": "2023-12-31",
   "type": "CS",
   "start": "2023-01-01",
   "top_k": 5,
   "exchange": "Q",
   "group_by_week": true,
   "min_constituents": 25
  }
 }
}
```

## 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": [],
     "properties": {
      "end": {
       "type": "string",
       "format": "date"
      },
      "type": {
       "type": "string",
       "default": "CS"
      },
      "limit": {
       "type": "integer",
       "default": 2000,
       "maximum": 50000,
       "minimum": 1
      },
      "start": {
       "type": "string",
       "format": "date"
      },
      "top_k": {
       "type": "integer",
       "default": 5,
       "maximum": 50,
       "minimum": 1
      },
      "exchange": {
       "enum": [
        "N",
        "Q",
        "A",
        "B",
        "T",
        "I"
       ],
       "type": "string"
      },
      "group_by_week": {
       "type": "boolean",
       "default": true
      },
      "min_constituents": {
       "type": "integer",
       "default": 25,
       "maximum": 5000,
       "minimum": 1
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "title": {
   "type": "string"
  },
  "family": {
   "type": "string"
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "format": {
     "type": "string"
    },
    "example": {}
   },
   "description": "Historical sector leadership rotation with bullish share, average RSI, trend maturity, leadership_score, and weekly rank.",
   "additionalProperties": true
  },
  "category": {
   "type": "string"
  },
  "schemaUrl": {
   "type": "string"
  },
  "description": {
   "type": "string"
  },
  "metadataUrl": {
   "type": "string"
  },
  "tools_manifest": {
   "type": "string"
  },
  "pricing_catalog": {
   "type": "string"
  }
 },
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-stocktrends-com-26079f02/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.stocktrends.com](https://www.zero.xyz/host/api.stocktrends.com/llms.txt)
