> ## 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.

# Spread

> Subscribe to spread feed for currency pairs

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

Spread feed for a currency pair. Provides the best bid and ask prices along with their volumes.

## Subscribe

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

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

      The currency pairs for this request.
    </ResponseField>

    <ResponseField name="subscription" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="name" type="string" required>
          Value: `spread`
        </ResponseField>
      </Expandable>
    </ResponseField>

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

  <Tab title="Response">
    The subscription status is returned via the [subscriptionStatus](/exchange/api-reference/spot-websocket-v1/subscriptionstatus) message.
  </Tab>
</Tabs>

## Snapshot / Update

<ResponseField name="" type="array">
  <Expandable title="elements" defaultOpen>
    <ResponseField name="[0] channel_id" type="integer" deprecated>
      <span className="field-attr">Deprecated:</span> use `channelName` and `pair`

      Channel identifier.
    </ResponseField>

    <ResponseField name="[1] spread" type="array">
      <Expandable title="elements">
        <ResponseField name="[0] bid" type="string">Bid price.</ResponseField>
        <ResponseField name="[1] ask" type="string">Ask price.</ResponseField>

        <ResponseField name="[2] timestamp" type="string">
          Time of the current top-of-book quote, in seconds since epoch. This reflects the creation time of the best bid/ask order(s) currently resting at the top of book, not the time the message was generated. Because of this, the value is not monotonic: when the top of book changes to an order that was already resting in the book (for example after a trade), this timestamp may move backwards relative to the previous message. This is expected and does not indicate stale or dropped data.
        </ResponseField>

        <ResponseField name="[3] bid_volume" type="string">Bid Volume.</ResponseField>
        <ResponseField name="[4] ask_volume" type="string">Ask Volume.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="[2] pair" type="string">
      <span className="field-attr">Example:</span> `"BTC/USD"`

      The symbol of the currency pair.
    </ResponseField>

    <ResponseField name="[3] channel_name" type="string">
      Value: `spread`
    </ResponseField>
  </Expandable>
</ResponseField>

## Unsubscribe

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

    <ResponseField name="pair" type="string[]">
      <span className="field-attr">Example:</span> `["BTC/USD", "MATIC/GBP"]`<br />
      <span className="field-attr">Condition:</span> All channels which support pair subscriptions

      The currency pairs to unsubscribe.
    </ResponseField>

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

    <ResponseField name="subscription" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="name" type="string" required>
          Value: `spread`
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="Response">
    The unsubscription status is returned via the [subscriptionStatus](/exchange/api-reference/spot-websocket-v1/subscriptionstatus) message.
  </Tab>
</Tabs>

<Panel>
  <CodeGroup>
    ```json Subscribe theme={null}
    {
      "event": "subscribe",
      "pair": [
        "XBT/EUR"
      ],
      "subscription": {
        "name": "spread"
      }
    }
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Snapshot / Update theme={null}
    [
      0,
      [
        "5698.40000",
        "5700.00000",
        "1542057299.545897",
        "1.01234567",
        "0.98765432"
      ],
      "spread",
      "XBT/USD"
    ]
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Unsubscribe theme={null}
    {
      "event": "unsubscribe",
      "pair": [
        "XBT/EUR"
      ],
      "subscription": {
        "name": "spread"
      }
    }
    ```
  </CodeGroup>
</Panel>
