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

# Prices

> Daily OHLCV bars, point-in-time snapshots, and market-wide snapshots.

Price endpoints serve daily OHLCV bars for any ticker in a scenario, plus single-day and market-wide snapshots. All prices are synthetic, generated from market, sector, and event return components.

## Historical prices

```http theme={null}
GET /prices
```

Daily OHLCV bars for a ticker within an optional date window.

| Parameter            | Type    | Required | Default | Description                                         |
| -------------------- | ------- | -------- | ------- | --------------------------------------------------- |
| `scenario_id`        | string  | Yes      | -       | The world to read from.                             |
| `ticker`             | string  | Yes      | -       | Ticker symbol to query.                             |
| `interval`           | string  | No       | `day`   | Only `day` is supported; other values return `400`. |
| `start_date`         | date    | No       | -       | Inclusive window start.                             |
| `end_date`           | date    | No       | -       | Inclusive window end.                               |
| `include_components` | boolean | No       | false   | Include return-decomposition fields (see below).    |
| `limit`              | integer | No       | 5000    | Max bars (max 10000).                               |
| `offset`             | integer | No       | 0       | Pagination offset.                                  |

<CodeGroup>
  ```bash cURL theme={null}
  curl -s "https://api.davidhf.com/prices?scenario_id=<id>&ticker=AAPL&interval=day&start_date=2026-01-02&end_date=2026-03-27" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  dd.prices.get("AAPL", scenario_id="<id>", interval="day", start_date="2026-01-02", end_date="2026-03-27")
  ```
</CodeGroup>

```json theme={null}
{
  "ticker": "AAPL",
  "prices": [
    { "ticker": "AAPL", "open": 182.4, "high": 184.1, "low": 181.2, "close": 183.6, "volume": 51200000, "time": "2026-01-02" }
  ]
}
```

### Components

With `include_components=true`, each bar adds the decomposition David used to generate it:

| Field                  | Description                                  |
| ---------------------- | -------------------------------------------- |
| `adjusted_close`       | Split/dividend-adjusted close.               |
| `market_return`        | Market-factor component of the day's return. |
| `sector_return`        | Sector-factor component.                     |
| `idiosyncratic_return` | Stock-specific component.                    |
| `event_return`         | Component attributable to a scenario event.  |
| `volatility`           | Modeled volatility for the bar.              |
| `metadata`             | Additional bar metadata.                     |

## Price snapshot

```http theme={null}
GET /prices/snapshot
```

The single bar visible as of a date, useful for point-in-time valuation.

| Parameter     | Type   | Required | Description             |
| ------------- | ------ | -------- | ----------------------- |
| `scenario_id` | string | Yes      | The world to read from. |
| `ticker`      | string | Yes      | Ticker symbol to query. |
| `as_of`       | date   | Yes      | Cutoff date.            |

<CodeGroup>
  ```bash cURL theme={null}
  curl -s "https://api.davidhf.com/prices/snapshot?scenario_id=<id>&ticker=AAPL&as_of=2026-03-26" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  dd.prices.snapshot("AAPL", scenario_id="<id>", as_of="2026-03-26")
  ```
</CodeGroup>

```json theme={null}
{ "snapshot": { "ticker": "AAPL", "close": 191.2, "time": "2026-03-26", "...": "..." } }
```

Returns `404` if no bar exists on or before `as_of`.

## Market snapshot

```http theme={null}
GET /prices/snapshot/market
```

A market-wide snapshot across many tickers as of a date.

| Parameter     | Type    | Required | Default | Description             |
| ------------- | ------- | -------- | ------- | ----------------------- |
| `scenario_id` | string  | Yes      | -       | The world to read from. |
| `as_of`       | date    | No       | latest  | Cutoff date.            |
| `limit`       | integer | No       | 500     | Tickers (max 5000).     |
| `offset`      | integer | No       | 0       | Pagination offset.      |

<CodeGroup>
  ```bash cURL theme={null}
  curl -s "https://api.davidhf.com/prices/snapshot/market?scenario_id=<id>&as_of=2026-03-26" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  dd.prices.market_snapshot(scenario_id="<id>", as_of="2026-03-26")
  ```
</CodeGroup>

## Discovery helpers

```http theme={null}
GET /prices/tickers
GET /prices/snapshot/tickers
```

Both take only `scenario_id` and return the tickers with price data.

```json theme={null}
{ "tickers": ["AAPL", "MSFT", "NVDA", "..."] }
```
