# Range Expansion & Contraction API
> The volatility-coiling setups breakout traders hunt, computed live from Yahoo Finance daily OHLC — no key, nothing stored. Markets do not trend or chop at random: tight-range days cluster and precede expansion, and the classic edge — Toby Crabel's NR7 (the narrowest daily range of the last seven), the inside day (a bar wholly inside the prior one) and the outside day (a bar that engulfs it) — is that a coiled spring releases. This API measures the coil and the release. For each instrument it returns today's range as a percentile of its recent range (low = contracted/coiling, high = already expanded), whether today is an NR7, NR4, inside or outside day, the average daily range, and the historical frequency of each setup. Crucially it also returns the follow-through: after an NR7, how often the next day broke the NR7 day's high or low and how often its range expanded — the base rate that tells you whether the coil is worth trading. The asset endpoint returns one instrument's full range profile; the screener endpoint ranks the universe by contraction (most coiled, lowest current range percentile — the breakout candidates) or by realised range. This is the range-contraction / NR7 breakout-setup cut — distinct from the candlestick-pattern API (named reversal/continuation shapes, not range size), the volatility dashboard (level, not the coil), and the gap and price APIs. It is the squeeze before the move.

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

## Pricing
- **Free** (Free) — 635 calls/Mo, 2 req/s
- **Starter** ($12/Mo) — 13,700 calls/Mo, 6 req/s
- **Pro** ($39/Mo) — 77,000 calls/Mo, 16 req/s
- **Mega** ($86/Mo) — 450,000 calls/Mo, 40 req/s

## Endpoints

### Screener

#### `GET /v1/screener` — Rank the universe by contraction, range or outside-day frequency

