subscribe message to the websocket server, after you establish a connection to our websocket server. Below is an example of how to subscribe to the prices channel.{
"action": "subscribe",
"channel": "prices-v1",
"payload": [
{
"type": "cr",
"asset": "BTC",
"fiat": "EUR"
},
{
"type": "s",
"asset": "AAPL",
"fiat": "EUR"
}
]
}action is the action that you wants to perform. Supported actions are: subscribe or unsubscribe.channel is the channel that you want to subscribe to. You can subscribe to multiple channels on the same connection, or you can open multiple connections to subscribe to different channels.payload is an array of objects containing the following fields:type is the type of the asset. It can be cr for crypto, s for securities, f for fiat, i for index, co for commodity, es for equity_security.asset is the asset symbol.fiat is the fiat symbol{"fiat": "EUR"} which would indicate subscription to all assets against the indicated fiat.{
"action": "subscribe",
"channel": "prices-v1",
"payload": [
{
"type": "cr",
"asset": "BTC",
"fiat": "EUR"
},
{
"type": "s",
"asset": "AAPL",
"fiat": "EUR"
}
]
}{
"action": "subscribe",
"channel": "prices-v1",
"payload": [
{
"fiat": "EUR"
}
]
}{
"action": "subscribe",
"channel": "prices-v1",
"payload": [
{
"fiat": "EUR"
},
{
"fiat": "USD"
}
]
}{
"action": "subscribe",
"channel": "prices-v1"
}{
"action": "subscribe",
"channel": "prices-v1",
"status": "success"
}{
"action": "subscribe",
"channel": "non-existent-channel",
"error": "channel not supported"
}{
"action": "subscribe",
"channel": "price-changes-v1",
"error": "fiat not found: XXX"
}{
"action": "subscribe",
"channel": "price-changes-v1",
"error": "asset not found for domain: ABC"
}prices-v1: This channel provides real-time price updates for assets. Each asset-fiat pair receives an update roughly every 15 seconds.price-changes-v1: This channel provides real-time price changes for assets.prices-v1 channel.{
"AP":"65544.85350",
"BP":"65217.84675",
"U": 1706521791,
"T": "cr",
"A": "BTC",
"F": "EUR",
"CH": "prices-v1"
}AP is the ask priceBP is the bid priceU is the unix timestamp of the updateT is the type of the asset. It can be cr for crypto, s for securities, f for fiat, i for index, co for commodity, es for equity_security.A is the asset symbolF is the fiat symbolCH is the channelprice-changes-v1 channel.{
"T": "cr",
"A": "BTC",
"F": "EUR",
"CH": "price-changes-v1",
"D": "-1.5133276010318143",
"I": "1.273209549071618",
"W": "-1.8677176148046607",
"M": "0.297723292469352",
"6M": "-7.9408455232277769",
"Y": "-24.3261099365750529",
"5Y": "-26.7534660050135571",
"DV": "-0.88",
"IV": "0.72",
"WV": "-1.09",
"MV": "0.17",
"6MV": "-4.94",
"YV": "-18.41",
"5YV": "-20.918",
"MVOL": "0.1185439986130654"
}T is the type of the asset. It can be cr for crypto, s for securities, f for fiat, i for index, co for commodity, es for equity_security.A is the asset symbolF is the fiat symbolCH is the channelD is the daily change in %I is the intraday change in %W is the weekly change in %M is the monthly change in %6M is the 6 month change in %Y is the yearly change in %5Y is the 5 year change in %DV is the daily change in valueIV is the intraday change in valueWV is the weekly change in valueMV is the monthly change in value6MV is the 6 month change in valueYV is the yearly change in value5YV is the 5 year change in valueMVOL is the monthly volatilityunsubscribe message to the websocket server. Below is an example of how to unsubscribe from the prices channel.{
"action": "unsubscribe",
"channel": "prices-v1"
}