# Candlestick Pattern API
> Live candlestick-pattern recognition that traders and trading bots run on OHLC candles — computed on demand, no key, nothing cached. Detect the patterns that complete on the last candle of a series; scan a whole series for every pattern occurrence with its position; or list the 24 supported patterns. Each match carries a bullish, bearish or neutral signal. Works for any market — forex, stocks, crypto or commodities. A pattern-recognition engine, distinct from numeric-indicator and support-resistance tools: it turns raw candles into the reversal and continuation signals a chartist reads.

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

## Pricing
- **Free** (Free) — 5,100 calls/Mo, 3 req/s
- **Starter** ($6/Mo) — 114,000 calls/Mo, 10 req/s
- **Pro** ($18/Mo) — 545,000 calls/Mo, 25 req/s
- **Business** ($42/Mo) — 3,280,000 calls/Mo, 55 req/s

## Endpoints

### Candlestick

#### `GET /v1/detect` — Patterns completing on the last candle

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close, comma-separated, oldest first Example: `10:11:9.8:10.8,10.4:11.6:10.3:11.4,11:12.2:10.9:12`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/candlestick-api/v1/detect?candles=10%3A11%3A9.8%3A10.8%2C10.4%3A11.6%3A10.3%3A11.4%2C11%3A12.2%3A10.9%3A12"
```

**Response:**
```json
{
    "data": {
        "bias": "bullish",
        "count": 1,
        "source": "CANDLESTICK",
        "at_index": 2,
        "patterns": [
            {
                "name": "Three White Soldiers",
                "type": "bullish",
                "candles": 3
            }
        ],
        "candles_in": 3,
        "last_candle": {
            "c": 12,
            "h": 12.2,
            "l": 10.9,
            "o": 11
        }
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:10.971Z",
        "request_id": "3fcb98e2-cfa2-4609-8de8-99862502359a"
    },
    "status": "ok",
    "message": "Patterns detected",
    "success": true
}
```

#### `GET /v1/meta` — Service metadata and endpoint list

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

**Response:**
```json
{
    "data": {
        "note": "candles = open:high:low:close, comma-separated, oldest first (e.g. candles=10:11:9.5:9.6,9.6:9.7:9:9.65,9.6:10.2:9.5:10.1).",
        "source": "Computed in-process from caller-supplied OHLC candles (no upstream)",
        "service": "candlestick-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/scan": "Every pattern occurrence across the series with its index (candles=...).",
            "GET /v1/detect": "Patterns completing on the last candle (candles=o:h:l:c,...).",
            "GET /v1/patterns": "List the supported candlestick patterns."
        },
        "description": "Live candlestick-pattern recognition computed on demand from OHLC candles. The detect endpoint returns the patterns that complete on the last candle of a series; the scan endpoint finds every pattern occurrence across the whole series with its position; the patterns endpoint lists the 24 supported patterns. Each match carries a bullish / bearish / neutral signal. Works for any market — forex, stocks, crypto or commodities. A pattern-recognition engine, distinct from numeric-indicator and support-resistance tools.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:11.067Z",
        "request_id": "ced99e21-7f44-44b1-ad51-48d6e149a4a4"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```

#### `GET /v1/patterns` — List the supported candlestick patterns

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

**Response:**
```json
{
    "data": {
        "note": "Pass candles as open:high:low:close, comma-separated, oldest first. A pattern needs at least its 'candles' count of bars.",
        "count": 22,
        "source": "CANDLESTICK",
        "patterns": [
            {
                "name": "Doji",
                "type": "neutral",
                "candles": 1
            },
            {
                "name": "Dragonfly Doji",
                "type": "bullish",
                "candles": 1
            },
            {
                "name": "Gravestone Doji",
                "type": "bearish",
                "candles": 1
            },
            {
                "name": "Bullish Marubozu",
                "type": "bullish",
                "candles": 1
            },
            {
                "name": "Bearish Marubozu",
                "type": "bearish",
                "candles": 1
            },
            {
                "name": "Hammer",
                "type": "bullish",
                "candles": 1
            },
            {
                "name": "Hanging Man",
                "type": "bearish",
                "candles": 1
            },
            {
                "name": "Inverted Hammer",
                "type": "bullish",
                "candles": 1
            },
            {
                "name": "Shooting Star",
                "type": "bearish",
                "candles": 1
            },
            {
                "name": "Spinning Top",
              
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/scan` — Every pattern occurrence across the series

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close, comma-separated, oldest first Example: `10:11:9.8:10.8,10.4:11.6:10.3:11.4,11:12.2:10.9:12`
- `limit` (query, optional, string) — Max occurrences returned (default 200) Example: `200`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/candlestick-api/v1/scan?candles=10%3A11%3A9.8%3A10.8%2C10.4%3A11.6%3A10.3%3A11.4%2C11%3A12.2%3A10.9%3A12&limit=200"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "source": "CANDLESTICK",
        "bearish": 0,
        "bullish": 1,
        "candles_in": 3,
        "occurrences": [
            {
                "name": "Three White Soldiers",
                "type": "bullish",
                "index": 2,
                "candles": 3
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-10T22:56:11.263Z",
        "request_id": "acf33ffc-3e16-4651-b269-a0265860eccb"
    },
    "status": "ok",
    "message": "Series scanned",
    "success": true
}
```


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