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

# Ticker

> Subscribe to level 1 market data (top of book and recent trades)

<div className="api-banner">
  <span className="api-protocol ws">WSS</span>
  <span className="api-detail">ws.kraken.com/v2</span>
  <span className="api-tag">ticker</span>
</div>

The `ticker` channel streams level 1 market data, i.e. top of the book (best bid/offer) and recent trade data.

The feed accepts a list of symbols for subscription and the updates are generated on trade events.

## Subscribe

<Tabs>
  <Tab title="Request">
    <ResponseField name="method" type="string" required>
      Value: `subscribe`
    </ResponseField>

    <ResponseField name="params" type="object" required>
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `ticker`
        </ResponseField>

        <ResponseField name="symbol" type="string[]" required>
          <span className="field-attr">Example:</span> `["BTC/USD", "MATIC/GBP"]`

          A list of currency pairs.
        </ResponseField>

        <ResponseField name="event_trigger" type="string">
          <span className="field-attr">One of:</span> `bbo`, `trades`<br />
          <span className="field-attr">Default:</span> `trades`

          The book event that causes a new ticker update to be published on the channel.

          * `bbo`: on a change in the best-bid-offer price levels.
          * `trades`: on every trade.
        </ResponseField>

        <ResponseField name="snapshot" type="boolean">
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Default:</span> `true`

          Request a snapshot after subscribing.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="req_id" type="integer">
      Optional client originated request identifier sent as acknowledgment in the response.
    </ResponseField>
  </Tab>

  <Tab title="Response">
    <ResponseField name="method" type="string" required>
      Value: `subscribe`
    </ResponseField>

    <ResponseField name="result" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `ticker`
        </ResponseField>

        <ResponseField name="symbol" type="string" required>
          <span className="field-attr">Example:</span> `"BTC/USD"`

          The currency pair associated with this subscription.
        </ResponseField>

        <ResponseField name="snapshot" type="boolean">
          <span className="field-attr">One of:</span> `true`, `false`

          Indicates if a snapshot is requested.
        </ResponseField>

        <ResponseField name="warnings" type="string[]">
          An advisory message, highlighting deprecated fields or upcoming changes to the channel.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="success" type="boolean">
      Indicates if the request was successfully processed by the engine. One of: `true`, `false`
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message. Condition: if `success` is `false`.
    </ResponseField>

    <ResponseField name="time_in" type="string">
      The timestamp when the subscription was received on the wire, just prior to parsing data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

    <ResponseField name="time_out" type="string">
      The timestamp when the acknowledgement was sent on the wire, just prior to transmitting data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

    <ResponseField name="req_id" type="integer">
      Optional client originated request identifier sent as acknowledgment in the response.
    </ResponseField>
  </Tab>
</Tabs>

## Snapshot / Update

The snapshot and update responses share the same schema. An update message is streamed on a trade event.

<ResponseField name="channel" type="string">
  Value: `ticker`
</ResponseField>

<ResponseField name="type" type="string">
  <span className="field-attr">One of:</span> `snapshot`, `update`
</ResponseField>

<ResponseField name="data" type="object[]">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="ask" type="float">Best ask price.</ResponseField>
    <ResponseField name="ask_qty" type="float">Best ask quantity.</ResponseField>
    <ResponseField name="bid" type="float">Best bid price.</ResponseField>
    <ResponseField name="bid_qty" type="float">Best bid quantity.</ResponseField>
    <ResponseField name="change" type="float">24-hour price change (in quote currency).</ResponseField>
    <ResponseField name="change_pct" type="float">24-hour price change (in percentage points).</ResponseField>
    <ResponseField name="high" type="float">24-hour highest trade price.</ResponseField>
    <ResponseField name="last" type="float">Last traded price (only guaranteed if traded within the past 24 hours).</ResponseField>
    <ResponseField name="low" type="float">24-hour lowest trade price.</ResponseField>

    <ResponseField name="symbol" type="string">
      <span className="field-attr">Example:</span> `"BTC/USD"`

      The symbol of the currency pair.
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      <span className="field-attr">Format:</span> RFC3339<br />
      <span className="field-attr">Example:</span> `2022-12-25T09:30:59.123456Z`

      The ticker data timestamp.
    </ResponseField>

    <ResponseField name="volume" type="float">24-hour traded volume (in base currency terms).</ResponseField>
    <ResponseField name="vwap" type="float">24-hour volume weighted average price.</ResponseField>
  </Expandable>
</ResponseField>

## Unsubscribe

