Skip to main content
Upstream: wss://ws-feed.exchange.coinbase.com

Connect

wscat -c "wss://gateway.graylayer.tech/ws/coinbase?api_key=your_key"
Send a subscribe message within 5 seconds of connecting:
{
  "type": "subscribe",
  "product_ids": ["BTC-USD", "ETH-USD"],
  "channels": ["ticker", "level2", "heartbeat"]
}

Channels

ChannelDescription
tickerReal-time price updates
level2Full order book updates
heartbeatHeartbeat messages to detect disconnects
matchesMatched orders (trades)
statusProduct status changes

Unsubscribe

{
  "type": "unsubscribe",
  "product_ids": ["BTC-USD"],
  "channels": ["ticker"]
}