curl --request GET \
--url https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument \
--header 'Content-Type: application/json' \
--data '
{
"id": 5482,
"jsonrpc": "2.0",
"method": "public/get_last_settlements_by_instrument",
"params": {
"count": 1,
"instrument_name": "BTC-22FEB19",
"type": "settlement"
}
}
'import requests
url = "https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument"
payload = {
"id": 5482,
"jsonrpc": "2.0",
"method": "public/get_last_settlements_by_instrument",
"params": {
"count": 1,
"instrument_name": "BTC-22FEB19",
"type": "settlement"
}
}
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: 5482,
jsonrpc: '2.0',
method: 'public/get_last_settlements_by_instrument',
params: {count: 1, instrument_name: 'BTC-22FEB19', type: 'settlement'}
})
};
fetch('https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument', 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/get_last_settlements_by_instrument",
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' => 5482,
'jsonrpc' => '2.0',
'method' => 'public/get_last_settlements_by_instrument',
'params' => [
'count' => 1,
'instrument_name' => 'BTC-22FEB19',
'type' => 'settlement'
]
]),
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/get_last_settlements_by_instrument"
payload := strings.NewReader("{\n \"id\": 5482,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/get_last_settlements_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"BTC-22FEB19\",\n \"type\": \"settlement\"\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/get_last_settlements_by_instrument")
.header("Content-Type", "application/json")
.body("{\n \"id\": 5482,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/get_last_settlements_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"BTC-22FEB19\",\n \"type\": \"settlement\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument")
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\": 5482,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/get_last_settlements_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"BTC-22FEB19\",\n \"type\": \"settlement\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 5482,
"jsonrpc": "2.0",
"result": {
"continuation": "2Z7mdtavzYvfuyYcHkJXvPTr9ZSMsEzM3sLCH7AbYEDd1AzTXY2hnhegQDiaP1TtU4b5iSJZ4",
"settlements": [
{
"index_price": 3796.43,
"instrument_name": "BTC-22FEB19",
"mark_price": 3578.16,
"position": 240,
"profit_loss": -9.999999999886402e-10,
"session_profit_loss": 0.116509752,
"timestamp": 1550502000023,
"type": "settlement"
}
]
}
}public/get_last_settlements_by_instrument
Retrieves historical settlement, delivery, and bankruptcy events for a specific instrument. Settlements occur when futures or options contracts expire and are settled at the delivery price.
Results can be filtered by settlement type and timestamp. Use pagination parameters (count and continuation) to retrieve large settlement histories. This method is useful for tracking settlement history for a specific instrument.
curl --request GET \
--url https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument \
--header 'Content-Type: application/json' \
--data '
{
"id": 5482,
"jsonrpc": "2.0",
"method": "public/get_last_settlements_by_instrument",
"params": {
"count": 1,
"instrument_name": "BTC-22FEB19",
"type": "settlement"
}
}
'import requests
url = "https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument"
payload = {
"id": 5482,
"jsonrpc": "2.0",
"method": "public/get_last_settlements_by_instrument",
"params": {
"count": 1,
"instrument_name": "BTC-22FEB19",
"type": "settlement"
}
}
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: 5482,
jsonrpc: '2.0',
method: 'public/get_last_settlements_by_instrument',
params: {count: 1, instrument_name: 'BTC-22FEB19', type: 'settlement'}
})
};
fetch('https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument', 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/get_last_settlements_by_instrument",
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' => 5482,
'jsonrpc' => '2.0',
'method' => 'public/get_last_settlements_by_instrument',
'params' => [
'count' => 1,
'instrument_name' => 'BTC-22FEB19',
'type' => 'settlement'
]
]),
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/get_last_settlements_by_instrument"
payload := strings.NewReader("{\n \"id\": 5482,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/get_last_settlements_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"BTC-22FEB19\",\n \"type\": \"settlement\"\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/get_last_settlements_by_instrument")
.header("Content-Type", "application/json")
.body("{\n \"id\": 5482,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/get_last_settlements_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"BTC-22FEB19\",\n \"type\": \"settlement\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://drb.coinbase.com/api/v2/public/get_last_settlements_by_instrument")
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\": 5482,\n \"jsonrpc\": \"2.0\",\n \"method\": \"public/get_last_settlements_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"BTC-22FEB19\",\n \"type\": \"settlement\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 5482,
"jsonrpc": "2.0",
"result": {
"continuation": "2Z7mdtavzYvfuyYcHkJXvPTr9ZSMsEzM3sLCH7AbYEDd1AzTXY2hnhegQDiaP1TtU4b5iSJZ4",
"settlements": [
{
"index_price": 3796.43,
"instrument_name": "BTC-22FEB19",
"mark_price": 3578.16,
"position": 240,
"profit_loss": -9.999999999886402e-10,
"session_profit_loss": 0.116509752,
"timestamp": 1550502000023,
"type": "settlement"
}
]
}
}Query Parameters
Instrument name Unique instrument identifier
"BTC-PERPETUAL"
Settlement type
The type of settlement. settlement, delivery or bankruptcy.
settlement, delivery, bankruptcy Number of requested items, default - 20, maximum - 1000
1 <= x <= 1000Continuation token for pagination
"xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT"
The latest timestamp to return result from (milliseconds since the UNIX epoch) The timestamp (milliseconds since the Unix epoch)
1536569522277
Was this page helpful?