Exchange rates show the price and volume of specific cryptocurrencies on individual exchanges, unlike rates, which aggregate data from multiple exchanges.
The fastest way to get new exchange rates is to subscribe to them in real-time. You can request rates through our exchange coin listings endpoints too, but they will only update once a minute. A real-time connection pushes new exchange rates as soon as they are calculated, so you get the latest price and 24 hour volume without polling.
Exchange rates are available over both transports, with the same query parameters and the same messages:
wss://api.coinranking.com/v2/real-time/exchange-rates
https://api.coinranking.com/v2/real-time/sse/exchange-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, and optionally a throttle.
Important: You must choose only ONE of the following subscription parameters: references, exchange-uuids, currency-uuids, or list. You cannot mix different parameter types.
| Parameter | Description |
|---|---|
references[] Array |
Subscribe to specific exchange-currency pairs. Each reference must follow the format: This allows you to get rates for specific trading pairs on specific exchanges.
Note: Use array notation in the URL: Example:
?references[]=-zdvbieRdZ_Qwsogvtv82FCd
|
exchange-uuids[] Array |
Subscribe to all rates for specific exchanges. This will give you all currency rates available on the selected exchanges. Provide a list of exchange UUIDs to make your selection. You can find exchange UUIDs in our exchanges endpoint
Note: Use array notation in the URL: Example:
?exchange-uuids[]=-zdvbieRdZ
|
currency-uuids[] Array |
Subscribe to all rates for specific currencies across all exchanges. This will give you rates for the selected currencies from all available exchanges. Decentralized exchanges are only included with the Real-time DEX data add-on. Without the add-on, the subscription is accepted but carries centralized exchanges only. Provide a list of currency UUIDs to make your selection. You can find currency UUIDs in our reference currencies endpoint
Note: Use array notation in the URL: Example:
?currency-uuids[]=Qwsogvtv82FCd
|
list String |
Subscribe to the rates of all coins on all exchanges instead of a selection. This is a high-volume stream, so make sure your client keeps up with it. Decentralized exchanges are only included with the Real-time DEX data add-on. Without the add-on, the subscription is accepted but carries centralized exchanges only. Allowed values: allExample:
?list=all
|
throttle (optional) String |
With the throttle parameter, you prevent getting overloaded with exchange rates. This is useful if performance is an issue, e.g. when streaming exchange rates to your frontend and you want to prevent straining your client's devices too much. Throttling works per exchange-currency pair. If you select a throttle, this means rates for the same pair will not be pushed more than once within the specified duration. Default value: 1sAllowed values: 1s 10s Example:
?exchange-uuids[]=-zdvbieRdZ&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.
Choose only ONE subscription type per message:
json{
"exchangeUuids": ["-zdvbieRdZ", "TjMe3QlK0"],
"throttle": "10s"
}
Or using currency UUIDs:
json{
"currencyUuids": ["Qwsogvtv82FCd"],
"throttle": "10s"
}
Or using references:
json{
"references": ["-zdvbieRdZ_Qwsogvtv82FCd"],
"throttle": "10s"
}
More examples, including subscription messages and a fetch-based stream reader, are on the WebSockets and Server-Sent Events pages.
When subscribed to exchange rates, you receive price and volume updates for specific exchange-currency pairs. Each message includes both the exchange UUID and currency UUID, allowing you to identify which exchange the rate comes from and which cryptocurrency it represents. This is particularly useful when tracking the same currency across different exchanges or monitoring multiple trading pairs.
json{
"type": "exchange-rate",
"exchangeUuid": "-zdvbieRdZ",
"currencyUuid": "Qwsogvtv82FCd",
"exchangeType": "cex",
"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": "exchange-rate",
"throttle": "10s",
"subscriptions": ["exchange:-zdvbieRdZ", "exchange:TjMe3QlK0"]
}
When subscribed to exchange rates, you receive new rates whenever they are available. Each exchange rate includes the UUID of both the exchange and currency, which is especially useful when you are subscribed to multiple exchanges or currencies. Exchange rates include the latest price and 24-hour moving volume, both in US dollars.
Unlike our exchange coin listings endpoints, we do not support other reference currencies than US dollars in real-time. You can, however, subscribe to multiple exchanges and currencies, which allows you to calculate them yourself.
| Property | Description |
|---|---|
type String | The kind of message. Always |
exchangeUuid String | The exchange UUID of this rate. Useful if you subscribed to multiple exchanges, in which case the UUID helps you determine which exchange the rate comes from. |
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. |
exchangeType String | The type of exchange: |
price String | The latest price of the coin on this exchange, in US Dollar. |
volume String | The latest 24 hour volume of this currency on this exchange (a moving sum), in US Dollar. |