# Prices

The price feed provides real-time Bid/Ask price levels of up to a depth of 10 for the available symbols.

#### Listing available symbols <a href="#listing-available-symbols" id="listing-available-symbols"></a>

The symbols available for subscription can be fetched by sending a message of type `info` and with the topic set to `available-symbols`.

```
{
  "messageType": "info",
  "topic": "available-symbols",
  "key": "API_PUBLIC_KEY",
  "passphrase": "PASSPHRASE",
  "timestamp": "TIMESTAMP",
  "signature": "SIGNATURE"
}
```

> Available symbols response

```
{
  "messageType": "info",
  "topic": "available-symbols",
  "body": {
    "message": [
      "BTC/e₹",
      "ETH/e₹",
      "LTC/e₹",
      ...
    ]
  }
}
```

#### Subscribing to a Symbol <a href="#subscribing-to-a-symbol" id="subscribing-to-a-symbol"></a>

In order to subscribe to the price feed, a message of type `subscribe` must be sent.

```
{
  "messageType": "subscribe",
  "topic": "prices",
  "body": {
    "filter": {
      "symbol": "BTC/e₹"
    }
  },
  "key": "API_PUBLIC_KEY",
  "passphrase": "PASSPHRASE",
  "timestamp": "TIMESTAMP",
  "signature": "SIGNATURE"
}
```

<table><thead><tr><th width="175">Parameter</th><th width="395.3333333333333">Description</th><th>Type</th></tr></thead><tbody><tr><td>body{}</td><td>An object used to filter which symbol will be subscribed to. This is a required field for the price feed.</td><td>object</td></tr><tr><td>messageType</td><td>Subscription message type - <code>subscribe</code></td><td>string</td></tr><tr><td>topic</td><td>Topic to subscribe to - <code>prices</code> for the price feed</td><td>string</td></tr><tr><td>key</td><td>Your public key</td><td>string</td></tr><tr><td>passphrase</td><td>Your passphrase</td><td>string</td></tr><tr><td>timestamp</td><td>Time in seconds since Unix Epoch</td><td>string</td></tr><tr><td>signature</td><td>your hmac signature</td><td>string</td></tr></tbody></table>

> Subscription response

```
{
  "body": "Successfully subscribed to the BTC/e₹ feed",
  "messageType": "Subscribe"
}
```

#### Price update <a href="#price-update" id="price-update"></a>

After successfully subscribing to a symbol, you will be sent `price-updated` messages whenever the price is updated.

<table><thead><tr><th width="172.33333333333331">Parameter</th><th width="411">Description</th><th>Type</th></tr></thead><tbody><tr><td>bid_levels[]</td><td>Array of Bid price levels (up to a depth of 10)</td><td>string</td></tr><tr><td>ask_levels[]</td><td>Array of Ask price levels (up to a depth of 10)</td><td>string</td></tr><tr><td>symbol</td><td>The symbol which was subscribed to</td><td>string</td></tr><tr><td>messageType</td><td>Price update message type - <code>price-update</code></td><td>string</td></tr></tbody></table>

The price level object comprises these fields:

<table><thead><tr><th width="150.33333333333331">Parameter</th><th width="358">Description</th><th>Type</th></tr></thead><tbody><tr><td>price</td><td>The level price</td><td>string</td></tr><tr><td>quantity</td><td>The level quantity</td><td>string</td></tr><tr><td>side</td><td>The level side - <code>buy</code> or <code>sell</code></td><td>string</td></tr></tbody></table>

```
{
  "messageType": "price-update",
  "body": {
    "symbol": "BTC/e₹",
    "bid_levels": [
      {
        "price": "17260.4677",
        "quantity": "4.50",
        "side": "buy"
      },
      {
        "price": "17255.445175",
        "quantity": "2.77",
        "side": "buy"
      },
      {
        "price": "17251.475275",
        "quantity": "2.55",
        "side": "buy"
      },
      {
        "price": "17245.941475",
        "quantity": "3.34",
        "side": "buy"
      }
    ],
    "ask_levels": [
      {
        "price": "17317.16195",
        "quantity": "14.59",
        "side": "sell"
      },
      {
        "price": "17320.83275",
        "quantity": "65.77",
        "side": "sell"
      },
      {
        "price": "17324.872625",
        "quantity": "15.54",
        "side": "sell"
      },
      {
        "price": "17330.139425",
        "quantity": "9.09",
        "side": "sell"
      }
    ]
  }
}
```
