> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Portfolio by Portfolio ID

> Retrieve a given portfolio by its portfolio ID.

Use the Prime SDK or CLI to test this endpoint by following the [quickstart](/prime/introduction/quickstart) guide and running with the following examples

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    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](https://github.com/coinbase-samples/prime-sdk-java).
  </Tab>

  <Tab title=".NET">
    ```csharp wrap theme={null}
    var portfoliosService = new PortfoliosService(client);

    var request = new GetPortfolioByIdRequest("PORTFOLIO_ID_HERE");

    var response = portfoliosService.GetPortfolioById(request);
    ```

    For more information, please visit the [Prime .NET SDK](https://github.com/coinbase-samples/prime-sdk-dotnet).
  </Tab>

  <Tab title="Go">
    ```go wrap theme={null}
    portfoliosService := portfolios.NewPortfoliosService(client)

    request := &portfolios.GetPortfolio{
        PortfolioId: "PORTFOLIO_ID_HERE",
    }

    response, err := portfoliosService.GetPortfolio(context.Background(), request)
    ```

    For more information, please visit the [Prime Go SDK](https://github.com/coinbase-samples/prime-sdk-go).
  </Tab>

  <Tab title="Python">
    ```python wrap theme={null}
    prime_client = PrimeClient(credentials)

    request = GetPortfolioRequest(
        portfolio_id="PORTFOLIO_ID_HERE",
    )

    response = prime_client.get_portfolio(request)
    ```

    For more information, please visit the [Prime Python SDK](https://github.com/coinbase-samples/prime-sdk-py).
  </Tab>

  <Tab title="CLI">
    ```bash wrap theme={null}
    primectl get-portfolio --help
    ```

    For more information, please visit the [Prime CLI](https://github.com/coinbase-samples/prime-cli).
  </Tab>

  <Tab title="TS/JS">
    ```typescript wrap theme={null}
    const portfoliosService = new PortfoliosService(client);

    portfoliosService.getPortfolio({
        portfolioId: 'PORTFOLIO_ID_HERE'
    }).then(async (response) => {
        console.log('Portfolio: ', response);
    })
    ```

    For more information, please visit the [Prime TS SDK](https://github.com/coinbase-samples/prime-sdk-ts).
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /v1/portfolios/{portfolio_id}
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v1/portfolios/{portfolio_id}:
    get:
      tags:
        - Portfolios
      summary: Get Portfolio by Portfolio ID
      description: Retrieve a given portfolio by its portfolio ID.
      operationId: PrimeRESTAPI_GetPortfolio
      parameters:
        - name: portfolio_id
          in: path
          description: The portfolio ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetPortfolioResponse
components:
  schemas:
    coinbase.public_rest_api.GetPortfolioResponse:
      type: object
      properties:
        portfolio:
          $ref: '#/components/schemas/coinbase.public_rest_api.Portfolio'
    coinbase.public_rest_api.Portfolio:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the portfolio
          example: e8bbed13-fa33-41de-86d5-4335d8f08166
        name:
          type: string
          description: The name of the portfolio
          example: CryptoBalances
        entity_id:
          type: string
          description: The ID of the entity to which the portfolio is associated
          example: 2c521d6c-1cfb-4371-bf9c-5a42938d3e75
        organization_id:
          type: string
          description: The ID of the organization to which the portfolio is associated
          example: 4c1d4464-e53b-429f-a81d-71ae7e2e687c
        entity_name:
          type: string
          description: The name of the entity to which the portfolio is associated
          example: Sample Prime Entity

````