Get performance
curl --request GET \
--url https://api.enterprise.sandbox.uphold.com/core/portfolio/performance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.enterprise.sandbox.uphold.com/core/portfolio/performance"
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/performance', 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/performance",
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/performance"
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/performance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enterprise.sandbox.uphold.com/core/portfolio/performance")
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{
"performance": {
"totalInvested": "1276.64",
"unrealizedGains": "14.25"
}
}{
"code": "entity_not_found",
"message": "The denomination asset cannot be found",
"details": {
"context": "query",
"property": "denomination",
"entity": "asset"
}
}{
"code": "asset_not_supported",
"message": "The denomination asset is not supported",
"details": {
"context": "query",
"property": "denomination"
}
}Portfolio
Get performance
Retrieves the performance of the portfolio, including the average cost, total invested, and unrealized gains (gains and losses).
GET
/
core
/
portfolio
/
performance
Get performance
curl --request GET \
--url https://api.enterprise.sandbox.uphold.com/core/portfolio/performance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.enterprise.sandbox.uphold.com/core/portfolio/performance"
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/performance', 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/performance",
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/performance"
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/performance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enterprise.sandbox.uphold.com/core/portfolio/performance")
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{
"performance": {
"totalInvested": "1276.64",
"unrealizedGains": "14.25"
}
}{
"code": "entity_not_found",
"message": "The denomination asset cannot be found",
"details": {
"context": "query",
"property": "denomination",
"entity": "asset"
}
}{
"code": "asset_not_supported",
"message": "The denomination asset is not supported",
"details": {
"context": "query",
"property": "denomination"
}
}All calculations are performed internally in USD. When a denomination asset other than USD is used, amounts are converted using current market exchange rates. This can lead to discrepancies in portfolio performance values, which tend to be minor for assets that remain relatively stable against USD.
Denomination
Thedenomination query parameter allows you to denominate rates against another asset. If no value is set for this parameter, it defaults to USD.
For a more detailed explanation of the denomination concept, check the Core Concepts page.
Interval
Theinterval query parameter determines the time period for which performance data is calculated and returned. This allows you to analyze account performance over different timeframes, from recent short-term activity to comprehensive long-term investment tracking. Each interval value corresponds to a specific historical period:
| Interval | Description |
|---|---|
one-hour | Past hour of historical data |
one-day | Past day of historical data |
all-time | All historical data available |
Authorizations
OAuth 2.0 authentication.
Query Parameters
Specifies the asset code to use as the denomination for value conversion. If not provided, USD is used by default.
Minimum string length:
1The interval for the portfolio performance.
Available options:
one-hour, one-day, all-time Response
Portfolio performance retrieved.
Show child attributes
Show child attributes
Was this page helpful?