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

# Overview

> Real-time market data streaming across prediction market exchanges

The Delphi Markets WebSocket API provides real-time streaming for price updates, orderbook snapshots, and trade executions across all supported exchanges.

## Supported streams

<CardGroup cols={3}>
  <Card title="Kalshi" icon="bolt" href="/ws-kalshi">
    Subscribe using `klsi_id`. Prices, orderbook (101-level depth), and trades.
  </Card>

  <Card title="Polymarket" icon="bolt" href="/ws-polymarket">
    Subscribe using `condition_id`. Prices, orderbook, and trades.
  </Card>

  <Card title="Predict.fun" icon="bolt" href="/ws-pfun">
    Subscribe using `market_id`. Prices, orderbook, and trades.
  </Card>

  <Card title="Limitless" icon="bolt" href="/ws-limitless">
    Subscribe using `market_id`. Prices, orderbook, and trades.
  </Card>

  <Card title="Gemini" icon="bolt" href="/ws-gemi">
    Subscribe using `market_id`. Prices, orderbook, and trades.
  </Card>

  <Card title="Manifold" icon="bolt" href="/ws-mani">
    Subscribe using `market_id`. Prices, orderbook, and trades.
  </Card>

  <Card title="Opinion" icon="bolt" href="/ws-opnm">
    Subscribe using `market_id`. Prices, orderbook, and trades.
  </Card>

  <Card title="ForecastEx" icon="bolt" href="/ws-fex">
    Subscribe using `market_id`. Prices and trades (no orderbook).
  </Card>

  <Card title="PredictIt" icon="bolt" href="/ws-prdi">
    Subscribe using `market_id`. Prices only.
  </Card>

  <Card title="Parlays" icon="bolt" href="/ws-parlays">
    Subscribe using `market_ids`. RFQ events and MVE trades. Requires Pro+ plan.
  </Card>
</CardGroup>

## How it works

1. **Connect** to the WebSocket endpoint for your exchange
2. **Subscribe** by sending a JSON message with market IDs and message types
3. **Receive** real-time updates as JSON messages
4. **Unsubscribe** or disconnect when done

## Common connection details

All WebSocket streams share these properties:

| Property              | Value                                 |
| --------------------- | ------------------------------------- |
| Protocol              | WebSocket (wss\://)                   |
| Authentication        | API key via `api_key` query parameter |
| Keepalive             | Ping every 54 seconds                 |
| Timeout               | 60 seconds without pong               |
| Default message types | Prices and orderbook                  |

## Subscription key reference

| Exchange    | Endpoint        | Subscription key | Message types             |
| ----------- | --------------- | ---------------- | ------------------------- |
| Kalshi      | `/ws/kalshi`    | `klsi_ids`       | prices, orderbook, trades |
| Polymarket  | `/ws/poly`      | `condition_ids`  | prices, orderbook, trades |
| Predict.fun | `/ws/pfun`      | `market_ids`     | prices, orderbook, trades |
| Limitless   | `/ws/limitless` | `market_ids`     | prices, orderbook, trades |
| Gemini      | `/ws/gemi`      | `market_ids`     | prices, orderbook, trades |
| Manifold    | `/ws/mani`      | `market_ids`     | prices, orderbook, trades |
| Opinion     | `/ws/opnm`      | `market_ids`     | prices, orderbook, trades |
| ForecastEx  | `/ws/fex`       | `market_ids`     | prices, trades            |
| PredictIt   | `/ws/prdi`      | `market_ids`     | prices                    |
| Parlays     | `/ws/parlays`   | `market_ids`     | rfq, mve\_trades          |

## Quick start

```javascript theme={"theme":"one-dark-pro"}
const ws = new WebSocket("wss://api.delphimarkets.com/ws/kalshi?api_key=YOUR_API_KEY");

ws.onopen = () => {
  ws.send(JSON.stringify({
    action: "subscribe",
    klsi_ids: ["KXBTCD-25FEB14-B55000"],
    message_types: ["prices", "orderbook", "trades"]
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(data);
};
```

See the individual stream pages for complete subscription fields, message schemas, and examples.
