Python SDK
Portfolio
Read your open positions and demat holdings.
Today's positions and your demat holdings, from the
Portfolio endpoints. Examples use api from
Getting started.
Positions#
method
api.get_positions(...)
api.get_positions(*, timeout: float | None = None) -> dict
Calls GET /v1/positions · Scope: positions.read
Today's net positions. A position squared off today is still listed with
net_qty 0, so filter on net_qty before acting.
Returns#
{"positions": [...]}; fields are on the endpoint.
Raises#
SahiRateLimitException: over 5/s, 250/min or 10,000/day.
Holdings#
method
api.get_holdings(...)
api.get_holdings(*, timeout: float | None = None) -> dict
Calls GET /v1/holdings · Scope: holdings.read
One entry per ISIN, with no name or price. Get the symbol from
get_instruments_by_isin
and the price from get_ltp.
Returns#
{"holdings": [...]}; fields are on the endpoint.
Raises#
SahiRateLimitException: over 5/s, 250/min or 10,000/day.