Skip to content
Start Trading

Get Positions

client.V1.Positions.GetPositions(ctx, accountID, query) (*V1PositionGetPositionsResponse, error)
GET/v1/accounts/{account_id}/positions

Retrieves all positions for the specified trading account.

ParametersExpand Collapse
accountID int64
query V1PositionGetPositionsParams
InstrumentIDs param.Field[[]string]Optional

Comma-separated instrument identifiers

PageSize param.Field[int64]Optional

The number of items to return per page. Only used when page_token is not provided.

formatint64
maximum1000
minimum1
PageToken param.Field[string]Optional

Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored.

formatbyte
SortBy param.Field[V1PositionGetPositionsParamsSortBy]Optional

Field to sort by

const V1PositionGetPositionsParamsSortBySymbol V1PositionGetPositionsParamsSortBy = "SYMBOL"
const V1PositionGetPositionsParamsSortByInstrumentType V1PositionGetPositionsParamsSortBy = "INSTRUMENT_TYPE"
const V1PositionGetPositionsParamsSortByQuantity V1PositionGetPositionsParamsSortBy = "QUANTITY"
const V1PositionGetPositionsParamsSortByMarketValue V1PositionGetPositionsParamsSortBy = "MARKET_VALUE"
const V1PositionGetPositionsParamsSortByPositionType V1PositionGetPositionsParamsSortBy = "POSITION_TYPE"
const V1PositionGetPositionsParamsSortByUnrealizedPnl V1PositionGetPositionsParamsSortBy = "UNREALIZED_PNL"
const V1PositionGetPositionsParamsSortByDailyUnrealizedPnl V1PositionGetPositionsParamsSortBy = "DAILY_UNREALIZED_PNL"
const V1PositionGetPositionsParamsSortByDailyRealizedPnl V1PositionGetPositionsParamsSortBy = "DAILY_REALIZED_PNL"
SortDirection param.Field[V1PositionGetPositionsParamsSortDirection]Optional

Sort direction

const V1PositionGetPositionsParamsSortDirectionAsc V1PositionGetPositionsParamsSortDirection = "ASC"
const V1PositionGetPositionsParamsSortDirectionDesc V1PositionGetPositionsParamsSortDirection = "DESC"
ReturnsExpand Collapse
type V1PositionGetPositionsResponse struct{…}
AccountID int64

The account this position belongs to

formatint64
AvailableQuantity string

The quantity of a position that is free to be operated on.

InstrumentID string

Unique instrument identifier

formatuuid
InstrumentType SecurityType

Type of security

One of the following:
const SecurityTypeCommonStock SecurityType = "COMMON_STOCK"
const SecurityTypeOption SecurityType = "OPTION"
const SecurityTypeCash SecurityType = "CASH"
MarketValue string

The current market value of the position

PositionType PositionType

The type of position

One of the following:
const PositionTypeLong PositionType = "LONG"
const PositionTypeShort PositionType = "SHORT"
const PositionTypeLongCall PositionType = "LONG_CALL"
const PositionTypeShortCall PositionType = "SHORT_CALL"
const PositionTypeLongPut PositionType = "LONG_PUT"
const PositionTypeShortPut PositionType = "SHORT_PUT"
Quantity string

The number of shares or contracts. Can be positive (long) or negative (short)

Symbol string

The trading symbol for the instrument

AvgPrice stringOptional

The average price paid per share or contract for this position When a null/undefined value is observed, it indicates that there is no available data.

ClosingPrice stringOptional

The closing price used to value the position for the last trading day When a null/undefined value is observed, it indicates that there is no available data.

ClosingPriceDate TimeOptional

The market date associated with closing_price When a null/undefined value is observed, it indicates that there is no available data.

formatdate
CostBasis stringOptional

The total cost basis for this position When a null/undefined value is observed, it indicates that there is no available data.

DailyRealizedPnl stringOptional

The realized profit or loss for this position for the current day When a null/undefined value is observed, it indicates that there is no available data.

DailyUnrealizedPnl stringOptional

The unrealized profit or loss for this position relative to the previous close When a null/undefined value is observed, it indicates that there is no available data.

DailyUnrealizedPnlPct stringOptional

The unrealized profit/loss for the position for the current day, expressed as a percentage of the baseline value (range: 0-100). When a null/undefined value is observed, it indicates that there is no available data.

InstrumentPrice stringOptional

The current market price of the instrument When a null/undefined value is observed, it indicates that there is no available data.

UnderlyingInstrumentID stringOptional

Identifier of the underlying instrument, when available When a null/undefined value is observed, it indicates it does not apply.

formatuuid
UnrealizedPnl stringOptional

The total unrealized profit or loss for this position based on current market value When a null/undefined value is observed, it indicates that there is no available data.

