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

# Book

> Subscribe to order book data

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

The `book` feed returns information about the order book.

***

## Request

<ResponseField name="event" type="string" required>
  `subscribe` or `unsubscribe`
</ResponseField>

<ResponseField name="feed" type="string" required>
  The requested subscription feed. Value: `book`
</ResponseField>

<ResponseField name="product_ids" type="list of strings" required>
  A list of strings which represent the products that user will receive information upon.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribe",
    "feed": "book",
    "product_ids": ["PF_XBTUSD"]
  }
  ```
</CodeGroup>

***

## Response Success

<ResponseField name="event" type="string">
  <span className="field-attr">One of:</span> `subscribed`, `subscribed_failed`, `unsubscribed`, `unsubscribed_failed`

  The result.
</ResponseField>

<ResponseField name="feed" type="string">
  The requested subscription feed. Value: `book`
</ResponseField>

<ResponseField name="product_ids" type="list of strings" required>
  A list of strings which represent the products that user will receive information upon.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribed",
    "feed": "book",
    "product_ids": ["PF_XBTUSD"]
  }
  ```
</CodeGroup>

***

## Response Snapshot

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="product_id" type="string">
  The subscribed product (referred also as instrument or symbol).
</ResponseField>

<ResponseField name="seq" type="positive integer">
  The subscription message sequence number.
</ResponseField>

<ResponseField name="timestamp" type="positive integer">
  Timestamp in milliseconds.
</ResponseField>

<ResponseField name="tickSize" type="string">
  Always null.
</ResponseField>

<ResponseField name="bids" type="list of structures">
  <Expandable title="properties">
    <ResponseField name="qty" type="positive float">The quantity of the entry.</ResponseField>
    <ResponseField name="price" type="positive float">The price of the entry.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="asks" type="list of structures">
  <Expandable title="properties">
    <ResponseField name="qty" type="positive float">The quantity of the entry.</ResponseField>
    <ResponseField name="price" type="positive float">The price of the entry.</ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "feed": "book_snapshot",
    "product_id": "PF_XBTUSD",
    "timestamp": 1612269825817,
    "seq": 326072249,
    "tickSize": null,
    "bids": [
      {
        "price": 34892.5,
        "qty": 6385
      },
      {
        "price": 34892,
        "qty": 10924
      }
    ],
    "asks": [
      {
        "price": 34911.5,
        "qty": 20598
      },
      {
        "price": 34912,
        "qty": 2300
      }
    ]
  }
  ```
</CodeGroup>

***

## Response Delta

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="product_id" type="string">
  The subscribed product (referred also as instrument or symbol).
</ResponseField>

<ResponseField name="seq" type="positive integer">
  The subscription message sequence number.
</ResponseField>

<ResponseField name="timestamp" type="positive integer">
  Timestamp in milliseconds.
</ResponseField>

<ResponseField name="side" type="string">
  The side of the entry.
</ResponseField>

<ResponseField name="price" type="positive float">
  The price of the entry.
</ResponseField>

<ResponseField name="qty" type="positive float">
  The quantity of the entry.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "feed": "book",
    "product_id": "PF_XBTUSD",
    "side": "sell",
    "seq": 326094134,
    "price": 34981,
    "qty": 0,
    "timestamp": 1612269953629
  }
  ```
</CodeGroup>

***

## Response Error

<ResponseField name="event" type="string">
  Value: `error`
</ResponseField>

<ResponseField name="message" type="string">
  <span className="field-attr">One of:</span> `Invalid product id`, `Invalid feed`, `Json Error`

  An error message.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "error",
    "message": "Invalid product id"
  }
  ```
</CodeGroup>
