List Portfolios
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfoliosimport requests
url = "https://api.prime.coinbase.com/v1/portfolios"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios', 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.prime.coinbase.com/v1/portfolios",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/portfolios"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/portfolios")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"portfolios": [
{
"id": "e8bbed13-fa33-41de-86d5-4335d8f08166",
"name": "CryptoBalances",
"entity_id": "2c521d6c-1cfb-4371-bf9c-5a42938d3e75",
"organization_id": "4c1d4464-e53b-429f-a81d-71ae7e2e687c",
"entity_name": "Sample Prime Entity"
}
]
}Portfolios
List Portfolios
List all portfolios for which the current API key has read access.
GET
/
v1
/
portfolios
List Portfolios
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfoliosimport requests
url = "https://api.prime.coinbase.com/v1/portfolios"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios', 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.prime.coinbase.com/v1/portfolios",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/portfolios"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/portfolios")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"portfolios": [
{
"id": "e8bbed13-fa33-41de-86d5-4335d8f08166",
"name": "CryptoBalances",
"entity_id": "2c521d6c-1cfb-4371-bf9c-5a42938d3e75",
"organization_id": "4c1d4464-e53b-429f-a81d-71ae7e2e687c",
"entity_name": "Sample Prime Entity"
}
]
}Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples
For more information, please visit the Prime Java SDK.For more information, please visit the Prime .NET SDK.For more information, please visit the Prime Go SDK.For more information, please visit the Prime Python SDK.For more information, please visit the Prime CLI.For more information, please visit the Prime TS SDK.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
PortfoliosService portfoliosService = PrimeServiceFactory.createPortfoliosService(client);
ListPortfoliosResponse response = portfoliosService.listPortfolios();
var portfoliosService = new PortfoliosService(client);
var response = portfoliosService.ListPortfolios();
portfoliosService := portfolios.NewPortfoliosService(client)
request := &portfolios.ListPortfolios{}
response, err := portfoliosService.ListPortfolios(context.Background(), request)
prime_client = PrimeClient(credentials)
request = ListPortfoliosRequest()
response = prime_client.list_portfolios(request)
primectl list-portfolios --entity-id ENTITY_ID_HERE
const portfoliosService = new PortfoliosService(client);
portfoliosService.listPortfolios().then(async (response) => {
console.log('Portfolios: ', response);
})
Response
200 - application/json
A successful response.
A list of portfolios.
Show child attributes
Show child attributes
Was this page helpful?
⌘I