Trading

List Open Positions for an Account

List open positions for an account

get/v1/trading/accounts/{account_id}/positions

Request

  • Base URL
    https://broker-api.giftcity.sandbox.in.alpaca.markets
  • URL
    https://broker-api.giftcity.sandbox.in.alpaca.markets/v1/trading/accounts/{account_id}/positions
  • Auth
    HTTP basic

Response

Success

asset_class'us_equity' | 'us_option' | 'us_index' | 'crypto' | 'crypto_perp' | 'ipo' required

This represents the category to which the asset belongs to. It serves to identify the nature of the financial instrument, with options including "us_equity" for U.S. equities, "us_option" for U.S. options, "crypto" for cryptocurrencies, and "ipo" for IPO indications of interest. This asset_class: ipo value is distinct from the assets API attributes: ["ipo"] flag.

asset_idstring uuid required

Asset ID (For options this represents the option contract ID)

asset_marginableboolean

Indicates if this asset is marginable

avg_entry_pricestring required

Average entry price of the position

avg_entry_swap_ratestring decimal

The average swap rate of the position. This is only returned for LCT accounts.

change_todaystring decimal required

Percent change from last day price (by a factor of 1)

cost_basisstring decimal required

Total cost basis

current_pricestring decimal required

Current asset price per share

exchangestring required

Exchange name of the asset

lastday_pricestring decimal required

Last day's asset price per share based on the closing value of the last trading day

market_valuestring decimal required

Total market value of the position

qtystring required

The number of shares

qty_availablestring required

Total number of shares available minus open orders / locked for options covered call

side'long' | 'short' required
swap_ratestring decimal

The latest swap rate. This is only returned for LCT accounts.

symbolstring required

Asset symbol

unrealized_intraday_plstring decimal required

Unrealized profit/loss for the day

unrealized_intraday_plpcstring decimal required

Unrealized interday profit/loss percent (by a factor of 1)

unrealized_plstring decimal required

Unrealized profit/loss

unrealized_plpcstring decimal required

Unrealized profit/loss percent (by a factor of 1)

Example response

[
  {
    "asset_class": "us_equity",
    "asset_id": "93f58d0b-6c53-432d-b8ce-2bad264dbd94",
    "asset_marginable": false,
    "avg_entry_price": "172.08",
    "change_today": "0.0189483657034581",
    "cost_basis": "688.32",
    "current_price": "172.08",
    "exchange": "NASDAQ",
    "lastday_price": "168.88",
    "market_value": "688.32",
    "qty": "4",
    "qty_available": "4",
    "side": "long",
    "symbol": "AAPL",
    "unrealized_intraday_pl": "0",
    "unrealized_intraday_plpc": "0",
    "unrealized_pl": "0",
    "unrealized_plpc": "0"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.