获取外汇汇率历史
curl --request GET \
--url https://api.qbank.cl/platform/v1/rates/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/rates/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/rates/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/rates/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/rates/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/rates/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/rates/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",
"base": "USD",
"from": "2026-06-12",
"to": "2026-07-11",
"granularity": "day",
"rates": {
"chile": {
"currency": "CLP",
"series": [
{
"date": "2026-06-12",
"rate": "939.068965",
"payin_rate": "967.452325"
},
{
"date": "2026-06-13",
"rate": "940.886699",
"payin_rate": "969.325000"
},
{
"date": "2026-07-11",
"rate": "910.896551",
"payin_rate": "938.428400"
}
],
"first": "939.068965",
"last": "910.896551",
"change_pct": "-3.00"
},
"mexico": {
"currency": "MXN",
"series": [
{
"date": "2026-06-12",
"rate": "17.241379",
"payin_rate": "17.762500"
},
{
"date": "2026-07-11",
"rate": "17.832512",
"payin_rate": "18.371500"
}
],
"first": "17.241379",
"last": "17.832512",
"change_pct": "3.43"
}
},
"asset_prices": {
"BTC": {
"currency": "USD",
"unit": "btc",
"series": [
{
"date": "2026-06-12",
"price": "106214.55"
},
{
"date": "2026-07-11",
"price": "109853.24"
}
],
"first": "106214.55",
"last": "109853.24",
"change_pct": "3.43"
},
"GOLD": {
"currency": "USD",
"unit": "gram",
"series": [
{
"date": "2026-06-12",
"price": "106.8812"
},
{
"date": "2026-07-11",
"price": "107.5341"
}
],
"first": "106.8812",
"last": "107.5341",
"change_pct": "0.61"
}
},
"retrieved_at": "2026-07-11T15:00:00Z"
}{
"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"
}{
"error": "rates_unavailable",
"message": "could not fetch fx rate history"
}获取外汇汇率历史
适用于调用账户的外汇汇率时间序列,用于汇率演变图表。每个点携带你在该时刻操作会得到的相同汇率——rate(payout 侧)和 payin_rate(充值侧)——且每个国家块包含 first、last 及二者之间带符号的 change_pct,可直接用于 “+3.4% / -3.0%” 徽章。asset_prices 携带 BTC 与 GOLD 的 USD 参考序列。无数据的桶沿用前值;历史开始之前的日期会被省略(绝不虚构)。
GET
/
v1
/
rates
/
history
获取外汇汇率历史
curl --request GET \
--url https://api.qbank.cl/platform/v1/rates/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qbank.cl/platform/v1/rates/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/rates/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/rates/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/rates/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/rates/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/rates/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",
"base": "USD",
"from": "2026-06-12",
"to": "2026-07-11",
"granularity": "day",
"rates": {
"chile": {
"currency": "CLP",
"series": [
{
"date": "2026-06-12",
"rate": "939.068965",
"payin_rate": "967.452325"
},
{
"date": "2026-06-13",
"rate": "940.886699",
"payin_rate": "969.325000"
},
{
"date": "2026-07-11",
"rate": "910.896551",
"payin_rate": "938.428400"
}
],
"first": "939.068965",
"last": "910.896551",
"change_pct": "-3.00"
},
"mexico": {
"currency": "MXN",
"series": [
{
"date": "2026-06-12",
"rate": "17.241379",
"payin_rate": "17.762500"
},
{
"date": "2026-07-11",
"rate": "17.832512",
"payin_rate": "18.371500"
}
],
"first": "17.241379",
"last": "17.832512",
"change_pct": "3.43"
}
},
"asset_prices": {
"BTC": {
"currency": "USD",
"unit": "btc",
"series": [
{
"date": "2026-06-12",
"price": "106214.55"
},
{
"date": "2026-07-11",
"price": "109853.24"
}
],
"first": "106214.55",
"last": "109853.24",
"change_pct": "3.43"
},
"GOLD": {
"currency": "USD",
"unit": "gram",
"series": [
{
"date": "2026-06-12",
"price": "106.8812"
},
{
"date": "2026-07-11",
"price": "107.5341"
}
],
"first": "106.8812",
"last": "107.5341",
"change_pct": "0.61"
}
},
"retrieved_at": "2026-07-11T15:00:00Z"
}{
"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"
}{
"error": "rates_unavailable",
"message": "could not fetch fx rate history"
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
查询参数
开始日期(YYYY-MM-DD,UTC,含当日)。
结束日期(YYYY-MM-DD,UTC,含当日)。
桶大小。day 最大范围 366 天,hour 最大 31 天。
可用选项:
day, hour 可选的本地货币过滤(例如 CLP)。
最后修改于 2026年7月18日
⌘I