Real-time

The fastest way to get new rates is to subscribe to our WebSockets. With our WebSockets you can establish a persistent connection through which new rates are pushed, so you do not have to poll for new data points.

Authentication

The WebSocket protocol does not support regular HTTP headers, so it is not possible to use the x-access-token header when opening a new WebSocket. Authenticate to our WebSockets connections using a query parameter:

 wss://api.coinranking.com/v2/real-time/rates?x-access-token=your-api-key 

Do note that you need a pro subscription for all our websockets.

Subscribe to rates

professional This endpoint requires the professional plan or higher

Establish a WebSocket connection to get rates in real-time. There are two ways to subscribe to coins; directly establish a connection with subscriptions by using query parameters to select your subscriptions, or establish a connection and send a JSON message through the socket with the subscriptions you require.

GET /real-time/rates

https://api.coinranking.com/v2/real-time/rates

Query parameters

Parameter Description
uuids Array

With the UUIDs parameter, you can select which coins to subscribe to.

The UUIDs parameter is partly optional; you can choose to either subscribe to one or more coins, or you can subscribe to a list. Or both! But you have to at least select one list or one coin.

Provide a list of coin UUIDs to make your selection, use our other endpoints or our website to find the UUIDs of coins you want. There is a maximum of hundred coins you can subscribe to within one websocket.

Size range: 1-100

Example:
...real-time/rates?uuids[]=Qwsogvtv82FCd&uuids[]=razxDUgYGNAdQ
throttle (optional) String

With the throttle parameter, you prevent getting overloaded with rates. This is useful if performance is an issue, e.g. when using websockets in your frontend and want to prevent straining your client's their devices too much.

Throttling works per coin. If you select a throttle, this means rates for the same coin will not be pushed more than once within the specified duration. When you have subscribed to multiple coins, you still receive more messages within the specified duration.

You can choose between 1s (At least one second interval between a rate for each coin), 10s (fifteen seconds), or none (in which case you get every rate for all the coins that you subscribed to).

Default value: none
Allowed values:
none 1s 10s

Example:
...real-time/rates?throttle=10s

Code examples

Response

{
  "currencyUuid": "Qwsogvtv82FCd",
  "price": "59585.64479860372914892766",
  "volume": "33769051110.0956537043822976375655904"
}

Response fields

PropertyDescription
currencyUuid String

The currency of this rate

price String

The latest price of this coin

volume String

The latest volume of this coin