# Stochastic & Oscillators API
> Live OHLC momentum-oscillator analytics that traders run to spot overbought and oversold turns, computed on demand from the OHLC candles you pass in — no key, no cache, nothing stored. The stochastic endpoint returns the Stochastic Oscillator %K and %D, the classic measure of where the close sits inside its recent high-low range, with the %D signal line. The williams endpoint returns Williams %R, the same idea on a -100 to 0 scale. The cci endpoint returns the Commodity Channel Index, which flags how far the typical price has strayed from its average. Each result comes with an overbought or oversold reading so you can act on it immediately. These oscillators all need the full high, low and close — that makes them a different tool from closes-only indicator APIs like RSI and MACD, and from volatility and ATR tools: they measure momentum by where price sits within its range. Works for any market — forex, stocks, crypto or commodities — because you supply the candles. Computed locally and deterministically, so it is instant and private. Ideal for trading bots, screeners, signal dashboards and back-tests. Stochastic period defaults to 14 (smoothing 3); CCI to 20; Williams %R to 14. Live, nothing stored. 3 compute endpoints. For RSI, MACD or Bollinger Bands use a technical-indicators API.

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

## Pricing
- **Free** (Free) — 4,350 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 87,500 calls/Mo, 6 req/s
- **Pro** ($21/Mo) — 452,000 calls/Mo, 18 req/s
- **Business** ($47/Mo) — 2,830,000 calls/Mo, 45 req/s

## Endpoints

### Oscillators

#### `GET /v1/cci` — Commodity Channel Index

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close Example: `100:102:99:101,101:104:100:103,103:105:101:102,102:104:100:101,101:103:99:100,100:103:99:102,102:105:101:104,104:106:102:103,103:105:101:104,104:107:103:106,106:108:104:105,105:107:103:104,104:106:102:105,105:108:104:107,107:109:105:106,106:108:104:107,107:110:106:109,109:111:107:110,110:112:108:111,111:113:109:112`
- `period` (query, optional, string) — Lookback period (default 20) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/oscillators-api/v1/cci?candles=100%3A102%3A99%3A101%2C101%3A104%3A100%3A103%2C103%3A105%3A101%3A102%2C102%3A104%3A100%3A101%2C101%3A103%3A99%3A100%2C100%3A103%3A99%3A102%2C102%3A105%3A101%3A104%2C104%3A106%3A102%3A103%2C103%3A105%3A101%3A104%2C104%3A107%3A103%3A106%2C106%3A108%3A104%3A105%2C105%3A107%3A103%3A104%2C104%3A106%3A102%3A105%2C105%3A108%3A104%3A107%2C107%3A109%3A105%3A106%2C106%3A108%3A104%3A107%2C107%3A110%3A106%3A109%2C109%3A111%3A107%3A110%2C110%3A112%3A108%3A111%2C111%3A113%3A109%3A112&period=20"
```

**Response:**
```json
{
    "data": {
        "cci": 168.306,
        "note": "CCI = (typical price - SMA of typical price) / (0.015 x mean absolute deviation) over the period. Typical price = (H+L+C)/3. >=+100 overbought, <=-100 oversold.",
        "period": 20,
        "signal": "overbought",
        "source": "OSCILLATORS",
        "candles": 20,
        "typical_price": 111.33333333
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:09.552Z",
        "request_id": "8a944671-f5dd-48a6-8129-bf3eec00a67f"
    },
    "status": "ok",
    "message": "CCI computed",
    "success": true
}
```

#### `GET /v1/stochastic` — Stochastic Oscillator %K and %D

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close, comma-separated oldest first Example: `100:102:99:101,101:104:100:103,103:105:101:102,102:104:100:101,101:103:99:100,100:103:99:102,102:105:101:104,104:106:102:103,103:105:101:104,104:107:103:106,106:108:104:105,105:107:103:104,104:106:102:105,105:108:104:107,107:109:105:106,106:108:104:107,107:110:106:109,109:111:107:110,110:112:108:111,111:113:109:112`
- `period` (query, optional, string) — Lookback period (default 14) Example: `14`
- `smooth` (query, optional, string) — %D smoothing (default 3) Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/oscillators-api/v1/stochastic?candles=100%3A102%3A99%3A101%2C101%3A104%3A100%3A103%2C103%3A105%3A101%3A102%2C102%3A104%3A100%3A101%2C101%3A103%3A99%3A100%2C100%3A103%3A99%3A102%2C102%3A105%3A101%3A104%2C104%3A106%3A102%3A103%2C103%3A105%3A101%3A104%2C104%3A107%3A103%3A106%2C106%3A108%3A104%3A105%2C105%3A107%3A103%3A104%2C104%3A106%3A102%3A105%2C105%3A108%3A104%3A107%2C107%3A109%3A105%3A106%2C106%3A108%3A104%3A107%2C107%3A110%3A106%3A109%2C109%3A111%3A107%3A110%2C110%3A112%3A108%3A111%2C111%3A113%3A109%3A112&period=14&smooth=3"
```

