# Stock Sector Correlation Matrix API
> How the eleven S&P 500 sectors move together, computed live from Yahoo Finance via the SPDR sector ETFs (no key, nothing stored). Sector correlation is the heart of equity diversification and rotation: defensives (utilities, staples, health care) and cyclicals (tech, discretionary, financials, energy) cluster differently, and when correlations rise the whole market is moving as one (risk-on/risk-off), while a spread of correlations means stock-picking and rotation are rewarded. The matrix endpoint returns the full pairwise return-correlation matrix across all eleven sectors with the most- and least-correlated sector pairs. The sector endpoint returns one sector's correlation to every other, ranked, plus its beta to the S&P 500 (how much it amplifies the market). The sectors endpoint lists what is covered. The equity sector correlation / rotation cut — distinct from the cross-asset correlation matrix (asset classes, not sectors), the crypto and currency correlation APIs (other markets) and the sector price/performance feed. It answers which sectors are the same bet and which diversify, within the stock market.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/sectorcorrelation-api/..."
```

## Pricing
- **Free** (Free) — 720 calls/Mo, 2 req/s
- **Starter** ($11/Mo) — 16,700 calls/Mo, 6 req/s
- **Pro** ($33/Mo) — 87,500 calls/Mo, 16 req/s
- **Business** ($75/Mo) — 476,000 calls/Mo, 40 req/s

## Endpoints

### Matrix

#### `GET /v1/matrix` — Full 11x11 sector correlation matrix with most/least correlated pairs

**Parameters:**
- `window` (query, optional, string) — Lookback in days (20-365) Example: `90`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sectorcorrelation-api/v1/matrix?window=90"
```

### Sector

#### `GET /v1/sector` — One sector correlations to all others, ranked, with beta to S&P 500

**Parameters:**
- `sector` (query, required, string) — Sector key (see /v1/sectors) Example: `technology`
- `window` (query, optional, string) — Lookback in days (20-365) Example: `90`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sectorcorrelation-api/v1/sector?sector=technology&window=90"
```

### Sectors

#### `GET /v1/sectors` — The eleven S&P 500 sectors

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sectorcorrelation-api/v1/sectors"
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sectorcorrelation-api/v1/meta"
```


---
Marketplace page: https://www.oanor.com/api/sectorcorrelation-api
OpenAPI spec: https://www.oanor.com/api/sectorcorrelation-api/openapi.json
