Rates provide aggregated price and volume data for cryptocurrencies across all exchanges. They represent the consolidated market data that Coinranking calculates for each coin.
The fastest way to get new rates is to subscribe to them in real-time. You can request rates through our coins endpoints too, but they will only update once a minute. A real-time connection pushes new rates as soon as they are calculated, so you get the latest price and 24 hour volume without polling.
Rates are available over both transports, with the same query parameters and the same messages:
wss://api.coinranking.com/v2/real-time/rates
https://api.coinranking.com/v2/real-time/sse/rates
How to authenticate, connect, and reconnect is described on the WebSockets and Server-Sent Events pages. Not sure which one to use? See choosing a transport.
Add the parameters to either URL. Choose one subscription parameter, currency-uuids[] or list, and optionally a throttle.
| Parameter | Description |
|---|---|
currency-uuids[] Array |
With the currency UUIDs parameter, you can select which coins to subscribe to. 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 UUIDs you can subscribe to within one connection. You can find UUIDs for all our coins in our dedicated reference currency endpoint
Note: Use array notation in the URL: Example:
?currency-uuids[]=Qwsogvtv82FCd¤cy-uuids[]=razxDUgYGNAdQ
|
list String |
Subscribe to the rates of all coins instead of a selection. This is a high-volume stream, so make sure your client keeps up with it. Allowed values: allExample:
?list=all
|
throttle (optional) String |
With the throttle parameter, you prevent getting overloaded with rates. This is useful if performance is an issue, e.g. when streaming rates to your frontend and you want to prevent straining your client's 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 Allowed values: 1s 10s Example:
?currency-uuids[]=Qwsogvtv82FCd&throttle=10s
|
WebSockets only. On an open WebSocket, you can change your subscription by sending a JSON message, without reconnecting. See subscription messages for how they work. A Server-Sent Events stream cannot be changed: close it and open a new stream with the new parameters instead.
json{
"throttle": "10s",
"currencyUuids": ["Qwsogvtv82FCd", "razxDUgYGNAdQ"]
}
More examples, including subscription messages and a fetch-based stream reader, are on the WebSockets and Server-Sent Events pages.
When subscribed to rates, you receive aggregated price and volume data for cryptocurrencies. Rates represent consolidated market data calculated by Coinranking across all exchanges, providing a single unified price and 24-hour volume for each coin. Each rate message includes the currency UUID to identify which cryptocurrency the data represents, making it easy to track multiple coins simultaneously.
json{
"type": "rate",
"currencyUuid": "Qwsogvtv82FCd",
"price": "125423.835504191964312353",
"volume": "6270550403.287645846237386287"
}
A confirmation lists what you are subscribed to and with which throttle. A Server-Sent Events stream sends it as its first message; a WebSocket sends it in answer to a subscription message.
json{
"type": "confirmation",
"topic": "rate",
"throttle": "10s",
"subscriptions": ["Qwsogvtv82FCd", "razxDUgYGNAdQ"]
}
When subscribed to one or more coins, you receive new rates whenever they are available. Each of these rates includes the UUID of the coin the rate pertains to, which is especially useful when you are subscribed to multiple coins. Rates include the latest price and 24-hour moving volume, both in US dollars.
Unlike our coin endpoints, we do not support other reference currencies than US dollars in real-time. You can, however, subscribe to multiple coins, which allows you to calculate them yourself.
| Property | Description |
|---|---|
type String | The kind of message. Always |
currencyUuid String | The currency UUID of this rate. Useful if you subscribed to multiple currencies, in which case the UUID helps you determine to what coin the rate belongs. |
price String | The latest price of a coin, in US Dollar. |
volume String | The latest 24 hour volume of this coin (a moving sum), in US Dollar. |