Get many accounts performance
curl --request POST \
--url https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"e4c1cbff-28a7-4602-9661-169e42040c22",
"a9ef84a1-45c3-4796-8002-297dc57ac85d"
]
}
'import requests
url = "https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance"
payload = { "ids": ["e4c1cbff-28a7-4602-9661-169e42040c22", "a9ef84a1-45c3-4796-8002-297dc57ac85d"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['e4c1cbff-28a7-4602-9661-169e42040c22', 'a9ef84a1-45c3-4796-8002-297dc57ac85d']
})
};
fetch('https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/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/accounts/_mget/performance",
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([
'ids' => [
'e4c1cbff-28a7-4602-9661-169e42040c22',
'a9ef84a1-45c3-4796-8002-297dc57ac85d'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance"
payload := strings.NewReader("{\n \"ids\": [\n \"e4c1cbff-28a7-4602-9661-169e42040c22\",\n \"a9ef84a1-45c3-4796-8002-297dc57ac85d\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"e4c1cbff-28a7-4602-9661-169e42040c22\",\n \"a9ef84a1-45c3-4796-8002-297dc57ac85d\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"e4c1cbff-28a7-4602-9661-169e42040c22\",\n \"a9ef84a1-45c3-4796-8002-297dc57ac85d\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"performance": {
"e4c1cbff-28a7-4602-9661-169e42040c22": {
"averagePricePaid": "2491.73",
"totalInvested": "1266.51",
"unrealizedGains": "-21.55"
},
"a9ef84a1-45c3-4796-8002-297dc57ac85d": {
"averagePricePaid": "107929.90",
"totalInvested": "33.93",
"unrealizedGains": "-0.33"
}
}
}{
"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"
}
}Get many accounts performance
Retrieves the performance of multiple accounts in the portfolio, including the average cost, total invested, and unrealized gains (gains and losses) for each account.
POST
/
core
/
portfolio
/
accounts
/
_mget
/
performance
Get many accounts performance
curl --request POST \
--url https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"e4c1cbff-28a7-4602-9661-169e42040c22",
"a9ef84a1-45c3-4796-8002-297dc57ac85d"
]
}
'import requests
url = "https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance"
payload = { "ids": ["e4c1cbff-28a7-4602-9661-169e42040c22", "a9ef84a1-45c3-4796-8002-297dc57ac85d"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['e4c1cbff-28a7-4602-9661-169e42040c22', 'a9ef84a1-45c3-4796-8002-297dc57ac85d']
})
};
fetch('https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/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/accounts/_mget/performance",
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([
'ids' => [
'e4c1cbff-28a7-4602-9661-169e42040c22',
'a9ef84a1-45c3-4796-8002-297dc57ac85d'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance"
payload := strings.NewReader("{\n \"ids\": [\n \"e4c1cbff-28a7-4602-9661-169e42040c22\",\n \"a9ef84a1-45c3-4796-8002-297dc57ac85d\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"e4c1cbff-28a7-4602-9661-169e42040c22\",\n \"a9ef84a1-45c3-4796-8002-297dc57ac85d\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enterprise.sandbox.uphold.com/core/portfolio/accounts/_mget/performance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"e4c1cbff-28a7-4602-9661-169e42040c22\",\n \"a9ef84a1-45c3-4796-8002-297dc57ac85d\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"performance": {
"e4c1cbff-28a7-4602-9661-169e42040c22": {
"averagePricePaid": "2491.73",
"totalInvested": "1266.51",
"unrealizedGains": "-21.55"
},
"a9ef84a1-45c3-4796-8002-297dc57ac85d": {
"averagePricePaid": "107929.90",
"totalInvested": "33.93",
"unrealizedGains": "-0.33"
}
}
}{
"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 API introduction 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 |
Scopes
Query Parameters
Body
application/json
Was this page helpful?