Get account historical balance
curl --request GET \
--url https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance', 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.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance",
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.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance"
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.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance")
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{
"historicalBalance": [
{
"timestamp": "2020-01-01T00:00:00.000Z",
"balance": {
"total": "1000.00",
"available": "950.00"
}
},
{
"timestamp": "2020-01-02T00:00:00.000Z",
"balance": {
"total": "1200.00",
"available": "1150.00"
}
}
]
}Portfolio
Get account historical balance
Retrieves the historical balance of a specific account, including the total and available balance over time.
GET
/
core
/
portfolio
/
accounts
/
{accountId}
/
historical-balance
Get account historical balance
curl --request GET \
--url https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance', 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.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance",
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.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance"
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.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/{accountId}/historical-balance")
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{
"historicalBalance": [
{
"timestamp": "2020-01-01T00:00:00.000Z",
"balance": {
"total": "1000.00",
"available": "950.00"
}
},
{
"timestamp": "2020-01-02T00:00:00.000Z",
"balance": {
"total": "1200.00",
"available": "1150.00"
}
}
]
}Denomination
Thedenomination query parameter allows you to denominate rates against another asset. If no value is set for this parameter, it defaults to USD.
There is a specific set of assets allowed, including but not limited to: USD, EUR, GBP, AUD, CAD, NZD, MXN, and BTC. If you need a particular asset added to this list, please reach out to your Account Manager.
For a more detailed explanation of the denomination concept, check the Core API introduction page.
Interval
Theinterval query parameter determines the overall timespan of historical data and the frequency of the data points (rollup frequency).
Each interval value defines how far back in time the data spans, and how granular each returned data point is within that range:
| Interval | Description | Rollup Frequency |
|---|---|---|
one-hour | Past hour of historical data | 30 seconds |
one-day | Past day of historical data | 10 minutes |
one-week | Past week of historical data | 1 hour |
one-month | Past month of historical data | 6 hours |
one-year | Past year of historical data | 2 days |
Scopes
Query Parameters
Was this page helpful?