Skip to main content
GET
/
tools
/
alpaca
/
get_position
{
  "provider": "<string>",
  "symbol": "<string>",
  "qty": "<string>",
  "avg_entry_price": "<string>",
  "current_price": "<string>",
  "market_value": "<string>",
  "unrealized_pl": "<string>",
  "unrealized_plpc": "<string>",
  "side": "long",
  "provider_fields": {}
}

alpaca_get_position

tools = trading.alpaca(
    api_key=os.environ["ALPACA_KEY"],
    api_secret=os.environ["ALPACA_SECRET"],
    model="openai",
    paper=True,
    minimal=True,
    include=["alpaca_get_position"],
)
Options
  • include / exclude: filter which tools are exposed (use full names like alpaca_get_position).
  • minimal: omit provider and provider_fields when True.
  • paper: use Alpaca paper trading instead of live trading.

Body

application/json

This is a request to obtain information. Your API keys are required.

symbol_or_asset_id
string
required

Ticker symbol or Alpaca asset ID.

Response

object | null

Position (OpenTools trading schema) or null if not found.

provider
string | null

Trading provider identifier. Omitted when minimal=True.

symbol
string

Instrument symbol (e.g. "AAPL", "BTCUSD").

qty
string | null

Position size.

avg_entry_price
string | null

Average entry price.

current_price
string | null

Latest price used for valuation.

market_value
string | null

Current position market value.

unrealized_pl
string | null

Unrealized profit/loss.

unrealized_plpc
string | null

Unrealized profit/loss percent (factor of 1, not 100).

side
enum<string> | null

Position direction.

Available options:
long,
short
provider_fields
object

Extra provider-specific fields (omitted when minimal=True).