# Stock Price History (OHLC) API
> Live historical daily prices (OHLC) for US stocks from Nasdaq — no key, nothing stored. The price-history-and-charting view of a stock: the daily open, high, low, close and volume going back months or years, distinct from the live-quote, movers, earnings and analyst APIs in the catalogue. The history endpoint returns the daily OHLC time series over a chosen range — 1 month to 5 years, or explicit from/to dates — ready to plot or backtest. The stats endpoint computes the period statistics from that series: the period high and low, the latest close, the total return over the period, the average daily volume and the annualised volatility (from daily log returns). Build charting widgets, backtesting tools, technical-analysis pipelines, performance trackers and risk models on top of real Nasdaq price history. Look up any US stock by its ticker (symbol=AAPL) and a range (1m, 3m, 6m, 1y, 2y, 5y) or explicit from=YYYY-MM-DD and to=YYYY-MM-DD; prices and volumes are returned as clean numbers.

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

## Pricing
- **Free** (Free) — 12,200 calls/Mo, 3 req/s
- **Starter** ($8/Mo) — 188,000 calls/Mo, 10 req/s
- **Pro** ($25/Mo) — 795,000 calls/Mo, 28 req/s
- **Scale** ($56/Mo) — 2,840,000 calls/Mo, 60 req/s

## Endpoints

### History

#### `GET /v1/history` — Daily OHLC time series

**Parameters:**
- `symbol` (query, required, string) — Stock ticker Example: `AAPL`
- `range` (query, optional, string) — 1m, 3m, 6m, 1y, 2y, 5y (default 1y) Example: `1y`
- `from` (query, optional, string) — Start date YYYY-MM-DD (with to) Example: `2026-01-01`
- `to` (query, optional, string) — End date YYYY-MM-DD Example: `2026-03-01`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/stockhistory-api/v1/history?symbol=AAPL&range=1y&from=2026-01-01&to=2026-03-01"
```

**Response:**
```json
{
    "data": {
        "to": "2026-03-01",
        "from": "2026-01-01",
        "count": 39,
        "range": "custom",
        "source": "Nasdaq",
        "symbol": "AAPL",
        "company": "Apple Inc. Common Stock",
        "history": [
            {
                "low": 269,
                "date": "2026-01-02",
                "high": 277.84,
                "open": 272.255,
                "close": 271.01,
                "volume": 37838050
            },
            {
                "low": 266.14,
                "date": "2026-01-05",
                "high": 271.51,
                "open": 270.64,
                "close": 267.26,
                "volume": 45647190
            },
            {
                "low": 262.12,
                "date": "2026-01-06",
                "high": 267.55,
                "open": 267,
                "close": 262.36,
                "volume": 52352090
            },
            {
                "low": 259.81,
                "date": "2026-01-07",
                "high": 263.68,
                "open": 263.2,
                "close": 260.33,
                "volume": 48309800
            },
            {
                "low": 255.7,
                "date": "2026-01-08",
                "high": 259.29,
                "open": 257.02,
                "close": 259.04,
                "volume": 50419340
            },
            {
                "low": 256.22,
                "date": "2026-01-09",
                "high": 260.21,
…(truncated, see openapi.json for full schema)
```

### Stats

#### `GET /v1/stats` — Period statistics from the history

**Parameters:**
- `symbol` (query, required, string) — Stock ticker Example: `AAPL`
- `range` (query, optional, string) — Range (default 1y) Example: `1y`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/stockhistory-api/v1/stats?symbol=AAPL&range=1y"
```

**Response:**
```json
{
    "data": {
        "to": "2026-06-13",
        "from": "2025-06-11",
        "range": "1y",
        "source": "Nasdaq",
        "symbol": "AAPL",
        "company": "Apple Inc. Common Stock",
        "period_low": 195.07,
        "first_close": 198.78,
        "period_high": 317.4,
        "latest_close": 295.63,
        "trading_days": 252,
        "avg_daily_volume": 49699215,
        "period_return_pct": 48.72,
        "annualized_volatility_pct": 22.52
    },
    "meta": {
        "timestamp": "2026-06-12T01:42:16.400Z",
        "request_id": "27e63fff-15ea-4277-a4ab-ad9c9a451c60"
    },
    "status": "ok",
    "message": "Stats retrieved successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "Look up a stock by its ticker (symbol=AAPL) and a range=1m|3m|6m|1y|2y|5y (default 1y), or pass explicit from=YYYY-MM-DD & to=YYYY-MM-DD. Annualised volatility uses daily log returns and a 252-day year.",
        "source": "Nasdaq public chart feed (api.nasdaq.com/api/quote/{symbol}/chart, live)",
        "service": "stockhistory-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/stats": "Period statistics — high/low, return, avg volume, volatility (symbol=AAPL, range=1y).",
            "GET /v1/history": "Daily OHLC time series (symbol=AAPL, range=1y, or from/to)."
        },
        "description": "Live historical daily prices (OHLC) for US stocks from Nasdaq — the price-history-and-charting view. history = the daily open/high/low/close/volume time series over a chosen range; stats = the period statistics computed from that series (period high and low, latest close, total return, average daily volume and annualised volatility). Live, no key, nothing stored. Distinct from the live-quote, movers, earnings and analyst APIs.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-12T01:42:16.632Z",
        "request_id": "8474abaf-10cb-443b-a6c6-d652e71797cb"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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