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

**Response:**
```json
{
    "data": {
        "note": "Relative strength = asset return minus the S&P 500's return over 1, 3 and 6 months; rs_score blends them. Positive = beating the market (a leader); negative = lagging. Ranked by rs_score, leaders first. rs_trend improving = short-term RS above longer-term (gaining leadership).",
        "class": "sector",
        "assets": [
            {
                "key": "technology",
                "rank": 1,
                "class": "sector",
                "label": "Technology",
                "rs_pct": {
                    "1m": 4.63,
                    "3m": 22.15,
                    "6m": 15.76
                },
                "rs_score": 14.18,
                "rs_trend": "fading"
            },
            {
                "key": "energy",
                "rank": 2,
                "class": "sector",
                "label": "Energy",
                "rs_pct": {
                    "1m": -0.72,
                    "3m": -11.44,
                    "6m": 16.98
                },
                "rs_score": 1.61,
                "rs_trend": "improving"
            },
            {
                "key": "industrials",
                "rank": 3,
                "class": "sector",
                "label": "Industrials",
                "rs_pct": {
                    "1m": 0.52,
                    "3m": -4.77,
                    "6m": 6.27
                },
                "rs_score": 0.67,
                "rs_trend": "improving"
       
…(truncated, see openapi.json for full schema)
```

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

**Response:**
```json
{
    "data": {
        "key": "technology",
        "note": "Relative strength = asset return minus the S&P 500's return over 1, 3 and 6 months; rs_score blends them. Positive = beating the market (a leader); negative = lagging. beta_to_sp500 shows how much it amplifies market moves.",
        "read": "outperforming the market",
        "class": "sector",
        "label": "Technology",
        "rs_pct": {
            "1m": 4.63,
            "3m": 22.15,
            "6m": 15.76
        },
        "source": "Yahoo Finance",
        "symbol": "XLK",
        "rs_score": 14.18,
        "rs_trend": "fading",
        "benchmark": "S&P 500",
        "beta_to_sp500": 1.598
    },
    "meta": {
        "timestamp": "2026-06-12T10:35:10.233Z",
        "request_id": "5c74191d-59b8-47b3-9348-5410f6fbd5dd"
    },
    "status": "ok",
    "message": "Asset relative strength retrieved successfully",
    "success": true
}
```

### Universe

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

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

**Response:**
```json
{
    "data": {
        "note": "Supported instruments, all measured against the S&P 500. Pass key as asset= to /v1/asset, class= to /v1/ranking.",
        "count": 23,
        "assets": [
            {
                "key": "nasdaq100",
                "class": "equities",
                "label": "Nasdaq 100",
                "symbol": "QQQ"
            },
            {
                "key": "small_caps",
                "class": "equities",
                "label": "US Small Caps",
                "symbol": "IWM"
            },
            {
                "key": "developed_intl",
                "class": "equities",
                "label": "Developed ex-US",
                "symbol": "EFA"
            },
            {
                "key": "emerging",
                "class": "equities",
                "label": "Emerging Markets",
                "symbol": "EEM"
            },
            {
                "key": "technology",
                "class": "sector",
                "label": "Technology",
                "symbol": "XLK"
            },
            {
                "key": "financials",
                "class": "sector",
                "label": "Financials",
                "symbol": "XLF"
            },
            {
                "key": "energy",
                "class": "sector",
                "label": "Energy",
                "symbol": "XLE"
            },
            {
                "key": "health_care",
                "class": "sector",
     
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "ranking class= filters by class. asset= is a supported key (see /v1/universe). Relative strength = excess return over SPY over 1/3/6 months. Read fresh per call, nothing cached.",
        "source": "Yahoo Finance daily closes (1y range) vs SPY benchmark, live",
        "classes": [
            "equities",
            "sector",
            "commodities",
            "bonds",
            "crypto"
        ],
        "service": "relativestrength-api",
        "benchmark": "S&P 500",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/asset": "One market's relative strength per window + beta + improving/fading (asset=technology).",
            "GET /v1/ranking": "Cross-asset board ranked by relative strength vs the S&P 500 with leaders/laggards (class=sector optional).",
            "GET /v1/universe": "The supported instruments."
        },
        "description": "Relative strength vs S&P 500 — which markets are beating the benchmark and which are lagging, ranked, live from Yahoo Finance (no key, nothing stored). ranking returns a cross-asset, cross-sector board ranked by relative strength (excess return over the S&P 500 blended across 1/3/6 months) with leaders and laggards. asset returns one market's relative strength per window, its beta to the S&P 500 and whether its RS is improving or fading. universe lists what is covered. The relative-strength / market-leadership rotation cut — distinct from the abs
…(truncated, see openapi.json for full schema)
```


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