# Relative Strength vs S&P 500 API
> Which markets are beating the benchmark and which are lagging, ranked, computed live from Yahoo Finance (no key, nothing stored). Relative strength is the engine of rotation: money flows toward what is outperforming, and the leaders of one quarter often lead the next. For a cross-asset, cross-sector universe — the eleven S&P 500 sectors plus small caps, international and emerging equities, gold, oil, commodities, bonds and crypto — this measures each asset's return MINUS the S&P 500's over one, three and six months, blends them into a relative-strength score, and ranks the whole board into leaders and laggards. A positive score means the asset is beating the market; a negative one means it is lagging. The ranking endpoint returns that ranked board with the benchmark's own return and the standout leaders and laggards. The asset endpoint returns one market's relative strength across each window, its beta to the S&P 500 and whether its relative strength is improving or fading. The universe endpoint lists what is covered. The relative-strength / market-leadership rotation cut — distinct from the absolute-momentum, the sector-correlation and the altcoin-season APIs. It answers what is leading the market, measured against it.

## 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/relativestrength-api/..."
```

## Pricing
- **Free** (Free) — 710 calls/Mo, 2 req/s
- **Starter** ($11/Mo) — 16,300 calls/Mo, 6 req/s
- **Pro** ($33/Mo) — 88,500 calls/Mo, 16 req/s
- **Business** ($76/Mo) — 478,000 calls/Mo, 40 req/s

## Endpoints

### Ranking

#### `GET /v1/ranking` — Cross-asset board ranked by relative strength vs the S&P 500 with leaders/laggards

**Parameters:**
- `class` (query, optional, string) — Filter by class: equities, sector, commodities, bonds, crypto Example: `sector`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/relativestrength-api/v1/ranking?class=sector"
```

### Asset

#### `GET /v1/asset` — One market relative strength per window + beta + improving/fading

**Parameters:**
- `asset` (query, required, string) — Asset key (see /v1/universe) Example: `technology`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/relativestrength-api/v1/asset?asset=technology"
```

### Universe

#### `GET /v1/universe` — Supported instruments

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

### Meta

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

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


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