获取余额历史
curl --request GET \
--url https://api.qbank.cl/platform/v1/balances/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/balances/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qbank.cl/platform/v1/balances/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://api.qbank.cl/platform/v1/balances/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.qbank.cl/platform/v1/balances/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.qbank.cl/platform/v1/balances/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/balances/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"account_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"from": "2026-06-12",
"to": "2026-07-11",
"granularity": "day",
"timezone": "UTC",
"assets": {
"USDT": {
"series": [
{
"date": "2026-06-12",
"balance": "100.000000"
},
{
"date": "2026-06-13",
"balance": "100.000000"
},
{
"date": "2026-07-11",
"balance": "125.430000"
}
],
"first": "100.000000",
"last": "125.430000",
"change_pct": "25.43"
},
"BTC": {
"series": [
{
"date": "2026-06-12",
"balance": "0.00060000"
},
{
"date": "2026-07-11",
"balance": "0.00060000"
}
],
"first": "0.00060000",
"last": "0.00060000",
"change_pct": "0.00"
},
"BANK_USD": {
"series": [
{
"date": "2026-06-12",
"balance": "1500.00"
},
{
"date": "2026-07-11",
"balance": "1725.50"
}
],
"first": "1500.00",
"last": "1725.50",
"change_pct": "15.03"
}
},
"total_usd": {
"series": [
{
"date": "2026-06-12",
"balance_usd": "163.73"
},
{
"date": "2026-07-11",
"balance_usd": "191.34"
}
],
"first": "163.73",
"last": "191.34",
"change_pct": "16.86",
"spot_priced_dates": [],
"unpriced_assets": []
},
"period": {
"in_usd": "280.20",
"out_usd": "254.77",
"net_usd": "25.43"
},
"current": {
"items": [
{
"asset": "USDT",
"available": "125.430000",
"held": "10.000000",
"usd_estimate": "135.43"
},
{
"asset": "USDC",
"available": "0.000000",
"held": "0.000000",
"usd_estimate": "0.00"
},
{
"asset": "BTC",
"available": "0.00060000",
"held": "0.00000000",
"usd_estimate": "65.91"
},
{
"asset": "GOLD",
"available": "0.000000",
"held": "0.000000",
"usd_estimate": "0.00"
}
],
"net_worth_usd_estimate": "201.34"
}
}{
"error": "invalid_range",
"message": "from and to are required (YYYY-MM-DD)"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "account_required",
"message": "this endpoint requires an account credential"
}获取余额历史
账户余额的每日演变,用于仪表盘图表:每个资产一条序列(每日收盘可用余额,无流水的日期沿用前值),外加一条按各日历史参考价对 BTC/GOLD 估值的 USD 汇总序列。包含期间总流入/流出及当前快照(可用 + 冻结),前端可据此渲染 Mercury 风格的余额卡片及其百分比变化。序列跟踪可用余额(冻结没有历史);current 携带今日各资产的 held。在历史价格存在之前用今日现价估值的日期会在 spot_priced_dates 中披露——绝不虚构数值。
assets 映射还包含银行账户镜像(BANK_USD、BANK_EUR),以其自身货币(2 位小数)作为独立序列提供。它们不计入 total_usd 汇总——该汇总仅覆盖运营余额(USDT、USDC、BTC、GOLD)。
GET
/
v1
/
balances
/
history
获取余额历史
curl --request GET \
--url https://api.qbank.cl/platform/v1/balances/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/balances/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qbank.cl/platform/v1/balances/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://api.qbank.cl/platform/v1/balances/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.qbank.cl/platform/v1/balances/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.qbank.cl/platform/v1/balances/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/balances/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"account_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"from": "2026-06-12",
"to": "2026-07-11",
"granularity": "day",
"timezone": "UTC",
"assets": {
"USDT": {
"series": [
{
"date": "2026-06-12",
"balance": "100.000000"
},
{
"date": "2026-06-13",
"balance": "100.000000"
},
{
"date": "2026-07-11",
"balance": "125.430000"
}
],
"first": "100.000000",
"last": "125.430000",
"change_pct": "25.43"
},
"BTC": {
"series": [
{
"date": "2026-06-12",
"balance": "0.00060000"
},
{
"date": "2026-07-11",
"balance": "0.00060000"
}
],
"first": "0.00060000",
"last": "0.00060000",
"change_pct": "0.00"
},
"BANK_USD": {
"series": [
{
"date": "2026-06-12",
"balance": "1500.00"
},
{
"date": "2026-07-11",
"balance": "1725.50"
}
],
"first": "1500.00",
"last": "1725.50",
"change_pct": "15.03"
}
},
"total_usd": {
"series": [
{
"date": "2026-06-12",
"balance_usd": "163.73"
},
{
"date": "2026-07-11",
"balance_usd": "191.34"
}
],
"first": "163.73",
"last": "191.34",
"change_pct": "16.86",
"spot_priced_dates": [],
"unpriced_assets": []
},
"period": {
"in_usd": "280.20",
"out_usd": "254.77",
"net_usd": "25.43"
},
"current": {
"items": [
{
"asset": "USDT",
"available": "125.430000",
"held": "10.000000",
"usd_estimate": "135.43"
},
{
"asset": "USDC",
"available": "0.000000",
"held": "0.000000",
"usd_estimate": "0.00"
},
{
"asset": "BTC",
"available": "0.00060000",
"held": "0.00000000",
"usd_estimate": "65.91"
},
{
"asset": "GOLD",
"available": "0.000000",
"held": "0.000000",
"usd_estimate": "0.00"
}
],
"net_worth_usd_estimate": "201.34"
}
}{
"error": "invalid_range",
"message": "from and to are required (YYYY-MM-DD)"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "account_required",
"message": "this endpoint requires an account credential"
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
查询参数
开始日期(YYYY-MM-DD,UTC,含当日)。
结束日期(YYYY-MM-DD,UTC,含当日)。最大范围 366 天。
响应
每个资产的每日余额序列,外加 USD 汇总。
示例:
"day"
示例:
"UTC"
每个资产一条每日收盘余额序列。包含运营余额(USDT、USDC、BTC、GOLD)以及以自身货币计的银行账户镜像(BANK_USD、BANK_EUR);银行序列不计入 total_usd。
Show child attributes
Show child attributes
所有余额按日汇总的 USD 价值。
Show child attributes
Show child attributes
期间的总流入/流出(USD)。
Show child attributes
Show child attributes
当前快照(可用 + 冻结,按现价估值)。
Show child attributes
Show child attributes
最后修改于 2026年7月19日
⌘I