<Tabs>
  <Tab title="Request">
    <ResponseField name="method" type="string" required>
      Value: `unsubscribe`
    </ResponseField>

    <ResponseField name="params" type="object" required>
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `ticker`
        </ResponseField>

        <ResponseField name="symbol" type="string[]" required>
          <span className="field-attr">Example:</span> `["BTC/USD", "MATIC/GBP"]`

          A list of currency pairs.
        </ResponseField>

        <ResponseField name="event_trigger" type="string">
          <span className="field-attr">One of:</span> `bbo`, `trades`<br />
          <span className="field-attr">Default:</span> `trades`

          The book event that causes a new ticker update to be published on the channel.

          * `bbo`: on a change in the best-bid-offer price levels.
          * `trades`: on every trade.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="req_id" type="integer">
      Optional client originated request identifier sent as acknowledgment in the response.
    </ResponseField>
  </Tab>

  <Tab title="Response">
    <ResponseField name="method" type="string" required>
      Value: `unsubscribe`
    </ResponseField>

    <ResponseField name="result" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `ticker`
        </ResponseField>

        <ResponseField name="symbol" type="string" required>
          <span className="field-attr">Example:</span> `"BTC/USD"`

          The currency pair associated with this subscription.
        </ResponseField>

        <ResponseField name="event_trigger" type="string">
          <span className="field-attr">One of:</span> `bbo`, `trades`<br />
          <span className="field-attr">Default:</span> `trades`

          The book event that causes a new ticker update to be published on the channel.

          * `bbo`: on a change in the best-bid-offer price levels.
          * `trades`: on every trade.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="success" type="boolean">
      Indicates if the request was successfully processed by the engine. One of: `true`, `false`
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message. Condition: if `success` is `false`.
    </ResponseField>

    <ResponseField name="time_in" type="string">
      The timestamp when the subscription was received on the wire, just prior to parsing data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

    <ResponseField name="time_out" type="string">
      The timestamp when the acknowledgement was sent on the wire, just prior to transmitting data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

    <ResponseField name="req_id" type="integer">
      Optional client originated request identifier sent as acknowledgment in the response.
    </ResponseField>
  </Tab>
</Tabs>

<Panel>
  <CodeGroup>
    ```json Subscribe Request theme={null}
    {
        "method": "subscribe",
        "params": {
            "channel": "ticker",
            "symbol": [
                "ALGO/USD"
            ]
        }
    }
    ```

    ```json Subscribe Response theme={null}
    {
        "method": "subscribe",
        "result": {
            "channel": "ticker",
            "snapshot": true,
            "symbol": "ALGO/USD"
        },
        "success": true,
        "time_in": "2023-09-25T09:04:31.742599Z",
        "time_out": "2023-09-25T09:04:31.742648Z"
    }
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Snapshot theme={null}
    {
        "channel": "ticker",
        "type": "snapshot",
        "data": [
            {
                "symbol": "ALGO/USD",
                "bid": 0.10025,
                "bid_qty": 740.0,
                "ask": 0.10036,
                "ask_qty": 1361.44813783,
                "last": 0.10035,
                "volume": 997038.98383185,
                "vwap": 0.10148,
                "low": 0.09979,
                "high": 0.10285,
                "change": -0.00017,
                "change_pct": -0.17,
                "timestamp": "2023-09-25T09:04:31.742648Z"
            }
        ]
    }
    ```

    ```json Update theme={null}
    {
        "channel": "ticker",
        "type": "update",
        "data": [
            {
                "symbol": "ALGO/USD",
                "bid": 0.10025,
                "bid_qty": 740.0,
                "ask": 0.10035,
                "ask_qty": 740.0,
                "last": 0.10035,
                "volume": 997038.98383185,
                "vwap": 0.10148,
                "low": 0.09979,
                "high": 0.10285,
                "change": -0.00017,
                "change_pct": -0.17,
                "timestamp": "2023-09-25T09:04:31.742648Z"
            }
        ]
    }
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Unsubscribe Request theme={null}
    {
        "method": "unsubscribe",
        "params": {
            "channel": "ticker",
            "symbol": [
                "ALGO/USD"
            ]
        }
    }
    ```

    ```json Unsubscribe Response theme={null}
    {
        "method": "unsubscribe",
        "result": {
            "channel": "ticker",
            "event_trigger": "trades",
            "symbol": "ALGO/USD"
        },
        "success": true,
        "time_in": "2023-09-25T09:04:31.742599Z",
        "time_out": "2023-09-25T09:04:31.742648Z"
    }
    ```
  </CodeGroup>
</Panel>
