Beta feature - The WebSocket API is currently in beta and is excluded from the Service Level Agreement (SLA). Available on Startup and above (Startup, Growth, Professional, and Enterprise). Access consumes monthly credits: up to 10 concurrent connections, each supporting up to 100 subscriptions, at 0.025 credits per message received. For higher limits, contact us about Enterprise plans.

WEBSOCKET API

Real-Time Crypto Data Streamed

Stop polling. The CoinMarketCap WebSocket API pushes live crypto prices and on-chain DEX events to your product over a single persistent connection. Sub-5-second market quotes, event-driven swaps and liquidity, all through one WSS endpoint.

~5sPrice Push (Top 500)
10Concurrent Connections
100Subscriptions / Connection
0.025Credits / Message Received
WSSOne Shared Endpoint

Two Channel Categories. One Connection.

Subscribe to live market data and on-chain DEX events through the same WebSocket. Branch on the channel name and route each push where it belongs.

Market Data: Crypto Latest Price

Aggregated crypto price, market cap, volume, and price changes. Pushes roughly every 5 seconds for the top 500 by rank, and every 15 seconds for all other cryptocurrencies.

On-Chain Data: DEX Channels

Real-time DEX token and pool data: prices, swaps, liquidity, kline, rolling metrics, and holder analytics. Event-driven, pushed on each on-chain event or metric update.

One Endpoint for Every Channel

Both Market Data and On-Chain Data channels share the same WSS endpoint. All connections require a valid CoinMarketCap API key.

wss://pro-stream.coinmarketcap.com/v1
Authentication JavaScript (Node.js)
// Node.js server-side authentication (recommended). Install: npm install ws
import WebSocket from 'ws';

const ws = new WebSocket(
  'wss://pro-stream.coinmarketcap.com/v1',
  { headers: { 'X-CMC_PRO_API_KEY': 'your-api-key' } }
);

Channel Category

Market Data: Live Crypto Prices

Subscribe to market@crypto_latest_price. The crypto_ids parameter is required; omitting it returns error 2401. WebSocket access requires a Startup plan or above (Startup, Growth, Professional, and Enterprise). The feature is in Beta and excluded from SLA.

Crypto Latest Price

market@crypto_latest_price
Subscribe with:
crypto_ids
Push interval:~5s (top 500 by rank); ~15s (all the other cryptocurrencies)
Fields:
14 fields (cid, p, vu, mc, cs, multi-window p*, fdv24h, etc.)
Subscribe Example
{
  "id": 1,
  "method": "subscribe",
  "channel": "market@crypto_latest_price",
  "params": {
    "crypto_ids": [1, 1027, 1839]
  }
}
For a complete list of cryptocurrency IDs, refer to the /v1/cryptocurrency/map endpoint or download the CSV.

Channel Category

On-Chain Data: Real-Time DEX Events

DEX WebSocket streams real-time on-chain events: aggregated prices, swaps, liquidity, kline, rolling token and pool metrics, unique traders, and holder analytics.

Transaction

onchain@transaction
Params:
platform_id
address
Trigger:Per swap

Aggregated Token Price

onchain@token_agg_event
Params:
platform_id
address
Trigger:Per swap

Liquidity Event

onchain@liquidity_event
Params:
platform_id
address
Trigger:Per liquidity tx

Kline

onchain@kline
Params:
platform_id
address
interval
Trigger:Per interval close

Token Rolling Metrics

onchain@token_metric
Params:
platform_id
address
Trigger:Per metric update

Pool Rolling Metric

onchain@pool_metric
Params:
platform_id
pool_address
Trigger:Per metric update

Unique Trader

onchain@unique_trader
Params:
platform_id
address
interval
Trigger:Per interval close

Holder Metrics

onchain@holders_metrics
Params:
platform_id
address
Trigger:Per holder update

Holder Wallet Update

onchain@holder_wallet_update
Params:
platform_id
wallet_address
Trigger:Per wallet update

Chain Coverage

Generaltoken_agg_event, transaction, liquidity_event, kline, token_metric, pool_metric, and unique_trader stream on every chain CoinMarketCap indexes.
All Chains
Holder Analytics Coverageholders_metrics, holder_wallet_update Limited to the following EVM chains, Solana, and Tron20:
Ethereum
Ethereum
BNB Chain
BNB Chain
Base
Polygon
Polygon
Arbitrum
Arbitrum
Optimism
Optimism
Avalanche
Avalanche
Celo
Celo
zkSync Era
Scroll
Linea
Berachain
Sonic
Monad
Plasma
Solana
Solana
Tron20
Tron20
On-chain subscribe params require a numeric platform_id (e.g. 14 for BSC, 16 for Solana); payloads use the short key pid for the same ID. For platform IDs, refer to the DEX API /v1/dex/platform/list endpoint.

Common Reference

Shared across every channel — message format, subscription commands, quick start, errors, and best practices.

Message Envelope

Every server message dispatches on a type field, so routing logic stays simple. Data pushes always include channel and params, and never rely on the client id for routing. The optional request id is echoed only on ack and error.