UnrealizedPnlPct stringOptional

The unrealized profit/loss for the position, expressed as a percentage of the position’s cost basis (range: 0-100). When a null/undefined value is observed, it indicates that there is no available data.

Get Positions

package main

import (
  "context"
  "fmt"

  "github.com/clear-street/clear-street-go"
  "github.com/clear-street/clear-street-go/option"
)

func main() {
  client := clearstreet.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.V1.Positions.GetPositions(
    context.TODO(),
    0,
    clearstreet.V1PositionGetPositionsParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{
  "data": [
    {
      "account_id": 19816,
      "available_quantity": "100",
      "avg_price": "145.00",
      "closing_price": "150.50",
      "closing_price_date": "2025-10-31",
      "cost_basis": "14500.00",
      "daily_realized_pnl": "700.00",
      "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
      "instrument_price": "151.00",
      "instrument_type": "COMMON_STOCK",
      "market_value": "15050.00",
      "position_type": "LONG",
      "quantity": "100",
      "symbol": "AAPL",
      "unrealized_pnl": "550.00"
    },
    {
      "account_id": 19816,
      "available_quantity": "100",
      "avg_price": "180.00",
      "closing_price": "180.00",
      "closing_price_date": "2025-10-30",
      "cost_basis": "-9000.00",
      "daily_realized_pnl": "25.00",
      "instrument_id": "d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab",
      "instrument_price": "178.50",
      "instrument_type": "COMMON_STOCK",
      "market_value": "-9000.00",
      "position_type": "SHORT",
      "quantity": "-50",
      "symbol": "TSLA",
      "unrealized_pnl": "75.00"
    },
    {
      "account_id": 19816,
      "available_quantity": "100",
      "avg_price": "2.50",
      "closing_price": "2.70",
      "closing_price_date": "2025-10-30",
      "cost_basis": "2500.00",
      "daily_realized_pnl": "10.00",
      "instrument_id": "e5e6e7e8-f5f6-a5a6-b5b6-b7b8b9babcbe",
      "instrument_price": "2.72",
      "instrument_type": "OPTION",
      "market_value": "2700.00",
      "position_type": "LONG_CALL",
      "quantity": "10",
      "symbol": "AAPL250117C00190000",
      "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
      "unrealized_pnl": "200.00"
    }
  ],
  "error": null,
  "metadata": {
    "next_page_token": "cGFnZT0yJmxhc3Rfc3ltYm9sPVRTM0E=",
    "page_number": 1,
    "request_id": "3f4a5b6c-7d8e-9f0a-1b2c-3d4e5f6a7b8c",
    "total_items": 25,
    "total_pages": 3
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
Returns Examples
{
  "data": [
    {
      "account_id": 19816,
      "available_quantity": "100",
      "avg_price": "145.00",
      "closing_price": "150.50",
      "closing_price_date": "2025-10-31",
      "cost_basis": "14500.00",
      "daily_realized_pnl": "700.00",
      "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
      "instrument_price": "151.00",
      "instrument_type": "COMMON_STOCK",
      "market_value": "15050.00",
      "position_type": "LONG",
      "quantity": "100",
      "symbol": "AAPL",
      "unrealized_pnl": "550.00"
    },
    {
      "account_id": 19816,
      "available_quantity": "100",
      "avg_price": "180.00",
      "closing_price": "180.00",
      "closing_price_date": "2025-10-30",
      "cost_basis": "-9000.00",
      "daily_realized_pnl": "25.00",
      "instrument_id": "d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab",
      "instrument_price": "178.50",
      "instrument_type": "COMMON_STOCK",
      "market_value": "-9000.00",
      "position_type": "SHORT",
      "quantity": "-50",
      "symbol": "TSLA",
      "unrealized_pnl": "75.00"
    },
    {
      "account_id": 19816,
      "available_quantity": "100",
      "avg_price": "2.50",
      "closing_price": "2.70",
      "closing_price_date": "2025-10-30",
      "cost_basis": "2500.00",
      "daily_realized_pnl": "10.00",
      "instrument_id": "e5e6e7e8-f5f6-a5a6-b5b6-b7b8b9babcbe",
      "instrument_price": "2.72",
      "instrument_type": "OPTION",
      "market_value": "2700.00",
      "position_type": "LONG_CALL",
      "quantity": "10",
      "symbol": "AAPL250117C00190000",
      "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
      "unrealized_pnl": "200.00"
    }
  ],
  "error": null,
  "metadata": {
    "next_page_token": "cGFnZT0yJmxhc3Rfc3ltYm9sPVRTM0E=",
    "page_number": 1,
    "request_id": "3f4a5b6c-7d8e-9f0a-1b2c-3d4e5f6a7b8c",
    "total_items": 25,
    "total_pages": 3
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}