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

# TradingView Pine Script Signal

> Compact, flat JSON payload consumed by the AIOKA Pine Script v5 indicator

<Note>
  To use the playground, enter your API key in the **X-API-Key** field above.
  Don't have a key? [Get one free →](/api-reference/keys/generate)
</Note>

**Tier:** Free ✅
**Cache TTL:** 60 seconds
**Rate limit:** Free 100/day, 2/min. Basic 1,000/day, 30/min. Pro 10,000/day, 100/min.

This endpoint powers the **AIOKA AI Signals** Pine Script indicator published on
TradingView. The response is intentionally kept **under 200 bytes** — no nested
objects, no lists, Unix-epoch timestamp — so high-frequency polling from a
charting platform stays cheap on bandwidth and fast to parse.

## Response Fields

| Field          | Type   | Description                                                                                             |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------- |
| `verdict`      | string | Judiciary ruling: `STRONG_BUY`, `BUY`, `ACCUMULATE`, `HOLD`, `REDUCE`, `SELL`, `STRONG_SELL`, `PENDING` |
| `confidence`   | float  | Judiciary composite confidence 0-100                                                                    |
| `regime`       | string | Current HMM regime (`BULL_TRENDING`, `LOW_VOLATILITY`, `WHALE_ACCUMULATION`, …)                         |
| `dark_pool`    | int    | Dark Pool composite score 0-100 (Sprint 210)                                                            |
| `rsi`          | float  | BTC 1H RSI(14)                                                                                          |
| `ema_200`      | float  | BTC 1H EMA(200)                                                                                         |
| `btc_price`    | float  | Live BTC spot price                                                                                     |
| `ghost_status` | string | `WAITING`, `READY`, or `IN_POSITION`                                                                    |
| `timestamp`    | int    | Unix epoch seconds                                                                                      |

## Pine Script Quick Start

Download the free AIOKA indicator from the [TradingView integration guide](/tradingview),
paste your API key into the indicator settings, and it will poll this endpoint once
per bar close.

<RequestExample>
  ```bash curl theme={null}
  curl https://api.aioka.io/v1/tradingview/signal \
    -H "X-API-Key: aik_free_yourkeyhere"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "verdict": "ACCUMULATE",
    "confidence": 76.8,
    "regime": "LOW_VOLATILITY",
    "dark_pool": 65,
    "rsi": 48.0,
    "ema_200": 75963,
    "btc_price": 77781,
    "ghost_status": "WAITING",
    "timestamp": 1745441234
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/tradingview/signal
openapi: 3.1.0
info:
  title: AIOKA Intelligence API
  description: |

    ## AI-powered crypto market intelligence

    AIOKA Intelligence API provides real-time access to our AI Council verdicts,
    market signals, regime detection, and Ghost Trader entry signals.

    ### Tiers
    - **Free**: 100 calls/day — Verdict + Regime
    - **Basic** ($49/mo): 1,000 calls/day — + Signals
    - **Pro** ($199/mo): 10,000 calls/day — + Council + Ghost

    ### Authentication
    Pass your API key in the `X-API-Key` header:

    ```
    X-API-Key: aik_free_xxxxxxxxxxxx
    ```

    ### Get your API key
    `POST /v1/keys/generate` (free tier, no credit card)
  contact:
    name: AIOKA Support
    url: https://docs.aioka.io/
    email: api@aioka.io
  license:
    name: Commercial
    url: https://aioka.io/terms
  version: 1.0.0
servers:
  - url: https://api.aioka.io
    description: Production — AIOKA Intelligence API
security: []
paths:
  /v1/tradingview/signal:
    get:
      tags:
        - TradingView
      summary: TradingView Pine Script Signal
      description: >-
        Flat, compact signal payload optimised for a Pine Script v5 indicator.


        Response body is intentionally kept under 200 bytes — no nested objects,

        no lists, Unix epoch timestamp (integer) rather than ISO string — so

        high-frequency polling from a TradingView chart remains cheap on
        bandwidth

        and fast to parse in Pine Script.


        **Tier:** Free ✅

        **Cache TTL:** 60 seconds (server-side)

        **Rate limit:** Free 100/day, 2/min. Basic 1,000/day, 30/min. Pro
        10,000/day, 100/min.


        ### Response fields

        | Field | Type | Description |

        |-------|------|-------------|

        | `verdict` | string | Judiciary ruling (STRONG_BUY, BUY, ACCUMULATE,
        HOLD, REDUCE, SELL, STRONG_SELL, PENDING) |

        | `confidence` | float | Judiciary composite confidence 0-100 |

        | `regime` | string | Current HMM regime |

        | `dark_pool` | int | Dark Pool composite score 0-100 |

        | `rsi` | float | BTC 1H RSI(14) |

        | `ema_200` | float | BTC 1H EMA(200) |

        | `btc_price` | float | Live BTC spot price |

        | `ghost_status` | string | `WAITING` or `IN_POSITION` |

        | `timestamp` | int | Unix epoch seconds |


        ### Pine Script quick start

        Download the free AIOKA indicator at

        [docs.aioka.io/tradingview](https://docs.aioka.io/tradingview), paste
        your

        API key in the indicator settings, and it will poll this endpoint once
        per

        bar close.
      operationId: get_tradingview_signal_v1_tradingview_signal_get
      responses:
        '200':
          description: Latest AIOKA signal bundle for Pine Script.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradingViewSignalResponse'
        '401':
          description: Invalid or missing API key
        '429':
          description: Rate limit exceeded (daily or per-minute)
      security:
        - APIKeyHeader: []
components:
  schemas:
    TradingViewSignalResponse:
      properties:
        verdict:
          type: string
          title: Verdict
          description: >-
            Judiciary ruling (STRONG_BUY / BUY / ACCUMULATE / HOLD / REDUCE /
            SELL / STRONG_SELL / PENDING).
        confidence:
          type: number
          title: Confidence
          description: Judiciary composite confidence 0-100.
        regime:
          type: string
          title: Regime
          description: >-
            Current market regime (BULL_TRENDING / HIGH_VOLATILITY /
            LOW_VOLATILITY / ...).
        dark_pool:
          type: integer
          title: Dark Pool
          description: Dark Pool composite score 0-100 (Sprint 210 — 0 if unavailable).
        rsi:
          type: number
          title: Rsi
          description: BTC 1H RSI(14). 0 if unavailable.
        ema_200:
          type: number
          title: Ema 200
          description: BTC 1H EMA(200). 0 if unavailable.
        btc_price:
          type: number
          title: Btc Price
          description: Live BTC spot price. 0 if unavailable.
        ghost_status:
          type: string
          title: Ghost Status
          description: Ghost Trader status (WAITING / IN_POSITION / READY).
        timestamp:
          type: integer
          title: Timestamp
          description: Unix epoch seconds of the response.
      type: object
      required:
        - verdict
        - confidence
        - regime
        - dark_pool
        - rsi
        - ema_200
        - btc_price
        - ghost_status
        - timestamp
      title: TradingViewSignalResponse
      description: |-
        Flat, compact signal payload consumed by AIOKA Pine Script v5 indicator.

        All times are Unix epoch seconds (integer) rather than ISO strings to
        minimise bytes on the wire and match Pine Script's native time format.
      example:
        btc_price: 77781
        confidence: 76.8
        dark_pool: 65
        ema_200: 75963
        ghost_status: WAITING
        regime: LOW_VOLATILITY
        rsi: 48
        timestamp: 1745441234
        verdict: ACCUMULATE
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: 'Your AIOKA Intelligence API key (format: aik_{tier}_{random})'
      in: header
      name: X-API-Key

````