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

# Watch Ticker (WebSocket)

> Stream live ticker updates for a symbol via WebSocket.

**Transport:** WebSocket

| Environment | URL |
|---|---|
| Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |

**Subscribe:**
```json
{ "id": "btc-stream", "action": "subscribe", "method": "watchTicker", "args": ["BTC/USDT"], "feed": "binance" }
```

**Server response:**
```json
{ "event": "data", "id": "btc-stream", "method": "watchTicker", "symbol": "BTC/USDT", "source": "binance", "data": { "symbol": "BTC/USDT", "last": 76949.16, "timestamp": 1716148800000, ... } }
```

**Unsubscribe:**
```json
{ "id": "btc-stream", "action": "unsubscribe" }
```

Currently supports Binance feeds only. Tickers stream as they arrive from the Binance trade relay.



## OpenAPI

````yaml /api-reference/openapi.json get /api/feeds/{feed}/watchTicker
openapi: 3.0.0
info:
  title: PMXT Hosted API
  description: >-
    One API for supported prediction markets. Hosted catalog search in under
    10ms, a unified schema for supported venues, and venue-native trading where
    venues expose writes.
  version: 2.54.0
servers:
  - url: https://api.pmxt.dev
    description: Hosted PMXT (production)
security: []
tags:
  - name: Hosted
    description: >-
      Requires a PMXT API key. These endpoints use the cross-venue catalog and
      have no local equivalent.
  - name: Local Only
    description: >-
      Executed locally by the SDK against the venue. Never proxied through PMXT
      servers.
  - name: Data Feeds
    description: >-
      Auxiliary price and oracle data feeds (Binance, Chainlink).
      CCXT-compatible method names and response shapes.
paths:
  /api/feeds/{feed}/watchTicker:
    get:
      tags:
        - Data Feeds
      summary: Watch Ticker (WebSocket)
      description: >-
        Stream live ticker updates for a symbol via WebSocket.


        **Transport:** WebSocket


        | Environment | URL |

        |---|---|

        | Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |


        **Subscribe:**

        ```json

        { "id": "btc-stream", "action": "subscribe", "method": "watchTicker",
        "args": ["BTC/USDT"], "feed": "binance" }

        ```


        **Server response:**

        ```json

        { "event": "data", "id": "btc-stream", "method": "watchTicker",
        "symbol": "BTC/USDT", "source": "binance", "data": { "symbol":
        "BTC/USDT", "last": 76949.16, "timestamp": 1716148800000, ... } }

        ```


        **Unsubscribe:**

        ```json

        { "id": "btc-stream", "action": "unsubscribe" }

        ```


        Currently supports Binance feeds only. Tickers stream as they arrive
        from the Binance trade relay.
      operationId: feedWatchTicker
      parameters:
        - in: path
          name: feed
          schema:
            type: string
            enum:
              - binance
              - chainlink
          required: true
          description: The data feed provider.
        - in: query
          name: symbol
          required: true
          schema:
            type: string
          description: Trading pair to stream (e.g. BTC/USDT)
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/FeedTicker'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            import asyncio
            import json
            import websockets

            async def main():
                url = "wss://api.pmxt.dev/ws?apiKey=YOUR_PMXT_API_KEY"
                async with websockets.connect(url) as ws:
                    await ws.send(json.dumps({
                        "id": "btc-stream",
                        "action": "subscribe",
                        "method": "watchTicker",
                        "args": ["BTC/USDT"],
                        "feed": "binance",
                    }))
                    async for raw in ws:
                        msg = json.loads(raw)
                        if msg.get("event") == "data":
                            print(f'{msg["data"]["symbol"]}: ${msg["data"]["last"]}')

            asyncio.run(main())
        - lang: javascript
          label: TypeScript
          source: >-
            const ws = new
            WebSocket("wss://api.pmxt.dev/ws?apiKey=YOUR_PMXT_API_KEY");


            ws.onopen = () => {
              ws.send(JSON.stringify({
                id: "btc-stream",
                action: "subscribe",
                method: "watchTicker",
                args: ["BTC/USDT"],
                feed: "binance",
              }));
            };


            ws.onmessage = (e) => {
              const msg = JSON.parse(e.data);
              if (msg.event === "data") {
                console.log(`${msg.data.symbol}: $${msg.data.last}`);
              }
            };
components:
  schemas:
    FeedTicker:
      type: object
      description: CCXT-compatible ticker with last trade price and metadata.
      properties:
        symbol:
          type: string
          description: Trading pair symbol (e.g. BTC/USD)
        info:
          description: Raw provider-specific data
        timestamp:
          type: integer
          description: Unix timestamp in milliseconds
        datetime:
          type: string
          format: date-time
        high:
          type: number
        low:
          type: number
        bid:
          type: number
        bidVolume:
          type: number
        ask:
          type: number
        askVolume:
          type: number
        vwap:
          type: number
        open:
          type: number
        close:
          type: number
        last:
          type: number
          description: Last trade price
        previousClose:
          type: number
        change:
          type: number
        percentage:
          type: number
        average:
          type: number
        quoteVolume:
          type: number
        baseVolume:
          type: number
        indexPrice:
          type: number
        markPrice:
          type: number
      required:
        - symbol
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Required when calling the hosted API directly (curl, requests, fetch).
        SDK users pass credentials via constructor params instead.

````