> For the complete documentation index, see [llms.txt](https://docs.outpoll.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.outpoll.com/api/rest-api/websockets.md).

# Websockets

Use Websockets for low-latency market and account updates.

### Authentication models

Use the auth model required by each stream:

* No auth for Order Book, Chance History, Activity Feed, and Last Trades Feed
* In-band `AUTH` for Order Updates, Balance Updates, and Order Feed
* Private streams use API key auth only

{% hint style="info" %}
After reconnect, authenticate again and restore every subscription.
{% endhint %}

### Endpoint pages

* [Order Book](/api/rest-api/websockets/order-book.md) — real-time best bid, best ask, and last chance per outcome
* [Chance History](/api/rest-api/websockets/chance-history.md) — live probability updates and chart history
* [Account & History Streams](/api/rest-api/websockets/account-and-history-streams.md) — orders, balances, activity, and last trades
* [WebSocket API Reference](/api/rest-api/websockets/websocket-api-reference.md) — full auth, message, and stream reference

### Private stream auth

Send this message right after connect.

```json
{
  "t": "AUTH",
  "d": {
    "apiKey": "<API_KEY>",
    "signature": "<SIGNATURE>",
    "timestamp": "<UNIX_EPOCH_SECONDS>"
  }
}
```

Build `signature` from `timestamp + "GET" + path`.

### Stream groups

#### Public market data

Connect directly:

* `wss://order-book.outpoll.com/event/ws`
* `wss://chance-history-service.outpoll.com/ws`

#### Private account data

Send `AUTH` after connect:

* `wss://order-service.outpoll.com/order/ws`
* `wss://wallet-mutator-view.outpoll.com/balance/ws`
* `wss://history-service.outpoll.com/order/ws`

#### Public activity and trade broadcasts

No auth required:

* `wss://history-service.outpoll.com/history/ws`
* `wss://history-service.outpoll.com/last-trades/ws`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.outpoll.com/api/rest-api/websockets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
