curl --request POST \
--url https://whitebit.com/api/v4/collateral-account/borrow-history \
--header 'Content-Type: application/json' \
--header 'X-TXC-APIKEY: <api-key>' \
--header 'X-TXC-PAYLOAD: <api-key>' \
--header 'X-TXC-SIGNATURE: <api-key>' \
--data '
{
"asset": "BTC",
"startTime": 1700000000,
"endTime": 1700100000,
"limit": 50,
"offset": 0,
"request": "{{request}}",
"nonce": 1594297865000
}
'import requests
url = "https://whitebit.com/api/v4/collateral-account/borrow-history"
payload = {
"asset": "BTC",
"startTime": 1700000000,
"endTime": 1700100000,
"limit": 50,
"offset": 0,
"request": "{{request}}",
"nonce": 1594297865000
}
headers = {
"X-TXC-APIKEY": "<api-key>",
"X-TXC-PAYLOAD": "<api-key>",
"X-TXC-SIGNATURE": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-TXC-APIKEY': '<api-key>',
'X-TXC-PAYLOAD': '<api-key>',
'X-TXC-SIGNATURE': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
asset: 'BTC',
startTime: 1700000000,
endTime: 1700100000,
limit: 50,
offset: 0,
request: '{{request}}',
nonce: 1594297865000
})
};
fetch('https://whitebit.com/api/v4/collateral-account/borrow-history', 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://whitebit.com/api/v4/collateral-account/borrow-history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'asset' => 'BTC',
'startTime' => 1700000000,
'endTime' => 1700100000,
'limit' => 50,
'offset' => 0,
'request' => '{{request}}',
'nonce' => 1594297865000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-TXC-APIKEY: <api-key>",
"X-TXC-PAYLOAD: <api-key>",
"X-TXC-SIGNATURE: <api-key>"
],
]);
$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://whitebit.com/api/v4/collateral-account/borrow-history"
payload := strings.NewReader("{\n \"asset\": \"BTC\",\n \"startTime\": 1700000000,\n \"endTime\": 1700100000,\n \"limit\": 50,\n \"offset\": 0,\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TXC-APIKEY", "<api-key>")
req.Header.Add("X-TXC-PAYLOAD", "<api-key>")
req.Header.Add("X-TXC-SIGNATURE", "<api-key>")
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.post("https://whitebit.com/api/v4/collateral-account/borrow-history")
.header("X-TXC-APIKEY", "<api-key>")
.header("X-TXC-PAYLOAD", "<api-key>")
.header("X-TXC-SIGNATURE", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"BTC\",\n \"startTime\": 1700000000,\n \"endTime\": 1700100000,\n \"limit\": 50,\n \"offset\": 0,\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/collateral-account/borrow-history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TXC-APIKEY"] = '<api-key>'
request["X-TXC-PAYLOAD"] = '<api-key>'
request["X-TXC-SIGNATURE"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset\": \"BTC\",\n \"startTime\": 1700000000,\n \"endTime\": 1700100000,\n \"limit\": 50,\n \"offset\": 0,\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}"
response = http.request(request)
puts response.read_body{
"records": [
{
"asset": "BTC",
"amount": "108.32",
"principal": "100",
"interest": "6.15",
"status": "active",
"timestamp": 1700000000
}
],
"limit": 50,
"offset": 0
}{
"code": 30,
"message": "Validation failed",
"errors": {}
}{
"code": 30,
"message": "Validation failed",
"errors": {}
}Borrow history
The endpoint returns the collateral account’s borrow history for the authenticated account — one record per borrow position, not per underlying engine state change. Use the optional asset parameter to filter to a single asset; when omitted, the response covers every asset the caller’s region allows to borrow. An asset that is unknown or blocked in the caller’s region returns a validation error rather than an empty result. Records are ordered by creation time ascending (oldest first), tie-broken by asset ascending.
Rate limit: 12000 requests/10 sec.
This endpoint supports pagination via limit (default: 50, max: 100) and offset (default: 0, max: 10000 — a value above the maximum is rejected outright). startTime (default: 0) and endTime (default: now) filter by position time and must satisfy endTime > startTime. Independently of offset, a startTime/endTime window wide enough to contain more than 10000 matching positions is rejected rather than scanned slowly or served partially — narrow the window instead.
Field semantics: amount, principal and interest are independently computed peak values, not a running formula — amount does not always equal principal + interest, because funding can keep accruing after a position’s balance has already peaked. Treat any apparent amount = principal + interest relationship as usually true, never as a guarantee.
curl --request POST \
--url https://whitebit.com/api/v4/collateral-account/borrow-history \
--header 'Content-Type: application/json' \
--header 'X-TXC-APIKEY: <api-key>' \
--header 'X-TXC-PAYLOAD: <api-key>' \
--header 'X-TXC-SIGNATURE: <api-key>' \
--data '
{
"asset": "BTC",
"startTime": 1700000000,
"endTime": 1700100000,
"limit": 50,
"offset": 0,
"request": "{{request}}",
"nonce": 1594297865000
}
'import requests
url = "https://whitebit.com/api/v4/collateral-account/borrow-history"
payload = {
"asset": "BTC",
"startTime": 1700000000,
"endTime": 1700100000,
"limit": 50,
"offset": 0,
"request": "{{request}}",
"nonce": 1594297865000
}
headers = {
"X-TXC-APIKEY": "<api-key>",
"X-TXC-PAYLOAD": "<api-key>",
"X-TXC-SIGNATURE": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-TXC-APIKEY': '<api-key>',
'X-TXC-PAYLOAD': '<api-key>',
'X-TXC-SIGNATURE': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
asset: 'BTC',
startTime: 1700000000,
endTime: 1700100000,
limit: 50,
offset: 0,
request: '{{request}}',
nonce: 1594297865000
})
};
fetch('https://whitebit.com/api/v4/collateral-account/borrow-history', 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://whitebit.com/api/v4/collateral-account/borrow-history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'asset' => 'BTC',
'startTime' => 1700000000,
'endTime' => 1700100000,
'limit' => 50,
'offset' => 0,
'request' => '{{request}}',
'nonce' => 1594297865000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-TXC-APIKEY: <api-key>",
"X-TXC-PAYLOAD: <api-key>",
"X-TXC-SIGNATURE: <api-key>"
],
]);
$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://whitebit.com/api/v4/collateral-account/borrow-history"
payload := strings.NewReader("{\n \"asset\": \"BTC\",\n \"startTime\": 1700000000,\n \"endTime\": 1700100000,\n \"limit\": 50,\n \"offset\": 0,\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TXC-APIKEY", "<api-key>")
req.Header.Add("X-TXC-PAYLOAD", "<api-key>")
req.Header.Add("X-TXC-SIGNATURE", "<api-key>")
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.post("https://whitebit.com/api/v4/collateral-account/borrow-history")
.header("X-TXC-APIKEY", "<api-key>")
.header("X-TXC-PAYLOAD", "<api-key>")
.header("X-TXC-SIGNATURE", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"BTC\",\n \"startTime\": 1700000000,\n \"endTime\": 1700100000,\n \"limit\": 50,\n \"offset\": 0,\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whitebit.com/api/v4/collateral-account/borrow-history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TXC-APIKEY"] = '<api-key>'
request["X-TXC-PAYLOAD"] = '<api-key>'
request["X-TXC-SIGNATURE"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset\": \"BTC\",\n \"startTime\": 1700000000,\n \"endTime\": 1700100000,\n \"limit\": 50,\n \"offset\": 0,\n \"request\": \"{{request}}\",\n \"nonce\": 1594297865000\n}"
response = http.request(request)
puts response.read_body{
"records": [
{
"asset": "BTC",
"amount": "108.32",
"principal": "100",
"interest": "6.15",
"status": "active",
"timestamp": 1700000000
}
],
"limit": 50,
"offset": 0
}{
"code": 30,
"message": "Validation failed",
"errors": {}
}{
"code": 30,
"message": "Validation failed",
"errors": {}
}Authorizations
The public WhiteBIT API key.
Base64-encoded JSON request body.
HMAC-SHA512 signature of the payload, hex-encoded. Computed as hex(HMAC-SHA512(payload, api_secret)).
Body
Filter to a single asset. Optional — when omitted or empty, returns borrow history for every asset the caller's region allows to borrow. An unknown or region-blocked asset returns a validation error.
"BTC"
Start of the query window as a Unix timestamp in seconds. Optional, default 0. Must be less than endTime.
1700000000
End of the query window as a Unix timestamp in seconds. Optional, default: now. Must be greater than startTime.
1700100000
Maximum number of records to return. Default: 50. Minimum: 1. Maximum: 100.
1 <= x <= 10050
Number of records to skip. Default: 0. Maximum: 10000.
0 <= x <= 100000
"{{request}}"
1594297865000
Response
Successful response - returns paginated borrow history. records is an empty array, not omitted, when nothing matches.
Was this page helpful?