> ## Documentation Index
> Fetch the complete documentation index at: https://noxstock.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema 2 prices

> The opt-in schema-2 stock_prices snapshot and history shapes, backed by committed AAPL price fixtures.

`stock_prices` uses a licensed **end-of-day** feed as the authoritative price source. Snapshot responses also include an IEX intraday quote/refusal overlay; it is not a consolidated real-time or tick feed. Freshness is explicit on every price view.

Schema 2 is not the default yet. Send `"schema": 2` explicitly.

## Snapshot

```bash theme={null}
curl -sS "https://api.stockcontext.com/v1/tools/stock_prices" \
  -H "X-API-Key: $STOCKCONTEXT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"schema":2,"symbol":"AAPL","view":"snapshot"}'
```

The capabilities catalog reports `stock_prices_snapshot` at **357 measured tokens** with a **500-token gate**.

Trimmed from `tests/fixtures/prices_v2/golden_snapshot.json`; shown values are unchanged.

```json theme={null}
{
  "subject": {
    "entity": { "cik": "0000320193", "name": "Apple Inc." },
    "security": { "security_id": "sec_0000320193_aapl", "ticker": "AAPL", "trading_currency": "USD" }
  },
  "data": {
    "view": "snapshot",
    "trading_currency": "USD",
    "freshness": { "session": "2026-07-01", "sessions_behind": 1 },
    "quote": {
      "close": 294.38,
      "open": 293.44,
      "high": 296.59,
      "low": 289.195,
      "volume": 50164232,
      "prev_close": 289.36,
      "change_pct": 1.73
    },
    "intraday": {
      "last": 295.17,
      "prev_close": 294.38,
      "open": 295.01,
      "high": 296.12,
      "low": 294.5,
      "volume": 1234567,
      "bid": 295.14,
      "ask": 295.15,
      "bid_size": 8,
      "ask_size": 12,
      "quote_at": "2026-07-06T14:31:02.123000Z",
      "venue": "IEX",
      "note": "IEX is a thin venue (~2.5-3% of consolidated volume); last-sale coverage can be sparse for thin names."
    },
    "context": {
      "high_52w": { "value": 317.4, "date": "2026-06-08" },
      "low_52w": { "value": 200.7003, "date": "2025-08-01" },
      "vs_52w_high_pct": -7.25,
      "vs_52w_low_pct": 46.68,
      "avg_volume_30d": 61149408,
      "returns_pct": { "1w": 0.44, "1mo": -3.89, "3mo": 15.26, "6mo": 8.49, "ytd": 8.49, "1y": 42.22 }
    },
    "technicals": {
      "sma_50": 292.6024,
      "sma_200": 269.9567,
      "ema_12": 290.9601,
      "ema_26": 293.208,
      "rsi_14": 50.9861,
      "volatility_30d_annualized_pct": 30.81,
      "atr_14_pct": 2.78
    }
  },
  "meta": { "schema_version": "2", "as_of": { "market": "2026-07-02" }, "basis": "eod_licensed" }
}
```

Read both clocks:

* `data.freshness.session` is the latest held bar for the security.
* `data.freshness.sessions_behind` is measured against `meta.as_of.market`, the market-feed cursor.

## History

```bash theme={null}
curl -sS "https://api.stockcontext.com/v1/tools/stock_prices" \
  -H "X-API-Key: $STOCKCONTEXT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"schema":2,"symbol":"AAPL","view":"history","range":"3mo"}'
```

The capabilities catalog reports `stock_prices_summary` at **208 measured tokens** with a **400-token gate**. The full `3mo` history fixture has 63 rows.

Trimmed from `tests/fixtures/prices_v2/golden_history_3mo.json`; shown row values are unchanged.

```json theme={null}
{
  "data": {
    "view": "history",
    "trading_currency": "USD",
    "interval": "1d",
    "interval_source": "default_for_range",
    "freshness": { "session": "2026-07-01", "sessions_behind": 1 },
    "range": { "requested": "3mo", "start": "2026-04-01", "end": "2026-07-01" },
    "bars_returned": 63,
    "summary": {
      "return_pct": 15.26,
      "high": { "value": 317.4, "date": "2026-06-08" },
      "low": { "value": 245.7, "date": "2026-04-07" },
      "max_drawdown": { "pct": -12.71, "peak_date": "2026-06-02", "trough_date": "2026-06-25" },
      "avg_volume": 53008251,
      "max_volume": { "value": 261775450, "date": "2026-06-26" },
      "adjustment_note": "adj_close differs from close before 2026-05-11 (dividend); return_pct uses adj_close"
    },
    "columns": ["date", "open", "high", "low", "close", "volume", "adj_close"],
    "rows": [
      ["2026-04-01", 254.08, 256.18, 253.33, 255.63, 40059432, 255.3944],
      ["2026-04-02", 254.2, 256.13, 250.65, 255.92, 31289369, 255.6841],
      ["2026-07-01", 293.44, 296.59, 289.195, 294.38, 50164232, 294.38]
    ]
  },
  "meta": { "schema_version": "2", "as_of": { "market": "2026-07-02" }, "basis": "eod_licensed" }
}
```

For charting, zip `columns` with each row. If an indicator cell refuses, the capabilities catalog's decode recipe is:

```ts theme={null}
x => typeof x === "object" ? null : Number(x)
```
