---
title: "Markets WebSocket — stream real-time market price updates"
method: GET
path: "/api/v2/ws/markets"
tags: ["V2 WebSocket"]
---

# Markets WebSocket — stream real-time market price updates

`GET /api/v2/ws/markets`

Establishes a WebSocket connection for streaming V2 market price changes in real-time.

**Connection**: `wss://therundown.io/api/v2/ws/markets?key=YOUR_API_KEY`

**Filter parameters** (query string):
- `affiliate_ids` — comma-separated affiliate IDs
- `sport_ids` — comma-separated sport IDs
- `event_ids` — comma-separated event IDs
- `market_ids` — comma-separated market IDs

All filters are optional. If none are specified, all messages are received.

**Heartbeat**: Server sends `{"meta":{"type":"heartbeat"},"data":{"now":"<RFC3339>"}}` every 15 seconds.

**Message format**:
```json
{
  "meta": {...},
  "data": {
    "affiliate_id": 19,
    "sport_id": 4,
    "event_id": "abc123",
    "market_id": 1,
    ...
  }
}
```

**Queue**: 1024-message buffer per client. If the client falls behind, messages are dropped.

## Query parameters

- `affiliate_ids` string
- `sport_ids` string
- `event_ids` string
- `market_ids` string

## Other responses

- `101` — WebSocket upgrade successful

---

[API](https://skmtc.net/therundown/apis/therundown-sports-api.md) · [All operations](https://skmtc.net/therundown/apis/therundown-sports-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/therundown/therundown-sports-api/versions/f069d4e82f52/schema)
