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

# WebSocket feed channels - bookmakers, currencies, fixtures, scores, clocks, odds

> How the market data channels of the Apexium API WebSocket work: load the state from /v1/{lang}, apply the changes, and reload on snapshot_required.

The feed channels carry OddsPapi v5 market data. Their payloads are OddsPapi's, unchanged except for the bookmakers, which are limited to your account.

## Channels

| Channel | Carries | Payload, field by field |
| - | - | - |
| `bookmakers` | Bookmaker-level changes on a fixture | [OddsPapi `bookmakers`](https://docs.oddspapi.io/websocket/channels/bookmakers) |
| `currencies` | Exchange rates | [OddsPapi `currencies`](https://docs.oddspapi.io/websocket/channels/currencies) |
| `fixtures` | Fixture changes: schedule, status, participants | [OddsPapi `fixtures`](https://docs.oddspapi.io/websocket/channels/fixtures) |
| `scores` | Score changes | [OddsPapi `scores`](https://docs.oddspapi.io/websocket/channels/scores) |
| `clocks` | Match clock changes | [OddsPapi `clocks`](https://docs.oddspapi.io/websocket/channels/clocks) |
| `odds` | Odds changes of your bookmakers | [OddsPapi `odds`](https://docs.oddspapi.io/websocket/channels/odds) |

The [OddsPapi WebSocket channels](https://docs.oddspapi.io/websocket/channels) documentation describes them together.

## Load, then apply changes

The feed channels carry **changes only**. They never send the current state of a fixture. Build it in three steps:

**1. Connect and log in**

Open the socket and log in with the channels and fixtures you want. Keep the messages that arrive from now on.

**2. Load the state**

Read the fixtures and their odds from `/v1/{lang}`, for example [`GET /v1/en/fixtures/odds`](https://docs.apexiumbet.com/api-reference/market-data).

**3. Apply the changes**

Apply the messages you kept, then every new one, on top of what you loaded.

Connecting before loading means no change is lost between the two. A change that was already in the loaded state is harmless to apply again.

## Reload on `snapshot_required`

When Apexium cannot guarantee that you received every change, it tells you which channels to reload:

```json theme={null}
{ "type": "snapshot_required", "reason": "feed_interrupted", "channels": ["odds", "scores"] }
```

Load the state of these channels again from `/v1/{lang}`, then keep applying the messages. This happens when:

* **The feed source was interrupted** and Apexium has just subscribed to it again.
* **Apexium fell behind the feed** by more than one second: it discards what it could not send in time rather than send old prices, and asks the clients concerned to reload.

Every message sent before `snapshot_required` is older than the state you reload.

A connection receives `snapshot_required` at most once every 10 seconds, which leaves you time to reload. Channels that need a reload within those 10 seconds come in one `snapshot_required` when they end.

## What you receive

* **`odds` and `bookmakers`** come for the fixtures in your `fixtureIds` only. Following a sport or a tournament does not bring its odds.
* **`fixtures`, `scores` and `clocks`** come for your `fixtureIds`, and for every fixture of your `tournamentIds` and `sportIds`.
* **`currencies`** comes to every connection on the channel.
* **Bookmakers.** Odds carry only the bookmakers of your account, except any closed to the API. A message left with none of them is not sent.
* **Language.** `fixtures` follows the `lang` of your login. See [Languages](https://docs.apexiumbet.com/websocket/overview.md#languages).

Odds are most of the feed, so you follow them fixture by fixture, within the [fixture limit](https://docs.apexiumbet.com/websocket/close-codes.md#4004) of your account. To trade a whole tournament:

1. Log in with its `tournamentIds` on `fixtures`, or read its fixtures from `/v1/{lang}`.
2. Send `{ "type": "subscribe", "fixtureIds": [...] }` with the fixtures you trade, and their odds start.
3. Send `unsubscribe` for a fixture once it is over, to free its place.

## Read too slowly, get closed

Apexium sends each client what it can absorb. A connection whose send buffer stays full is closed with `4002`, and the other clients are not slowed down. See [Close codes](https://docs.apexiumbet.com/websocket/close-codes.md#4002).

To keep up:

* **Use `zstd`.** It makes the feed about four times smaller. See [Encodings](https://docs.apexiumbet.com/websocket/encodings.md).
* **Read in its own task.** Decode and store each message quickly; do the slow work, such as pricing or database writes, elsewhere.
* **Follow what you use.** Every fixture in `fixtureIds` adds its odds to your stream.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.