The fastest way to get new tickers is to subscribe to our WebSockets. You can request tickers through our get market details endpoints too, but they will only update once a minute. With our WebSockets you can establish a persistent connection through which new tickers are pushed, so you get the latest ticker data whenever they are calculated.
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/tickers?x-access-token=your-api-key
Establish a WebSocket connection to get ticker data in real-time. There are two ways to subscribe to tickers; 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.
wss://api.coinranking.com/v2/real-time/tickers
You must choose only ONE of the following subscription parameters: market-uuids
, exchange-uuids
, currency-uuids
, or list
. You cannot mix different parameter types.
Parameter | Description |
---|---|
market-uuids Array |
Subscribe to specific market pairs. Provide a list of market UUIDs to get ticker data for specific trading pairs. This allows you to get ticker data for specific market pairs across exchanges. You can find market UUIDs in our markets endpoint Size range: 1-100Example:
...real-time/tickers?market-uuids[]=dj23kKgETIie
|
exchange-uuids Array |
Subscribe to all ticker data for specific exchanges. This will give you all ticker data available on the selected exchanges. Provide a list of exchange UUIDs to make your selection. You can find exchange UUIDs in our exchanges endpoint Size range: 1-100Example:
...real-time/tickers?exchange-uuids[]=-zdvbieRdZ
|
currency-uuids Array |
Subscribe to all ticker data for specific currencies across all exchanges. This will give you ticker data for the selected currencies from all available exchanges. Provide a list of currency UUIDs to make your selection. You can find currency UUIDs in our reference currencies endpoint Size range: 1-100Example:
...real-time/tickers?currency-uuids[]=Qwsogvtv82FCd
|
list (optional) String |
With the list parameter, you can subscribe to all ticker data. When set to all, you will receive ticker data for all market pairs from all exchanges. The default is to subscribe to none and filter using other UUID parameters. You can choose between none (no list is selected and you can use the other UUIDs parameter to filter the list) or all (every ticker from all exchanges). Default value: noneAllowed values: none all Example:
...real-time/tickers?list=all
|
throttle (optional) String |
With the throttle parameter, you prevent getting overloaded with ticker data. This is useful if performance is an issue, e.g. when using WebSockets in your frontend and want to prevent straining your client's devices too much. Throttling works per exchange-currency pair. If you select a throttle, this means ticker data for the same pair will not be pushed more than once within the specified duration. Default value: 1sAllowed values: 1s 10s Example:
...real-time/tickers?throttle=10s
|
json{
"marketUuid": "dj23kKgETIie",
"exchangeUuid": "zdvbieRdZ",
"baseUuid": "Qwsogvtv82FCd",
"quoteUuid": "cpjRxjFYD",
"exchangeType": "cex",
"close": "124590.91",
"price": "124590.91",
"baseVolume": "24290.53392",
"quoteVolume": "3036047751.1820064",
"volume": "3036047751.1820064",
"filters": []
}
When subscribed to tickers, you receive new ticker data whenever it is available. Each ticker includes the UUID of the market, exchange, base currency, and quote currency, which is especially useful when you are subscribed to multiple markets or exchanges. Tickers include the latest price, close price, and volume data, both in base and quote currencies, as well as in US dollars.
Unlike our market details endpoints, we do not support other reference currencies than US dollars with WebSockets. You can, however, subscribe to multiple markets and exchanges, which allows you to calculate them yourself.
Property | Description |
---|---|
marketUuid String | The market UUID of this ticker. Useful if you subscribed to multiple markets, in which case the UUID helps you determine which market the ticker belongs to. |
exchangeUuid String | The exchange UUID of this ticker. Useful if you subscribed to multiple exchanges, in which case the UUID helps you determine which exchange the ticker comes from. |
baseUuid String | The base currency UUID of this ticker. |
quoteUuid String | The quote currency UUID of this ticker. |
exchangeType String | The type of exchange: |
close String | The last price received from the market. For example in an ETH/BTC market the close price would be the ETH’s value in BTC |
price String | The latest price of the base currency in US Dollar. |
baseVolume String | The 24 hour volume in the base currency. |
quoteVolume String | The 24 hour volume in the quote currency. |
volume String | The 24 hour volume in US Dollar. |
filters String[] | An array of filters that are applied to the market. Most of the filters will cause the market to not be included in the price calculation of the coins. Allowed values:PREV_FACTOR EXTERNAL_ZSCORE GEO OUTSIDE_TOP_20 |