Skip to main content
GET
/
products
/
{product_id}
/
ticker
Get product ticker
curl --request GET \
  --url https://api.exchange.coinbase.com/products/{product_id}/ticker
import requests

url = "https://api.exchange.coinbase.com/products/{product_id}/ticker"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.exchange.coinbase.com/products/{product_id}/ticker', 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.exchange.coinbase.com/products/{product_id}/ticker",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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.exchange.coinbase.com/products/{product_id}/ticker"

req, _ := http.NewRequest("GET", url, nil)

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.exchange.coinbase.com/products/{product_id}/ticker")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.exchange.coinbase.com/products/{product_id}/ticker")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "trade_id": 86326522,
  "price": "6268.48",
  "size": "0.00698254",
  "time": "2020-03-20T00:22:57.833Z",
  "bid": "6265.15",
  "ask": "6267.71",
  "volume": "53602.03940154",
  "rfq_volume": "123.122",
  "conversions_volume": "0.00"
}
{
"message": "<string>"
}

Real-time updates

Coinbase recommends that you get real-time updates by connecting with the WebSocket stream and listening for match messages, rather than polling.

Path Parameters

product_id
string
required

Response

ask
string
required
bid
string
required
volume
string
required
trade_id
integer<int32>
required
price
string
required
size
string
required
time
string<date-time>
required
rfq_volume
string
conversions_volume
string