# CoinRango WSS

{% hint style="info" %}
**Under Development:** More info to be disclosed soon
{% endhint %}

CoinRango.com is a cryptocurrency tracking platform that provides real-time streaming data for cryptocurrency prices, volume, and trading activity via a WebSocket API. The WebSocket API allows developers to build applications that can receive real-time updates for various cryptocurrency trading pairs.

The CoinRango WebSocket API provides three channels for subscribing to real-time updates: `prices`, `volume`, and `trades`. The `prices` channel provides real-time updates for cryptocurrency prices, the `volume` channel provides real-time updates for cryptocurrency trading volume, and the `trades` channel provides real-time updates for cryptocurrency trades.

When a user subscribes to a channel, the WebSocket API will immediately start streaming data for that channel in real-time. The data will be sent to the client application in JSON format, with each message containing an array of objects representing the current state of the market.

The CoinRango WebSocket API is useful for developers who want to build applications that require real-time data updates for cryptocurrency prices, volume, and trading activity. Applications such as cryptocurrency trading bots, price trackers, and market analysis tools can benefit from the real-time data provided by the CoinRango WebSocket API.

Overall, the CoinRango WebSocket API is a powerful tool for developers who want to build real-time cryptocurrency applications, and it provides an easy way to access up-to-date market data for various cryptocurrency trading pairs.

#### WebSocket API

The WebSocket API provides real-time streaming data for cryptocurrency prices, volume, and trading activity. You can subscribe to one or more channels to receive updates when new data is available.

#### Connect to the WebSocket server

To connect to the WebSocket server, use the following URL:

```javascript
javascriptCopy codewss://coinrango.com/ws
```

#### Subscribing to channels

To subscribe to a channel, send a JSON message to the WebSocket server with the following format:

```json
jsonCopy code{
    "action": "subscribe",
    "channel": "CHANNEL_NAME"
}
```

Replace `CHANNEL_NAME` with the name of the channel you want to subscribe to. The available channels are:

* `prices`: real-time price updates for cryptocurrencies
* `volume`: real-time volume updates for cryptocurrencies
* `trades`: real-time trade updates for cryptocurrencies

#### Unsubscribing from channels

To unsubscribe from a channel, send a JSON message to the WebSocket server with the following format:

```json
jsonCopy code{
    "action": "unsubscribe",
    "channel": "CHANNEL_NAME"
}
```

Replace `CHANNEL_NAME` with the name of the channel you want to unsubscribe from.

#### Price updates

When you subscribe to the `prices` channel, you will receive real-time updates for cryptocurrency prices. Each message will be in the following format:

```json
jsonCopy code{
    "channel": "prices",
    "data": [
        {
            "symbol": "BTC/USD",
            "price": 50000.0
        },
        {
            "symbol": "ETH/USD",
            "price": 1500.0
        }
    ]
}
```

The `data` field contains an array of objects, where each object represents a cryptocurrency and its current price. The `symbol` field is a string representing the trading pair, and the `price` field is a float representing the current price.

#### Volume updates

When you subscribe to the `volume` channel, you will receive real-time updates for cryptocurrency volume. Each message will be in the following format:

```json
jsonCopy code{
    "channel": "volume",
    "data": [
        {
            "symbol": "BTC/USD",
            "volume": 1234.56
        },
        {
            "symbol": "ETH/USD",
            "volume": 789.01
        }
    ]
}
```

The `data` field contains an array of objects, where each object represents a cryptocurrency and its 24-hour trading volume. The `symbol` field is a string representing the trading pair, and the `volume` field is a float representing the 24-hour trading volume.

#### Trade updates

When you subscribe to the `trades` channel, you will receive real-time updates for cryptocurrency trades. Each message will be in the following format:

```json
jsonCopy code{
    "channel": "trades",
    "data": [
        {
            "symbol": "BTC/USD",
            "price": 50000.0,
            "volume": 1.0,
            "side": "buy",
            "timestamp": 1615598200
        },
        {
            "symbol": "ETH/USD",
            "price": 1500.0,
            "volume": 2.5,
            "side": "sell",
            "timestamp": 1615598260
        }
    ]
}
```

The `data` field contains an array of objects, where each object represents a cryptocurrency trade. The `symbol` field is a string representing the trading pair, the `price` field is a float representing the trade price, the `volume` field is a float representing
