Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/private/get_transaction_log \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "private/get_transaction_log",
  "params": {
    "currency": "BTC",
    "start_timestamp": "1613657734000",
    "end_timestamp": "1613660407000",
    "count": 5
  }
}
'
import requests

url = "https://test.deribit.com/api/v2/private/get_transaction_log"

payload = {
"jsonrpc": "2.0",
"id": 4,
"method": "private/get_transaction_log",
"params": {
"currency": "BTC",
"start_timestamp": "1613657734000",
"end_timestamp": "1613660407000",
"count": 5
}
}
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({
jsonrpc: '2.0',
id: 4,
method: 'private/get_transaction_log',
params: {
currency: 'BTC',
start_timestamp: '1613657734000',
end_timestamp: '1613660407000',
count: 5
}
})
};

fetch('https://test.deribit.com/api/v2/private/get_transaction_log', 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://test.deribit.com/api/v2/private/get_transaction_log",
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([
'jsonrpc' => '2.0',
'id' => 4,
'method' => 'private/get_transaction_log',
'params' => [
'currency' => 'BTC',
'start_timestamp' => '1613657734000',
'end_timestamp' => '1613660407000',
'count' => 5
]
]),
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://test.deribit.com/api/v2/private/get_transaction_log"

payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\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://test.deribit.com/api/v2/private/get_transaction_log")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://test.deribit.com/api/v2/private/get_transaction_log")

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 \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}"

response = http.request(request)
puts response.read_body
{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "logs": [
      {
        "username": "TestUser",
        "user_seq": 6009,
        "user_id": 7,
        "type": "transfer",
        "trade_id": null,
        "timestamp": 1613659830333,
        "side": "-",
        "price": null,
        "position": null,
        "order_id": null,
        "interest_pl": null,
        "instrument_name": null,
        "info": {
          "transfer_type": "subaccount",
          "other_user_id": 27,
          "other_user": "Subaccount"
        },
        "id": 61312,
        "equity": 3000.9275869,
        "currency": "BTC",
        "commission": 0,
        "change": -2.5,
        "cashflow": -2.5,
        "balance": 3001.22270418
      },
      {
        "username": "TestUser",
        "user_seq": 6008,
        "user_id": 7,
        "type": "settlement",
        "trade_id": null,
        "total_interest_pl": 0.00001243,
        "timestamp": 1613659544153,
        "side": "long",
        "session_upl": 0.00220172,
        "session_rpl": -0.00004467,
        "price_currency": "USD",
        "price": 51807.07,
        "position": 1520,
        "order_id": null,
        "interest_pl": 0.00000993,
        "instrument_name": "BTC-PERPETUAL",
        "info": {
          "settlement_price": 51807,
          "floating_pl": 0.00220172
        },
        "id": 61311,
        "equity": 3003.42821428,
        "currency": "BTC",
        "commission": null,
        "change": 0.00215706,
        "cashflow": 0.00215706,
        "balance": 3003.72270418,
        "amount": 1520
      },
      {
        "username": "TestUser",
        "user_seq": 6007,
        "user_id": 7,
        "type": "deposit",
        "trade_id": null,
        "timestamp": 1613657828414,
        "side": "-",
        "price": null,
        "position": null,
        "order_id": null,
        "interest_pl": null,
        "instrument_name": null,
        "info": {
          "transaction": "de6eba075855f32c9510f338d3ca0900376cedcb9f7b142caccfbdc292d3237e",
          "deposit_type": "wallet",
          "addr": "2N8prMvpZHr8aYqodX3S4yhz5wMxjY8La3p"
        },
        "id": 61291,
        "equity": 3003.4876111,
        "currency": "BTC",
        "commission": 0,
        "change": 0.65,
        "cashflow": 0.65,
        "balance": 3003.72054712
      },
      {
        "username": "TestUser",
        "user_seq": 6006,
        "user_role": "maker",
        "user_id": 7,
        "type": "trade",
        "ip": "11.222.33.44",
        "trade_id": "28349",
        "timestamp": 1613657734620,
        "side": "open buy",
        "profit_as_cashflow": false,
        "price_currency": "BTC",
        "price": 0.1537,
        "position": 0.7,
        "order_id": "67546",
        "mark_price": 0.04884653215049635,
        "interest_pl": 0,
        "instrument_name": "BTC-19FEB21-49200-C",
        "info": "Source: api",
        "id": 61289,
        "equity": 3002.83270455,
        "currency": "BTC",
        "commission": 0,
        "change": -0.10759,
        "cashflow": -0.10759,
        "balance": 3003.07054712,
        "amount": 0.7
      },
      {
        "username": "TestUser",
        "user_seq": 6005,
        "user_role": "maker",
        "user_id": 7,
        "type": "trade",
        "trade_id": "28349",
        "timestamp": 1613657734620,
        "side": "close buy",
        "profit_as_cashflow": false,
        "price_currency": "BTC",
        "price": 0.1537,
        "position": 0,
        "order_id": "67546",
        "mark_price": 0.04884653215049635,
        "interest_pl": 0,
        "instrument_name": "BTC-19FEB21-49200-C",
        "info": "Source: api",
        "id": 61288,
        "equity": 3002.83270455,
        "currency": "BTC",
        "commission": 0,
        "change": -0.04611,
        "cashflow": -0.04611,
        "balance": 3003.17813712,
        "amount": 0.3
      }
    ],
    "continuation": 61282
  }
}

Query Parameters

currency
enum<string>
required

The currency symbol Currency, i.e "BTC", "ETH", "USDC"

Available options:
BTC,
ETH,
STETH,
ETHW,
USDC,
USDT,
EURR,
SOL,
XRP,
USYC,
PAXG,
BNB,
USDE
start_timestamp
integer
required

The earliest timestamp to return result from (milliseconds since the UNIX epoch) The timestamp (milliseconds since the Unix epoch)

Example:

1536569522277

end_timestamp
integer
required

The most recent timestamp to return result from (milliseconds since the UNIX epoch) The timestamp (milliseconds since the Unix epoch)

Example:

1536569522277

query
string

The following keywords can be used to filter the results: trade, maker, taker, open, close, liquidation, buy, sell, withdrawal, delivery, settlement, deposit, transfer, option, future, correction, block_trade, swap. Plus withdrawal or transfer addresses

Example:

"settlement"

count
integer

Count of transaction log entries returned, default - 100, maximum - 250

Required range: 1 <= x <= 250
subaccount_id
integer

Id of a subaccount

Example:

9

continuation
integer

Continuation token for pagination

Example:

429946

Response

200 - application/json

Success response

jsonrpc
enum<string>
required

The JSON-RPC version (2.0)

Available options:
2.0
result
object
required
id
integer

The id that was sent in the request