**Response:**
```json
{
    "data": {
        "note": "Stochastic %K = 100 x (close - lowest low) / (highest high - lowest low) over the period; %D = SMA(%K, smooth). >=80 overbought, <=20 oversold.",
        "period": 14,
        "signal": "overbought",
        "smooth": 3,
        "source": "OSCILLATORS",
        "candles": 20,
        "percent_d": 91.8803,
        "percent_k": 91.6667
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:09.641Z",
        "request_id": "ad8e6b7d-d38f-4a13-826d-6108808b6f33"
    },
    "status": "ok",
    "message": "Stochastic computed",
    "success": true
}
```

#### `GET /v1/williams` — Williams %R

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close Example: `100:102:99:101,101:104:100:103,103:105:101:102,102:104:100:101,101:103:99:100,100:103:99:102,102:105:101:104,104:106:102:103,103:105:101:104,104:107:103:106,106:108:104:105,105:107:103:104,104:106:102:105,105:108:104:107,107:109:105:106,106:108:104:107,107:110:106:109,109:111:107:110,110:112:108:111,111:113:109:112`
- `period` (query, optional, string) — Lookback period (default 14) Example: `14`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/oscillators-api/v1/williams?candles=100%3A102%3A99%3A101%2C101%3A104%3A100%3A103%2C103%3A105%3A101%3A102%2C102%3A104%3A100%3A101%2C101%3A103%3A99%3A100%2C100%3A103%3A99%3A102%2C102%3A105%3A101%3A104%2C104%3A106%3A102%3A103%2C103%3A105%3A101%3A104%2C104%3A107%3A103%3A106%2C106%3A108%3A104%3A105%2C105%3A107%3A103%3A104%2C104%3A106%3A102%3A105%2C105%3A108%3A104%3A107%2C107%3A109%3A105%3A106%2C106%3A108%3A104%3A107%2C107%3A110%3A106%3A109%2C109%3A111%3A107%3A110%2C110%3A112%3A108%3A111%2C111%3A113%3A109%3A112&period=14"
```

**Response:**
```json
{
    "data": {
        "note": "Williams %R = -100 x (highest high - close) / (highest high - lowest low) over the period. Ranges -100..0; >=-20 overbought, <=-80 oversold.",
        "period": 14,
        "signal": "overbought",
        "source": "OSCILLATORS",
        "candles": 20,
        "williams_r": -8.3333
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:09.732Z",
        "request_id": "4c6f70e9-32d8-4fc0-9ba0-50a5596ef3b6"
    },
    "status": "ok",
    "message": "Williams %R computed",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "note": "candles = open:high:low:close, comma-separated, oldest first. Stochastic period defaults to 14 (smooth 3); CCI defaults to 20; Williams %R defaults to 14.",
        "source": "Computed in-process from caller-supplied OHLC candles (no upstream)",
        "service": "oscillators-api",
        "endpoints": {
            "GET /v1/cci": "Commodity Channel Index (candles=o:h:l:c,...&period=20).",
            "GET /v1/meta": "This document.",
            "GET /v1/williams": "Williams %R (candles=o:h:l:c,...&period=14).",
            "GET /v1/stochastic": "Stochastic Oscillator %K and %D (candles=o:h:l:c,...&period=14&smooth=3)."
        },
        "description": "Live OHLC momentum-oscillator analytics computed on demand from OHLC candles. The stochastic endpoint returns the Stochastic Oscillator %K and %D; the williams endpoint returns Williams %R; the cci endpoint returns the Commodity Channel Index — each with an overbought/oversold reading. These oscillators need the full high/low/close, distinct from closes-only indicator tools (RSI, MACD) and from volatility/ATR tools. Computed locally, nothing stored — works for forex, stocks, crypto or commodities.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:09.823Z",
        "request_id": "8eaec8b0-b590-4b8e-aa3f-b4359962902d"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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