# Ticker

## Ticker data

This guide explains how to use the WebSocket API to subscribe to market data updates via the `/ticker` channel.

***

### Overview

The WebSocket API allows clients to receive real-time market data updates. Subscribing to the `/ticker` channel provides updates for market ticker data, including prices, bids, asks, and quantities.

***

### Channel

#### `/ticker/*`

* Subscribe to get ticker data from all active markets.

#### `/ticker/bytradingpair/{market symbol}`

* Subscribe to get ticker data from specific markets
* Client may be subscribed to many markets at the same time.

***

### Subscription

```json
{
    "id": "94c68f6e-44ba-46ec-b9fb-4eb7addfe5ea",
    "type": "subscribe",
    "channel": "ticker/*",
    "authorization": {
        "host": "vfqqino6svadzoqkann4355in4.appsync-api.eu-central-1.amazonaws.com",
        "x-amz-date": "20250117T133706Z",
        "x-api-key": "da2-vjlcb7rsira4bggsctnmzcjvwe"
    }
}
```

```
{"id":"94c68f6e-44ba-46ec-b9fb-4eb7addfe5ea","type":"subscribe_success"}
```

***

### Market Data Model

When subscribed to the `/ticker` channel, the server sends market data updates in the following format:

Content type: application/json

#### Example message

```json
{
  "channel": "ticker",
  "data": [
    {
      "symbol": "AMDIIIAX/EUROe",
      "lastPrice": 120.2,
      "bestBid": 120.05,
      "bestBidQuantity": 36,
      "bestAsk": 120.2,
      "bestAskQuantity": 150.5,
      "time": "2024-12-16T12:28:22.462Z"
    }
  ]
}
```

#### Field Descriptions

| Field             | Type     | Description                                       |
| ----------------- | -------- | ------------------------------------------------- |
| `channel`         | `string` | The name of the channel (`ticker`).               |
| `data`            | `array`  | An array of market data objects.                  |
| `symbol`          | `string` | The trading pair symbol (e.g., `AMDIIIAX/EUROe`). |
| `lastPrice`       | `number` | The last traded price.                            |
| `bestBid`         | `number` | The best bid price available.                     |
| `bestBidQuantity` | `number` | Quantity available at the best bid price.         |
| `bestAsk`         | `number` | The best ask price available.                     |
| `bestAskQuantity` | `number` | Quantity available at the best ask price.         |
| `time`            | `string` | Timestamp of the data update (ISO 8601 format).   |

***


---

# Agent Instructions: 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:

```
GET https://docs.21x.eu/websocket-api/ticker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
