Coinbase Exchange API

Build powerful cryptocurrency applications with our comprehensive REST API and real-time WebSocket feeds. Access market data, execute trades, and manage accounts programmatically.

REST & WebSocket APIs
Bank-Grade Security
100+ Supported Countries
API Development
JavaScript Example
// Initialize Coinbase API client
const Coinbase = require('coinbase');
const client = new Coinbase.Client({
  apiKey: 'your-api-key',
  apiSecret: 'your-api-secret',
  version: 'YYYY-MM-DD'
});
// Get account information
client.getAccounts({}, (error, accounts) => {
  if (error) {
    console.error(error);
    return;
  }
  accounts.forEach((account) => {
    console.log(`${account.currency}: ${account.balance}`);
  });
});

Powerful API Features

Market Data

Access real-time and historical market data for 100+ trading pairs with tick-level precision and comprehensive order book data.

Trading Execution

Execute market, limit, and stop orders with millisecond latency. Access advanced order types for sophisticated trading strategies.

Account Management

Programmatically manage wallets, view balances, track portfolio performance, and access transaction history through our REST API.

WebSocket Feeds

Subscribe to real-time market data, user updates, and trading events with our low-latency WebSocket connections.

Advanced Security

Implement secure API authentication with HMAC signatures, IP whitelisting, and granular permission controls for your applications.

High Performance

Leverage our scalable infrastructure designed to handle high-frequency trading with 99.9% uptime and sub-millisecond response times.

Core API Endpoints

GET /v2/accounts

Retrieve a list of your cryptocurrency accounts with balances and available funds.

Parameters
limit integer (optional)
starting_after string (optional)
POST /v2/orders

Place a new order to buy or sell cryptocurrency. Supports market, limit, and stop order types.

Body Parameters
product_id string (required)
side string (required)
size string (required)
GET /v2/products/{product_id}/ticker

Get snapshot information about the last trade, best bid/ask and 24h volume for a trading pair.

Path Parameters
product_id string (required)
GET /v2/products/{product_id}/candles

Get historic rates for a product. Rates are returned in grouped buckets based on requested granularity.

Query Parameters
granularity integer (required)
start string (optional)
end string (optional)

Secure API Authentication

Coinbase API uses HMAC authentication to ensure secure communication between your application and our servers. All requests must be signed with your API key secret.

  • API Key & Secret

    Generate unique API keys with specific permissions for your application through the Coinbase developer dashboard.

  • HMAC Signing

    Each request must include a signature created by hashing the request details with your API secret using the HMAC-SHA256 algorithm.

  • Timestamp Validation

    All requests must include a timestamp to prevent replay attacks. Requests with timestamps more than 30 seconds old are rejected.

  • Granular Permissions

    Control exactly what your API keys can do with view-only, trade, transfer, and wallet permissions to minimize security risks.

API Authentication

Official API SDKs

JavaScript/Node.js

Official SDK for JavaScript and Node.js applications with full TypeScript support and promise-based API.

  • Full TypeScript support
  • Promise-based API
  • WebSocket client included

Python

Comprehensive Python SDK with synchronous and asynchronous clients for all API endpoints.

  • Sync & async clients
  • Pandas integration
  • Full test coverage

Java

Enterprise-grade Java SDK with comprehensive error handling and connection pooling.

  • Maven/Gradle support
  • Connection pooling
  • Comprehensive error handling

Swift

Native iOS and macOS SDK with modern Swift conventions and full Coinbase API coverage.

  • Modern Swift API
  • iOS & macOS support
  • Combine framework

API Questions Answered

What are the API rate limits?
Coinbase API implements tiered rate limiting based on your account type and historical usage. Public endpoints allow up to 10 requests per second, while private endpoints typically allow 15 requests per second. High-frequency trading applications may qualify for higher rate limits. All rate limits are documented in the response headers of each API request.