Skip to main content
GET
/
v1
/
portfolios
/
{portfolio_id}
Get Portfolio by Portfolio ID
curl --request GET \
  --url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}
import requests

url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}', 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/{portfolio_id}",
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/{portfolio_id}"

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/{portfolio_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}")

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
{
  "portfolio": {
    "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
PortfoliosService portfoliosService = PrimeServiceFactory.createPortfoliosService(client);

GetPortfolioByIdRequest request = new GetPortfolioByIdRequest.Builder().portfolioId("PORTFOLIO_ID_HERE").build();

GetPortfolioByIdResponse response = portfoliosService.getPortfolioById(request);
For more information, please visit the Prime Java SDK.

Path Parameters

portfolio_id
string
required

The portfolio ID

Response

200 - application/json

A successful response.

portfolio
object