Coinbase API

Beginner's Pick Cryptocurrency / API Key Intermediate HTTPS
89 A
Measured Score 0 50 100 Speed 26/30 Consistency 20/20 Security 20/20 Browser access 15/15 Transparency 8/15 TESTED 2026-08-10

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.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.coinbase.com/v2/prices/BTC-USD/spot
Result
HTTP 200 · application/json · 61 bytes · compressed
Response time
40 ms (median of 3) · fastest 39 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
cloudflare
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
amount string 63937.525
base string BTC
currency string USD

Captured Response

Captured from a real request to https://api.coinbase.com/v2/prices/BTC-USD/spot on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "data": {
    "amount": "63937.525",
    "base": "BTC",
    "currency": "USD"
  }
}

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.coinbase.com/v2/prices/BTC-USD/spot";
// 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.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist text/plain
Not Found

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 26/30
Consistency 20/20
Security 20/20
Browser access 15/15
Transparency 8/15
Endpoint Response Time 40ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Cryptocurrency
Difficulty Intermediate
Endpoint last called: 2026-08-10

Related Tags

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 →