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

# Stream real-time token OHLCV candles

> Stream real-time token candles over SSE. Only frontend and enterprise callers are allowed.



## OpenAPI

````yaml /streaming/api-streaming.yml get /sse/ohlcv
openapi: 3.1.0
info:
  title: DexPaprika Streaming API
  version: 1.0.1
  license:
    name: UNLICENSED
    identifier: UNLICENSED
  description: >
    The DexPaprika Streaming API delivers real-time updates for token prices,
    swap transactions,

    and pool reserves over Server-Sent Events (SSE).


    ## Rate Limits


    - **Concurrent SSE streams per IP:** 10. Excess returns `429` with
    `{"message": "ip stream limit exceeded"}`.

    - **Assets per `POST /sse/prices`:** 25. Excess returns `400` with
    `{"message": "too many assets, max 25 allowed"}`.

    - **Request body on `POST /sse/prices`:** 256 KB. Excess returns `413
    Payload Too Large`.

    - **Request rate (per IP x path x method):** 60 req / 60 s. Excess returns
    `429` with `{"message": "you have reached maximum request limit"}`.


    ## HTTP Response Codes


    - `200` — SSE connection established.

    - `400` — Invalid request (bad params, unknown chain, unknown asset, or
    asset cap exceeded).

    - `413` — Request body exceeds the route limit.

    - `429` — Per-IP stream limit, per-route rate limit, or global stream slot
    pool exhausted.

    - `503` — Service saturated (concurrent in-flight cap reached).


    ## SSE Event Format


    Events conform to the W3C SSE specification. Non-system events on
    multiplexed streams include

    an optional `request_id` line for correlating events to subscriptions:


    ```

    event: [event_name]

    request_id: [request_id]

    data: [json_payload]

    ```


    ## Event Types


    - `token_price` (`PriceResponse`) — Real-time price update.

    - `ohlcv` (`OHLCVResponse`) — Real-time 1s token candle update.

    - `ping` (`PingEvent`) — Heartbeat sent every 15 s. Treat absence for >30 s
    as a potential connection problem.

    - `warning` (`WarningEvent`) — Non-fatal notice (e.g. partial subscription
    accepted).

    - `error` (`ErrorEvent`) — Terminal stream-level error sent before
    connection close.


    ## Error Message Catalog


    400 errors:

    - `at least one asset is required`

    - `invalid method`

    - `unsupported chain`

    - `asset not found`

    - `too many assets, max 25 allowed`


    403 errors:

    - `this endpoint is not yet available`


    429 errors:

    - `ip stream limit exceeded`

    - `Cannot create new subscriptions, global stream limit exceeded`

    - `you have reached maximum request limit`


    503 errors:

    - `Too many concurrent requests`


    ## Removed endpoints


    The legacy `/stream` path has been removed and returns `410 Gone` — use
    `/sse/prices` instead.
servers:
  - url: https://streaming.dexpaprika.com
    description: Production Streaming Gateway
security: []
paths:
  /sse/ohlcv:
    get:
      summary: Stream real-time token OHLCV candles
      description: >-
        Stream real-time token candles over SSE. Only frontend and enterprise
        callers are allowed.
      operationId: streamTokenOHLCV
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
          description: Chain identifier
        - name: token_id
          in: query
          required: true
          schema:
            type: string
          description: Token address. Required unless `address` is supplied.
        - name: address
          in: query
          required: false
          schema:
            type: string
          description: >-
            Alias for `token_id`, accepted for consistency with the other SSE
            endpoints. Ignored when `token_id` is set.
        - name: interval
          in: query
          required: false
          schema:
            type: string
            enum:
              - 1s
            default: 1s
          description: Candle interval
        - name: request_id
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 4294967295
          description: Optional request identifier
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: Maximum event count
      responses:
        '200':
          description: Stream established successfully
          content:
            text/event-stream:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/OHLCVResponse'
                  - $ref: '#/components/schemas/PingEvent'
                  - $ref: '#/components/schemas/ErrorEvent'
        '403':
          description: Endpoint not available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
components:
  schemas:
    OHLCVResponse:
      type: object
      description: Sealed token candle event
      properties:
        chain:
          type: string
          description: Chain identifier
          example: ethereum
        token_id:
          type: string
          description: Token address
          example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        interval:
          type: string
          description: Candle interval
          example: 1s
        timestamp:
          type: string
          format: date-time
          description: Candle start time
        open:
          type: number
          description: Open price in USD
          example: 1.234
        high:
          type: number
          description: High price in USD
          example: 1.25
        low:
          type: number
          description: Low price in USD
          example: 1.22
        close:
          type: number
          description: Close price in USD
          example: 1.24
        avg:
          type: number
          description: Average price in USD
          example: 1.235
        volume_usd:
          type: number
          description: Total volume in USD
          example: 15230.5
        txns:
          type: integer
          description: Number of swaps
          example: 12
    PingEvent:
      type: object
      description: Heartbeat sent every 15 s to keep the connection alive.
      properties:
        time:
          type: integer
          description: Unix epoch seconds at the time of the ping.
          example: 1715162400
    ErrorEvent:
      type: object
      description: >-
        Terminal error sent before the server closes the stream. Also used as
        the body for 4XX/5XX HTTP error responses.
      properties:
        message:
          type: string
          description: >-
            Human-readable error description. See the Error Message Catalog in
            the overview for the full list of stable values.
          example: asset not found

````