cURL
curl --request GET \
--url https://drb.coinbase.com/api/v2/public/tickers_by_currency \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "public/tickers_by_currency",
"params": {
"currency": "BTC",
"kind": "future"
}
}
'import requests
url = "https://drb.coinbase.com/api/v2/public/tickers_by_currency"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "public/tickers_by_currency",
"params": {
"currency": "BTC",
"kind": "future"
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'public/tickers_by_currency',
params: {currency: 'BTC', kind: 'future'}
})
};
fetch('https://drb.coinbase.com/api/v2/public/tickers_by_currency', 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://drb.coinbase.com/api/v2/public/tickers_by_currency",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'public/tickers_by_currency',
'params' => [
'currency' => 'BTC',
'kind' => 'future'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://drb.coinbase.com/api/v2/public/tickers_by_currency"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/tickers_by_currency\",\n \"params\": {\n \"currency\": \"BTC\",\n \"kind\": \"future\"\n }\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://drb.coinbase.com/api/v2/public/tickers_by_currency")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/tickers_by_currency\",\n \"params\": {\n \"currency\": \"BTC\",\n \"kind\": \"future\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://drb.coinbase.com/api/v2/public/tickers_by_currency")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/tickers_by_currency\",\n \"params\": {\n \"currency\": \"BTC\",\n \"kind\": \"future\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"best_ask_amount": 53040,
"best_ask_price": 36290,
"best_bid_amount": 4600,
"best_bid_price": 36289.5,
"index_price": 36297.02,
"instrument_name": "BTC-PERPETUAL",
"last_price": 36289.5,
"mark_price": 36288.31,
"max_price": 36833.4,
"min_price": 35744.73,
"open_interest": 502231260,
"settlement_price": 36169.49,
"state": "open",
"stats": {
"high": 36824.5,
"low": 35213.5,
"price_change": 0.2362,
"volume": 7831.26548117,
"volume_usd": 282615600
},
"timestamp": 1623059681955
}
]
}Market Data
public/tickers_by_currency
Retrieves tickers (24-hour statistics) for all open instruments of a given currency.
Optionally filter by instrument kind (future, option, spot) and specify orderbook depth (1, 3, or 10).
GET
/
public
/
tickers_by_currency
cURL
curl --request GET \
--url https://drb.coinbase.com/api/v2/public/tickers_by_currency \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "public/tickers_by_currency",
"params": {
"currency": "BTC",
"kind": "future"
}
}
'import requests
url = "https://drb.coinbase.com/api/v2/public/tickers_by_currency"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "public/tickers_by_currency",
"params": {
"currency": "BTC",
"kind": "future"
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'public/tickers_by_currency',
params: {currency: 'BTC', kind: 'future'}
})
};
fetch('https://drb.coinbase.com/api/v2/public/tickers_by_currency', 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://drb.coinbase.com/api/v2/public/tickers_by_currency",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'public/tickers_by_currency',
'params' => [
'currency' => 'BTC',
'kind' => 'future'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://drb.coinbase.com/api/v2/public/tickers_by_currency"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/tickers_by_currency\",\n \"params\": {\n \"currency\": \"BTC\",\n \"kind\": \"future\"\n }\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://drb.coinbase.com/api/v2/public/tickers_by_currency")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/tickers_by_currency\",\n \"params\": {\n \"currency\": \"BTC\",\n \"kind\": \"future\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://drb.coinbase.com/api/v2/public/tickers_by_currency")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/tickers_by_currency\",\n \"params\": {\n \"currency\": \"BTC\",\n \"kind\": \"future\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"best_ask_amount": 53040,
"best_ask_price": 36290,
"best_bid_amount": 4600,
"best_bid_price": 36289.5,
"index_price": 36297.02,
"instrument_name": "BTC-PERPETUAL",
"last_price": 36289.5,
"mark_price": 36288.31,
"max_price": 36833.4,
"min_price": 35744.73,
"open_interest": 502231260,
"settlement_price": 36169.49,
"state": "open",
"stats": {
"high": 36824.5,
"low": 35213.5,
"price_change": 0.2362,
"volume": 7831.26548117,
"volume_usd": 282615600
},
"timestamp": 1623059681955
}
]
}Query Parameters
The currency symbol
Currency, i.e "BTC", "ETH", "USDC"
Available options:
BTC, ETH, USDC, USDT, EURR Instrument kind filter. Pass a single value or repeat kind[] to filter by multiple kinds.
Instrument kind: "future", "option", "spot", "future_combo", "option_combo"
Available options:
future, option, spot, future_combo, option_combo Orderbook depth to include in the ticker response.
Available options:
1, 3, 10 Response
200 - application/json
Success response
Was this page helpful?