Coinbase API

⭐ Beginner's Pick Cryptocurrency / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

The Coinbase API exposes current and historical prices for Bitcoin, Bitcoin Cash, Litecoin, and Ethereum against major fiat currencies. Public price endpoints require no authentication, making it easy to embed live crypto prices in any app. The authenticated endpoints allow you to manage wallets, send funds, and access account data.

💡

Beginner Tip

The spot price endpoint is completely public — try curl https://api.coinbase.com/v2/prices/BTC-USD/spot to get the current Bitcoin price with no API key needed.

Available Data

coin price in USD/EUR
market capitalization
24h price change
trading volume
circulating supply

Example Response

JSON Response
{
  "id": "bitcoin",
  "symbol": "btc",
  "current_price": 65432.1,
  "market_cap": 1280000000000,
  "price_change_24h": 1250.5,
  "price_change_percentage_24h": 1.95,
  "total_volume": 28500000000
}

Field Reference

data.base The cryptocurrency symbol (e.g., BTC).
data.currency The fiat currency the price is quoted in (e.g., USD).
data.amount Current spot price as a decimal string — parse to float before arithmetic.

Implementation Example

const url = "https://developers.coinbase.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized on account endpoints Missing OAuth token or API key/secret pair
Use the public price endpoints (/v2/prices) without auth; for account access, follow the OAuth2 flow described in the docs.
Currency pair not found Using an unsupported currency code or wrong pair format
Format pairs as BASE-QUOTE (e.g., ETH-EUR); check /v2/currencies for supported fiat codes.
Stale price data in application Caching the spot price response too aggressively
Coinbase prices update frequently; limit caching to 10-30 seconds for real-time display purposes.

Matrix Score Breakdown

🌐 Reachability 0/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 0/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Cryptocurrency
Difficulty Intermediate
Verified: 2026-04-04

Alternatives to Coinbase

Technical alternatives for different use cases.

Largest exchange by volume with most trading pairs

Better For

Access to widest range of altcoins and trading pairs

Trade-off

US regulatory compliance (limited in some states)

Read-only market data without exchange account needed

Better For

Price tracking without needing an exchange account

Trade-off

Executing actual trades and managing portfolios

US-regulated exchange with strong institutional focus

Better For

Institutional-grade API with SOC 2 compliance

Trade-off

Number of supported cryptocurrencies

Recipes Using Coinbase

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →