Coinbase clients
Choose the client for your Coinbase product. The main guides use Advanced Trade spot. Each other product has its own guide, credentials and account identifiers.
| Client | Purpose |
|---|---|
CBAdvancedTradeClient | Advanced Trade spot and US futures (CFM): market data, accounts and orders. Advanced Trade guide. |
CBAdvancedTradeGlobalClient | Advanced Trade international derivatives on the Deribit-powered Starbase gateway. Global derivatives guide. |
CBAppClient | Coinbase App wallet accounts and transactions. App guide. |
CBExchangeClient | Coinbase Exchange REST market data, accounts and orders. Exchange guide. |
CBInternationalClient | Retained legacy INTX methods. Migration and historical records. |
CBPrimeClient | Prime institutional trading, portfolios and custody. Prime guide. |
CBCommerceClient | Legacy Commerce charges and checkouts. Migration and retained methods. |
WebsocketClient | Shared public and private subscriptions across supported Coinbase platforms, selected with WS_KEY_MAP. Stream selection. |
WebsocketAPIClient | Awaitable Global derivatives JSON-RPC requests over WebSocket. Global WebSocket API. |
Advanced Trade international derivatives moved to Starbase on 1 October 2026. Use CBAdvancedTradeGlobalClient for those markets, even though CBAdvancedTradeClient still exposes older INTX methods. Spot and US futures remain on CBAdvancedTradeClient. See the Coinbase migration guide.
Advanced Trade REST requests
import { CBAdvancedTradeClient } from 'coinbase-api';
async function main() {
const client = new CBAdvancedTradeClient();
const product = await client.getPublicProduct({ product_id: 'BTC-USD' });
console.log(`${product.product_id} price: ${product.price}`);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});Methods return response bodies directly, not Axios response wrappers. Public market-data methods have Public in their name. Account and order methods require Advanced Trade credentials.
WebSocket subscriptions
Register listeners before calling subscribe(). WebsocketClient manages connections for the selected WS_KEY_MAP key and emits parsed data on update. Choose the key, channels and credentials for the product you use:
| Product | Subscription keys | Guide |
|---|---|---|
| Advanced Trade | advTradeMarketData, advTradeUserData | Public streams, private account updates |
| Global derivatives | advTradeGlobalMarketData, advTradeGlobalUserData | Public streams, private account updates |
| Exchange | exchangeMarketData, exchangeDirectMarketData | Exchange streams |
| International Exchange (legacy) | internationalMarketData | Legacy INTX stream mapping |
| Prime | primeMarketData | Prime streams |
Global WebSocket API
WebsocketAPIClient lets you await Global derivatives requests over a persistent WebSocket connection. It uses the dedicated advTradeGlobalWSAPI connection, separate from subscriptions. It is not an Advanced Trade spot order-entry client. See the Global WebSocket API guide.