skills/crypto-api/coinbase-advanced-skill.md
name: "Coinbase Advanced Trade API" description: "Source for granular L2 Orderbook data."
Keys
- Access: Access keys using
.envfile. Do not view the keys. They may be accessed for the API by accessingCOINBASE_API_KEYandCOINBASE_SECRET_KEY. Do not modify the keys.
Websocket Feed
- Endpoint:
wss://advanced-trade-ws.coinbase.com - Channels:
level2: Full orderbook updates.market_trades: Real-time Time & Sales.
L2 Book Construction
- Snapshot: Receive initial state.
- Updates: Apply
l2updatemessages (quantity changes at specific price levels). - Pruning: Backend should maintain the full book for analysis, but slice
top_20for the Frontend to minimize bandwidth.