Coinbase Advanced Trade API
api.coinbase.com · Finance
Coinbase exchange API — real-time market data, portfolio management, order execution, and fills. Public market data requires no auth. Trading requires API key.
Authentication
Sample Requests
Get current BTC-USD price and volume. No auth needed.
Hover any highlighted part to learn what it does
curl -X GET "https://api.coinbase.com/api/v3/brokerage/market/products/BTC-USD/ticker"
import requests
response = requests.get(
"https://api.coinbase.com/api/v3/brokerage/market/products/BTC-USD/ticker",
)
print(response.json())const url = 'https://api.coinbase.com/api/v3/brokerage/market/products/BTC-USD/ticker'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.coinbase.com/api/v3/brokerage/market/products/BTC-USD/ticker"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.coinbase.com/api/v3/brokerage/market/products/BTC-USD/ticker")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.coinbase.com/api/v3/brokerage/market/products/BTC-USD/ticker";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));List available trading pairs.
Hover any highlighted part to learn what it does
curl -X GET "https://api.coinbase.com/api/v3/brokerage/market/products?limit=5&product_type=SPOT"
import requests
params = {
"limit": "5",
"product_type": "SPOT"
}
response = requests.get(
"https://api.coinbase.com/api/v3/brokerage/market/products",
params=params,
)
print(response.json())const url = new URL('https://api.coinbase.com/api/v3/brokerage/market/products');
url.searchParams.set('limit', '5');
url.searchParams.set('product_type', 'SPOT');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.coinbase.com/api/v3/brokerage/market/products")
q := baseURL.Query()
q.Set("limit", "5")
q.Set("product_type", "SPOT")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.coinbase.com/api/v3/brokerage/market/products")
uri.query = URI.encode_www_form({
"limit" => "5",
"product_type" => "SPOT"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.coinbase.com/api/v3/brokerage/market/products?" . http_build_query([
"limit" => "5",
"product_type" => "SPOT"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Public market data needs no API key
- GET https://api.coinbase.com/api/v3/brokerage/market/products/BTC-USD/ticker
- For trading: get API key from coinbase.com/settings/api
- Private endpoints need HMAC-SHA256 signature — see docs for signing details
- Sandbox: use api-sandbox.coinbase.com (requires separate sandbox account)
What can you build with Coinbase Advanced Trade API?
Coinbase Advanced Trade API is a Finance API. Developers commonly use finance APIs for:
- processing payments and handling transactions
- building subscription and billing systems
- automating invoicing and financial reporting
- fraud detection and risk scoring
- connecting to banking and accounting software
API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. Coinbase Advanced Trade API is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide