> ## 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 prices for multiple assets

> Establishes a multiplexed SSE stream for up to 25 token price subscriptions in a single connection.
**Emitted events:** `token_price` · `ping` · `warning` · `error`




## OpenAPI

````yaml /streaming/api-streaming.yml post /sse/prices
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,

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


    ## Access


    GET /sse/ohlcv requires a paid plan (Dev, Pro or Enterprise) and an API key
    in the `Authorization` header, on `https://streaming-pro.dexpaprika.com`.


    ## 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).

    - `403`, paid endpoint called without a paid-plan key, or a keyless request
    for an asset outside the showcase list (`preview_only`).

    - `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.

    - `token_ohlcv` (`OHLCVResponse`), Real-time token candle update for paid
    plans

    - `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`


    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: Keyless and free-key streaming
  - url: https://streaming-pro.dexpaprika.com
    description: Paid plans (Dev, Pro, Enterprise), key required
security: []
paths:
  /sse/prices:
    post:
      summary: Stream real-time prices for multiple assets
      description: >
        Establishes a multiplexed SSE stream for up to 25 token price
        subscriptions in a single connection.

        **Emitted events:** `token_price` · `ping` · `warning` · `error`
      operationId: streamBatchAssetPrices
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: >-
            Close the stream after this many total events. Omit for an
            indefinite stream.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              maxItems: 25
              description: List of assets to subscribe to. Maximum 25 items.
              items:
                $ref: '#/components/schemas/AssetPriceRequest'
      responses:
        '200':
          description: Multiplexed SSE stream established.
          content:
            text/event-stream:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/PriceResponse'
                  - $ref: '#/components/schemas/PingEvent'
                  - $ref: '#/components/schemas/WarningEvent'
                  - $ref: '#/components/schemas/ErrorEvent'
        '400':
          description: >-
            Invalid request (unknown chain, unknown asset, invalid method, or
            too many assets).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
        '413':
          description: Request body exceeds the 256 KB route limit.
        '429':
          description: Per-IP stream limit or rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
        '503':
          description: Service saturated, too many concurrent streams.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEvent'
components:
  schemas:
    AssetPriceRequest:
      type: object
      required:
        - chain
        - address
        - method
      description: Subscription item for `POST /sse/prices`.
      properties:
        chain:
          type: string
          description: Blockchain network identifier.
          example: ethereum
        address:
          type: string
          example: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'
          description: Token smart contract address.
        method:
          type: string
          enum:
            - token_price
          description: Streaming method. Only `token_price` is accepted on `/sse/prices`.
        request_id:
          type: integer
          minimum: 0
          maximum: 4294967295
          description: >-
            Optional identifier echoed on each event for this subscription.
            Defaults to the array index if omitted.
        filter:
          type: object
    PriceResponse:
      type: object
      description: Price update payload. Delivered on the `token_price` event channel.
      properties:
        address:
          type: string
          description: Token smart contract address.
          example: '0x7a250d5630b4cf539739df2c5dacb4c659f2488d'
        chain:
          type: string
          description: Blockchain network identifier.
          example: ethereum
        price:
          type: string
          description: Token price in USD.
          example: '3456.78'
        timestamp:
          type: integer
          description: Server ingestion time, Unix seconds.
          example: 1789721706
        timestamp_price:
          type: integer
          description: Time of the swap that set this price, Unix seconds.
          example: 1789721706
        token_price:
          type: integer
          description: Same value as `timestamp_price`, sent alongside it.
          example: 1789721706
    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
    WarningEvent:
      type: object
      description: >-
        Non-fatal notice sent over the stream without closing it (e.g. a partial
        subscription was accepted).
      properties:
        message:
          type: string
          description: Human-readable warning description.
          example: partial subscription accepted
    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
        error:
          type: string
          description: >-
            Machine-readable code, present on billing-gate refusals only, for
            example `preview_only`.
          example: preview_only
        tier:
          type: string
          description: >-
            Billing tier the request was evaluated against, present alongside
            `error`.
          example: keyless
        links:
          type: object
          additionalProperties:
            type: string
          description: >-
            Next-step URLs (`register`, `pricing`, `docs`), present alongside
            `error`.

````