**Parameters:**
- `metric` (query, optional, string) — contraction, range or outside_freq Example: `contraction`
- `window` (query, optional, string) — Lookback in trading days (60-1000) Example: `252`
- `class` (query, optional, string) — index, sector, commodity, bond, stock or all Example: `all`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rangeexpansion-api/v1/screener?metric=contraction&window=252&class=all"
```

**Response:**
```json
{
    "data": {
        "note": "Ranked by contraction over window_days of daily OHLC. current_range_percentile places today's high-low range in its recent distribution: low = contracted/coiling (breakout candidate), high = already expanded. is_nr7 marks the narrowest range of the last seven days. Read fresh per call, nothing cached.",
        "class": "all",
        "count": 20,
        "metric": "contraction",
        "source": "Yahoo Finance",
        "results": [
            {
                "name": "Nvidia",
                "rank": 1,
                "class": "stock",
                "is_nr7": false,
                "symbol": "NVDA",
                "available": true,
                "avg_range_pct": 2.82,
                "is_inside_day": false,
                "is_outside_day": false,
                "current_range_pct": 2.99,
                "outside_day_freq_pct": 15.1,
                "current_range_percentile": 65.9
            },
            {
                "name": "Meta Platforms",
                "rank": 2,
                "class": "stock",
                "is_nr7": false,
                "symbol": "META",
                "available": true,
                "avg_range_pct": 2.38,
                "is_inside_day": false,
                "is_outside_day": false,
                "current_range_pct": 2.67,
                "outside_day_freq_pct": 8.8,
                "current_range_percentile": 72.2
            },
            {
                "name": "Financials Sec
…(truncated, see openapi.json for full schema)
```

### Asset

#### `GET /v1/asset` — Full range profile with NR7/inside/outside flags and NR7 follow-through

**Parameters:**
- `symbol` (query, required, string) — Universe symbol Example: `SPY`
- `window` (query, optional, string) — Lookback in trading days (60-1000) Example: `252`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rangeexpansion-api/v1/asset?symbol=SPY&window=252"
```

**Response:**
```json
{
    "data": {
        "name": "S&P 500 ETF",
        "note": "Daily range = high - low. current_range_percentile is today's range within the window. NR7/NR4 = narrowest range of the last 7/4 days; inside/outside days compare the band to the prior bar. nr7_breakout_rate = share of NR7 days whose next day broke the NR7 high or low (>=5 samples or null). Read fresh per call, nothing cached.",
        "class": "index",
        "reads": {
            "setup": "outside day — range engulfed yesterday's, volatility expanding",
            "state": "expanded — wide range day, move may be exhausting",
            "nr7_edge": "after an NR7, the next day broke its high or low 100% of the time historically"
        },
        "today": {
            "is_nr4": false,
            "is_nr7": false,
            "is_inside_day": false,
            "is_outside_day": true
        },
        "source": "Yahoo Finance",
        "symbol": "SPY",
        "window_days": 252,
        "nr4_freq_pct": 28.9,
        "nr7_freq_pct": 17.9,
        "observations": 252,
        "avg_range_pct": 0.94,
        "current_range_pct": 2.11,
        "nr7_follow_samples": 44,
        "inside_day_freq_pct": 8,
        "outside_day_freq_pct": 11.2,
        "nr7_breakout_rate_pct": 100,
        "nr7_expansion_rate_pct": 75,
        "current_range_percentile": 97.6
    },
    "meta": {
        "timestamp": "2026-06-12T10:34:42.147Z",
        "request_id": "1b424293-67ef-496f-bc6b-35d247997b01"
    },
    "status": "o
…(truncated, see openapi.json for full schema)
```

### Universe

#### `GET /v1/universe` — The universe and its classes

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

**Response:**
```json
{
    "data": {
        "note": "The universe the screener ranks — liquid index/sector/commodity/bond ETFs and large-cap stocks. Pass class= to a screener call to rank within one class.",
        "count": 20,
        "assets": [
            {
                "name": "S&P 500 ETF",
                "class": "index",
                "symbol": "SPY"
            },
            {
                "name": "Nasdaq 100 ETF",
                "class": "index",
                "symbol": "QQQ"
            },
            {
                "name": "Russell 2000 ETF",
                "class": "index",
                "symbol": "IWM"
            },
            {
                "name": "Dow Jones ETF",
                "class": "index",
                "symbol": "DIA"
            },
            {
                "name": "Technology Sector",
                "class": "sector",
                "symbol": "XLK"
            },
            {
                "name": "Financials Sector",
                "class": "sector",
                "symbol": "XLF"
            },
            {
                "name": "Energy Sector",
                "class": "sector",
                "symbol": "XLE"
            },
            {
                "name": "Gold ETF",
                "class": "commodity",
                "symbol": "GLD"
            },
            {
                "name": "Silver ETF",
                "class": "commodity",
                "symbol": "SLV"
            },
            {
                "n
…(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/rangeexpansion-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "metric is contraction (default, most coiled first), range or outside_freq. window is 60-1000 trading days (default 252). class filters to index/sector/commodity/bond/stock (default all). NR7 = narrowest daily range of the last 7 days; inside/outside days compare to the prior bar. Read fresh per call, nothing cached.",
        "source": "Yahoo Finance daily OHLC, live",
        "classes": [
            "index",
            "sector",
            "commodity",
            "bond",
            "stock"
        ],
        "metrics": [
            "contraction",
            "range",
            "outside_freq"
        ],
        "service": "rangeexpansion-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/asset": "Full range profile with NR7/inside/outside flags and NR7 follow-through (symbol=SPY, window=252).",
            "GET /v1/screener": "Rank the universe by contraction, range or outside-day frequency (metric=contraction, window=252, class=all).",
            "GET /v1/universe": "The universe and its classes."
        },
        "description": "Range expansion & contraction — the volatility-coiling setups breakout traders hunt, live from Yahoo Finance daily OHLC (no key, nothing stored). For each instrument it returns today's range as a percentile of its recent range (low = coiling), whether today is an NR7/NR4, inside or outside day, the average daily range, the frequency of each setup, and the foll
…(truncated, see openapi.json for full schema)
```


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