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

# Get position for portfolio/instrument

> Retrieves the position for a given portfolio and symbol.

<Tabs groupId="programming-language">
  <Tab value="Java" title="Java">
    ```java theme={null}
    PortfoliosService portfoliosService = IntxServiceFactory.createPortfoliosService(client);
    GetPositionForPortfolioInstrumentRequest request = new GetPositionForPortfolioInstrumentRequest.Builder()
        .portfolio("portfolio_id")
        .instrument("BTC-USDC")
        .build();
    GetPositionForPortfolioInstrumentResponse response = portfoliosService.getPositionForPortfolioInstrument(request);
    ```

    For more information, please visit the [INTX Java SDK](https://github.com/coinbase-samples/intx-sdk-java).
  </Tab>

  <Tab value=".NET" title=".NET">
    ```cs theme={null}
    var portfoliosService = new PortfoliosService(client);
    var request = new GetPositionForPortfolioInstrumentRequest(
        Portfolio: "portfolio_id",
        Instrument: "BTC-USDC",
    );
    var response = portfoliosService.GetPositionForPortfolioInstrument(request);
    ```

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

  <Tab value="Go" title="Go">
    ```go theme={null}
    portfoliosSvc := portfolios.NewPortfoliosService(client)
    request := &portfolios.GetInstrumentPositionRequest{
        Portfolio: "portfolio_id",
        Instrument: "BTC-USDC",
    }
    response, err := portfoliosSvc.GetInstrumentPositionRequest(context.Background(), request)
    ```

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

  <Tab value="Python" title="Python">
    ```python theme={null}
    client = IntxClient()
    request = GetPositionForPortfolioInstrumentRequest(
        portfolio="portfolio_id",
        instrument="BTC-USDC",
    )
    response = client.get_position_for_portfolio_instrument(request)
    ```

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

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

    portfoliosService.getInstrumentPosition({
        portfolio: 'PORTFOLIO_ID_HERE',
        instrument: 'ETH-USDC',
    }).then(async (response) => {
        console.log('Portfolio Instrument: ', response);
    })
    ```

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

  <Tab value="CLI" title="CLI">
    ```
    intxctl get-position-for-instrument --help
    ```

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


## OpenAPI

````yaml GET /api/v1/portfolios/{portfolio}/positions/{instrument}
openapi: 3.0.3
info:
  title: REST API
  description: >
    # Welcome to Coinbase INTX API

    ## Introduction

    The INTX APIs allow institutions to trade and manage orders on the
    International Exchange. The following API pages detail various REST API
    endpoints we offer.

    ## Getting Started

    To get started, please visit one of the following pages:

    - [Quickstart](/international-exchange/introduction/quickstart)

    -
    [Overview](/api-reference/international-exchange-api/rest-api/introduction)

    -
    [Authentication](/api-reference/international-exchange-api/rest-api/authentication)

    - [Rate Limits](/international-exchange/introduction/rate-limits-overview)

    ## FIX API

    - [FIX API reference](/international-exchange/fix-api/fix-api-overview)

    ## WebSocket API

    - [WebSocket API
    reference](/international-exchange/websocket-feed/websocket-overview)
  version: '1.0'
servers:
  - url: https://api.international.coinbase.com
security: []
paths:
  /api/v1/portfolios/{portfolio}/positions/{instrument}:
    get:
      tags:
        - Portfolios
      summary: Get position for portfolio/instrument
      description: Retrieves the position for a given portfolio and symbol.
      operationId: getPortfolioPosition
      parameters:
        - name: portfolio
          in: path
          description: >-
            Identifies the portfolio by UUID (e.g.,
            `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g.,
            `5189861793641175`)
          required: true
          schema:
            type: string
        - name: instrument
          in: path
          description: >-
            Identifies the instrument by name (e.g., `BTC-USDC`), UUID (e.g.,
            `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g.,
            `7149252043835013`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Position information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioPosition_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
components:
  schemas:
    PortfolioPosition_v1:
      type: object
      properties:
        id:
          description: The unique identifier of the position
          type: string
          example: 1tvrktwe-1-457
        uuid:
          description: The UUID of the position
          type: string
          format: uuid
          example: 9ab3d012-77ef-4c1a-bf2e-11234567cd89
        symbol:
          description: Name of the instrument the position is in
          type: string
          example: BTC-PERP
        instrument_id:
          description: The unique identifier of the instrument the position is in
          type: string
          example: 14thr7ft-1-0
        instrument_uuid:
          description: The UUID of the instrument the position is in
          type: string
          format: uuid
          example: 8ca6c040-48df-426b-bb4e-74413909da26
        vwap:
          description: >-
            The price of your position based on the last settlement period.
            During each settlement period (5 minute interval), the VWAP is set
            to equal the mark_price.
          type: string
          example: 31011.75
        net_size:
          description: >-
            The size of the position with positive values reflecting a long
            position and negative values reflecting a short position
          type: string
          example: 1.75
        buy_order_size:
          description: Cumulative size of all the open buy orders
          type: string
          example: 2.65
        sell_order_size:
          description: Cumulative size of all the open sell orders
          type: string
          example: 1.2
        initial_margin:
          description: The risk initial margin ratio for this position
          type: string
          example: 0.05
        im_contribution:
          description: >-
            The amount this position contributes to the initial margin
            (allocated initial margin ratio)
          type: string
          example: 0.07
        unrealized_pnl:
          description: The profit or loss of this position (resets to 0 after settlement)
          type: string
          example: 2953.01
        mark_price:
          description: >-
            The current mark price value for the instrument of this position
            used in risk and margin calculations
          type: string
          example: 20000.63
        index_price:
          description: The index price used for the funding process
          type: string
          example: 20001.45
        entry_vwap:
          description: >-
            Volume weighted entry price of the position (not reset to the last
            funding price)
          type: string
          example: 34021.45
        open_position_notional:
          description: The notional value of the open position
          type: string
          example: 37000
        long_open_position_notional:
          description: The notional value of the open long position
          type: string
          example: 37000
        short_open_position_notional:
          description: The notional value of the open short position
          type: string
          example: 0
        position_margin_override:
          description: The margin override value for this position, if set
          type: string
          example: 0.1
  securitySchemes:
    auth_client_id:
      type: apiKey
      name: CB-ACCESS-KEY
      in: header
      description: The Client ID that owns the API Key for the request
    auth_passphrase:
      type: apiKey
      name: CB-ACCESS-PASSPHRASE
      in: header
      description: The pass phrase affiliated with the API Key
    auth_signature:
      type: apiKey
      name: CB-ACCESS-SIGN
      in: header
      description: >-
        A HMAC SHA-256 signature using the API Key secret on the string
        TIMESTAMP, METHOD, REQUEST_PATH, BODY
    auth_timestamp:
      type: apiKey
      name: CB-ACCESS-TIMESTAMP
      in: header
      description: The timestamp of when the request is being made

````