TypeDescription
ackResponse to subscribe / unsubscribe / unsubscribe_all
dataChannel push
errorError (optional id echo)
pongResponse to ping
Data Push Example
{
  "type": "data",
  "channel": "market@crypto_latest_price",
  "params": { "crypto_ids": 1 },
  "data": { "cid": 1, "p": 81187.93, "vu": 29932025976.79,
             "mc": 1626089237758.0, "p24h": 2.41 },
  "ts": 1778663880111
}

Keep-Alive

Use the ping_interval_ms from the welcome message (typically 10 seconds). Idle connections may be closed after prolonged inactivity if neither pings nor data are flowing.

Send
{ "id": 1, "method": "ping" }
Receive
{ "type": "pong", "id": 1, "code": 0, "ts": 1778659200000 }

Subscription Commands

Manage subscriptions with methods.

MethodDescription
subscribeSpecific subscription of channel and/or params
unsubscribeSpecific unsubscription of channel and/or params
unsubscribe_allUnsubscribe everything
Unsubscribe Example
{
  "id": 2,
  "method": "unsubscribe",
  "channel": "onchain@kline",
  "params": {
    "platform_id": 14,
    "address": ["0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"]
  }
}

Quick Start

Open a connection, subscribe to a channel, and branch on msg.type. The same pattern works in any language with a WebSocket client.

JavaScript (Node.js)
// Node.js. Install: npm install ws
import WebSocket from 'ws';

const ws = new WebSocket('wss://pro-stream.coinmarketcap.com/v1', {
  headers: { 'X-CMC_PRO_API_KEY': 'your-api-key' }
});

ws.onopen = () => {
  ws.send(JSON.stringify({
    id: 1, method: 'subscribe',
    channel: 'market@crypto_latest_price',
    params: { crypto_ids: [1, 1027] }
  }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type === 'data') {
    const { cid, p, p24h } = msg.data;
    console.log(`#${cid}: $${p} (${p24h}% 24h)`);
  }
};
Python
# Requires websockets >= 14.0
import asyncio, json, websockets

async def subscribe():
    uri = 'wss://pro-stream.coinmarketcap.com/v1'
    headers = {'X-CMC_PRO_API_KEY': 'your-api-key'}
    async with websockets.connect(uri, additional_headers=headers) as ws:
        await ws.send(json.dumps({
            'id': 1, 'method': 'subscribe',
            'channel': 'market@crypto_latest_price',
            'params': {'crypto_ids': [1, 1027]},
        }))
        async for raw in ws:
            m = json.loads(raw)
            if m.get('type') != 'data': continue
            d = m['data']
            print(f"#{d['cid']}: ${d['p']:.2f}")

asyncio.run(subscribe())

Frequently Asked Questions

Which plans include WebSocket access?

CoinMarketCap WebSocket API is available on Startup, Growth, Professional and Enterprise plans. The feature is currently in beta and is excluded from the Service Level Agreement while in beta. Teams that need higher connection limits, subscription limits or production support should check the WebSocket documentation and contact CoinMarketCap about Enterprise options.

How is WebSocket usage billed?

WebSocket usage consumes monthly API credits based on the subscriptions used by the connection. Because limits and billing rules can change during beta, developers should use the CoinMarketCap WebSocket documentation as the source of truth for current connection limits, subscription limits and credit usage before building around a specific operating model.

How fresh is the streamed price data?

The market@crypto_latest_price channel is designed for pushed latest-price updates, so products do not need to repeatedly poll REST endpoints for the same live market view. Freshness depends on the channel behavior documented by CoinMarketCap — check the WebSocket channel reference for the current push timing before using it in latency-sensitive workflows.

What WebSocket endpoint should I use?

All CoinMarketCap WebSocket channels use the same WSS endpoint: wss://pro-stream.coinmarketcap.com/v1. Both CEX latest-price streams and DEX/on-chain channels use that endpoint. All connections require a valid CoinMarketCap API key.

How do I authenticate?

Provide your CoinMarketCap API key in the X-CMC_PRO_API_KEY header during the WebSocket handshake. This is the same key used for the Pro REST API. Server-side header authentication is the cleaner production approach because it keeps the key out of browser-visible URLs.

What data can CoinMarketCap WebSocket stream?

CoinMarketCap WebSocket supports market-data and on-chain channel categories. The market-data channel supports latest-price streaming for subscribed CoinMarketCap cryptocurrency IDs. The on-chain channels stream supported DEX activity and metrics, including token price events, swaps, liquidity events, K-lines, token metrics, pool metrics, unique trader data and holder-related updates.

Which chains are supported for on-chain channels?

Most on-chain WebSocket channels are supported across the chains listed in the WebSocket documentation. Holder-related channels have more specific coverage, so developers should check the current WebSocket docs before launch if the product depends on holder metrics, holder wallet updates or a specific chain.

What should production teams plan for?

A WebSocket integration needs more than an open connection. Plan for reconnects, re-subscription after reconnecting, ping/pong keep-alive handling, structured error handling and duplicate-event handling. Route messages by type, channel and params, not only by the client request ID. Numeric fields can be null when unavailable, and on-chain payloads can use channel-specific params such as pool_address and wallet_address.

READY TO STREAM?

Push live market and on-chain data straight into your product.

One persistent connection. Sub-5-second prices. Event-driven on-chain feeds.