Get Product Book
curl --request GET \
--url https://api.coinbase.com/api/v3/brokerage/product_book \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.coinbase.com/api/v3/brokerage/product_book"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.coinbase.com/api/v3/brokerage/product_book', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coinbase.com/api/v3/brokerage/product_book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinbase.com/api/v3/brokerage/product_book"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinbase.com/api/v3/brokerage/product_book")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinbase.com/api/v3/brokerage/product_book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pricebook": {
"product_id": "BTC-USD",
"bids": [
{
"price": "<string>",
"size": "<string>"
}
],
"asks": [
{
"price": "<string>",
"size": "<string>"
}
],
"time": "<string>"
},
"last": "<string>",
"mid_market": "<string>",
"spread_bps": "<string>",
"spread_absolute": "<string>"
}{
"error": "<string>",
"code": 123,
"message": "<string>",
"details": [
{}
]
}Products
Get Product Book
Get a list of bids/asks for a single product. The amount of detail shown can be customized with the limit parameter.
GET
/
api
/
v3
/
brokerage
/
product_book
Get Product Book
curl --request GET \
--url https://api.coinbase.com/api/v3/brokerage/product_book \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.coinbase.com/api/v3/brokerage/product_book"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.coinbase.com/api/v3/brokerage/product_book', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coinbase.com/api/v3/brokerage/product_book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinbase.com/api/v3/brokerage/product_book"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinbase.com/api/v3/brokerage/product_book")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinbase.com/api/v3/brokerage/product_book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pricebook": {
"product_id": "BTC-USD",
"bids": [
{
"price": "<string>",
"size": "<string>"
}
],
"asks": [
{
"price": "<string>",
"size": "<string>"
}
],
"time": "<string>"
},
"last": "<string>",
"mid_market": "<string>",
"spread_bps": "<string>",
"spread_absolute": "<string>"
}{
"error": "<string>",
"code": 123,
"message": "<string>",
"details": [
{}
]
}Authorizations
A JWT signed using your CDP API Key Secret, encoded in base64. Refer to the Creating API Keys section of our Coinbase App Authentication docs for information on how to generate your Bearer Token.
Query Parameters
The trading pair (e.g. 'BTC-USD').
The number of bid/asks to be returned.
The minimum price intervals at which buy and sell orders are grouped or combined in the order book.
Was this page helpful?
⌘I