Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/coinbase-api/llms.txt

Use this file to discover all available pages before exploring further.

The Coinbase API SDK is a professional, production-ready JavaScript and TypeScript library that provides a unified interface to all of Coinbase’s developer APIs. Whether you’re building a retail trading application, managing institutional portfolios, or integrating crypto payments, this SDK has a dedicated, fully-typed client for every Coinbase platform.

Quickstart

Install the SDK and make your first API call in under five minutes.

Authentication

Learn how to generate and configure API keys for every Coinbase platform.

REST Clients

Six dedicated REST clients covering every Coinbase API group.

WebSockets

Real-time market data and user event streams with auto-reconnect.

Six API Clients, One Package

The SDK ships with a dedicated client for every Coinbase platform — install once and access all of them:

Advanced Trade

Modern retail & pro trading: orders, portfolios, futures, and perpetuals.

Coinbase App

Consumer wallet accounts, addresses, transactions, and deposits.

Exchange

Professional trading: order books, fills, profiles, and transfers.

International

Institutional cross-border trading, instruments, and portfolio margin.

Prime

Institutional custody, allocations, financing, and order management.

Commerce

Crypto payment charges, checkouts, and event webhooks.

Key Features

Full TypeScript Support

Strongly typed request parameters and response shapes for every method across all six clients.

WebSocket Streams

Unified WebsocketClient manages all connections with automatic reconnect and resubscription.

Dual Auth Support

Automatic detection of ECDSA and ED25519 API keys. Passphrase auth for Exchange, International, and Prime.

ESM & CJS

Ships as both ESM and CommonJS modules. Browser bundle available via webpack.

Get Started

1

Install the package

npm install coinbase-api
2

Create a client

Import the client for the Coinbase API you want to use and pass your credentials.
import { CBAdvancedTradeClient } from 'coinbase-api';

const client = new CBAdvancedTradeClient({
  apiKey: 'your-api-key-name',
  apiSecret: '-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----\n',
});
3

Make your first call

const accounts = await client.getAccounts();
console.log(accounts);
Check the Quickstart guide for a complete working example, or browse the REST client docs to find the methods you need.

Build docs developers (and LLMs) love