Skip to content
Get started

Get Positions

PositionGetPositionsResponse v1().positions().getPositions(PositionGetPositionsParamsparams = PositionGetPositionsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/accounts/{account_id}/positions

Retrieves all positions for the specified trading account.

ParametersExpand Collapse
PositionGetPositionsParams params
Optional<Long> accountId
Optional<List<String>> instrumentIds

Comma-separated OEMS instrument UUIDs

Optional<Long> pageSize

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

formatint64
maximum1000
minimum1
Optional<String> pageToken

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

formatbyte
Optional<SortBy> sortBy

Field to sort by

SYMBOL("SYMBOL")
INSTRUMENT_TYPE("INSTRUMENT_TYPE")
QUANTITY("QUANTITY")
MARKET_VALUE("MARKET_VALUE")
POSITION_TYPE("POSITION_TYPE")
UNREALIZED_PNL("UNREALIZED_PNL")
DAILY_UNREALIZED_PNL("DAILY_UNREALIZED_PNL")
Optional<SortDirection> sortDirection

Sort direction

ASC("ASC")
DESC("DESC")
ReturnsExpand Collapse
class PositionGetPositionsResponse:
List<Position> data
long accountId

The account this position belongs to

formatint64
String availableQuantity

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

String instrumentId

OEMS instrument UUID

formatuuid
SecurityType instrumentType

Type of security

One of the following:
COMMON_STOCK("COMMON_STOCK")
PREFERRED_STOCK("PREFERRED_STOCK")
OPTION("OPTION")
CASH("CASH")
OTHER("OTHER")
String marketValue

The current market value of the position

PositionType positionType

The type of position

One of the following:
LONG("LONG")
SHORT("SHORT")
LONG_CALL("LONG_CALL")
SHORT_CALL("SHORT_CALL")
LONG_PUT("LONG_PUT")
SHORT_PUT("SHORT_PUT")
String quantity

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

String symbol

The trading symbol for the instrument

Optional<String> avgPrice

The average price paid per share or contract for this position

Optional<String> closingPrice

The closing price used to value the position for the last trading day

Optional<LocalDate> closingPriceDate

The market date associated with closing_price

formatdate
Optional<String> costBasis

The total cost basis for this position

Optional<String> dailyUnrealizedPnl

The unrealized profit or loss for this position relative to the previous close

Optional<String> dailyUnrealizedPnlPct

The unrealized profit/loss for the position for the current day, expressed as a percentage of the baseline value (range: 0-100).

Optional<String> instrumentPrice

The current market price of the instrument

Optional<String> underlyingInstrumentId

OEMS instrument identifier of the underlying instrument, if resolvable

formatuuid
Optional<String> unrealizedPnl

The total unrealized profit or loss for this position based on current market value

Optional<String> unrealizedPnlPct

The unrealized profit/loss for the position, expressed as a percentage of the position’s cost basis (range: 0-100).

Get Positions

package com.clear_street.api.example;

import com.clear_street.api.client.ClearStreetClient;
import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
import com.clear_street.api.models.v1.positions.PositionGetPositionsParams;
import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        PositionGetPositionsResponse response = client.v1().positions().getPositions(0L);
    }
}
{
  "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",
      "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",
      "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",
      "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",
      "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",
      "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",
      "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"
  }
}