# Opening Gap Statistics API
> The overnight-gap behaviour day-traders actually trade, computed live from Yahoo Finance daily OHLC — no key, nothing stored. A gap is the jump between yesterday's close and today's open — the move that happens while the market is shut, on overnight news and futures drift. Traders live and die on two questions: how often does a name gap, and does the gap fill (price retraces to yesterday's close) or run (it keeps going). This API answers both with hard frequencies. For each instrument it returns how often it gaps up and down beyond a configurable threshold, the average size of up- and down-gaps, the gap-fill rate (the share of gaps where price traded back through the prior close intraday — for an up-gap, the day's low reaching the prior close), and the continuation rate (how often the day closes in the direction of the gap rather than fading it), plus the largest recent gaps. The asset endpoint returns one instrument's full gap profile with its biggest recent gaps; the screener endpoint ranks a universe of liquid stocks and ETFs by gappiness or gap-fill rate, surfacing the names that gap most and the ones whose gaps reliably fill. This is the opening-gap / overnight-jump microstructure cut — distinct from the price, candlestick-pattern, volatility and risk APIs in the catalogue. It is what happens between the close and the open.

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

## Pricing
- **Free** (Free) — 660 calls/Mo, 2 req/s
- **Starter** ($11/Mo) — 14,900 calls/Mo, 6 req/s
- **Pro** ($36/Mo) — 82,500 calls/Mo, 16 req/s
- **Mega** ($83/Mo) — 470,000 calls/Mo, 40 req/s

## Endpoints

### Screener

#### `GET /v1/screener` — Rank the universe by gap metric

**Parameters:**
- `metric` (query, optional, string) — gap_frequency, fill_rate, avg_gap or continuation Example: `gap_frequency`
- `threshold` (query, optional, string) — Gap-size cutoff in percent (0.1-5) Example: `0.5`
- `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/gapstats-api/v1/screener?metric=gap_frequency&threshold=0.5&window=252&class=all"
```

**Response:**
```json
{
    "data": {
        "note": "Ranked by gap_frequency over window_days of daily OHLC. A gap is the open vs the prior close beyond gap_threshold_pct (default 0.5%). gap_fill_rate = share of gaps where the day traded back through the prior close; continuation_rate = share that closed in the gap's direction. Read fresh per call, nothing cached.",
        "class": "all",
        "count": 20,
        "metric": "gap_frequency",
        "source": "Yahoo Finance",
        "results": [
            {
                "name": "AMD",
                "rank": 1,
                "class": "stock",
                "symbol": "AMD",
                "gap_days": 196,
                "available": true,
                "trading_days": 252,
                "avg_up_gap_pct": 2.46,
                "avg_abs_gap_pct": 2.31,
                "avg_down_gap_pct": -2.1,
                "gap_fill_rate_pct": 51,
                "gap_frequency_pct": 77.8,
                "up_gap_fill_rate_pct": 46,
                "up_gap_frequency_pct": 44.8,
                "continuation_rate_pct": 51,
                "down_gap_fill_rate_pct": 57.8,
                "down_gap_frequency_pct": 32.9
            },
            {
                "name": "Crude Oil ETF",
                "rank": 2,
                "class": "commodity",
                "symbol": "USO",
                "gap_days": 188,
                "available": true,
                "trading_days": 252,
                "avg_up_gap_pct": 2.2,
                "avg_a
…(truncated, see openapi.json for full schema)
```

### Asset

#### `GET /v1/asset` — Full gap profile of one instrument with largest recent gaps

**Parameters:**
- `symbol` (query, required, string) — Universe symbol Example: `TSLA`
- `threshold` (query, optional, string) — Gap-size cutoff in percent (0.1-5) Example: `0.5`
- `window` (query, optional, string) — Lookback in trading days (60-1000) Example: `252`

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

**Response:**
```json
{
    "data": {
        "name": "Tesla",
        "note": "Gap = open vs prior close beyond gap_threshold_pct (default 0.5%). gap_fill_rate = day traded back through the prior close; continuation_rate = closed in the gap's direction. largest_gaps lists the five biggest recent gaps with whether each filled. Read fresh per call, nothing cached.",
        "class": "stock",
        "reads": {
            "bias": "gaps tend to continue intraday",
            "fill": "gaps fill about half the time",
            "gappiness": "very gap-prone"
        },
        "source": "Yahoo Finance",
        "symbol": "TSLA",
        "gap_days": 179,
        "window_days": 252,
        "largest_gaps": [
            {
                "date": "2025-07-07",
                "filled": false,
                "gap_pct": -7.6,
                "direction": "down",
                "closed_in_gap_direction": false
            },
            {
                "date": "2025-09-15",
                "filled": false,
                "gap_pct": 6.87,
                "direction": "up",
                "closed_in_gap_direction": false
            },
            {
                "date": "2025-07-24",
                "filled": false,
                "gap_pct": -6.78,
                "direction": "down",
                "closed_in_gap_direction": true
            },
            {
                "date": "2025-07-01",
                "filled": false,
                "gap_pct": -6.04,
                "direction": "down"
…(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/gapstats-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/gapstats-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "metric is gap_frequency (default), fill_rate, avg_gap or continuation. window is 60-1000 trading days (default 252). threshold is the gap-size cutoff in percent, 0.1-5 (default 0.5). class filters to index/sector/commodity/bond/stock (default all). Read fresh per call, nothing cached.",
        "source": "Yahoo Finance daily OHLC, live",
        "classes": [
            "index",
            "sector",
            "commodity",
            "bond",
            "stock"
        ],
        "metrics": [
            "gap_frequency",
            "fill_rate",
            "avg_gap",
            "continuation"
        ],
        "service": "gapstats-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/asset": "Full gap profile of one instrument with its largest recent gaps (symbol=TSLA, window=252).",
            "GET /v1/screener": "Rank the universe by gap metric (metric=gap_frequency, window=252, class=all).",
            "GET /v1/universe": "The universe and its classes."
        },
        "description": "Opening gap statistics — the overnight-gap behaviour day-traders trade, live from Yahoo Finance daily OHLC (no key, nothing stored). For each instrument it returns how often it gaps up/down, the average gap size, the gap-fill rate (share of gaps where price traded back through the prior close) and the continuation rate (share closing in the gap's direction), plus the largest recent gaps. asset returns one 
…(truncated, see openapi.json for full schema)
```


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