Requesting Positions

View as MarkdownOpen in Claude

In order to request your account’s positions, you must first query the /portfolio/accounts endpoint. After sending a request to this endpoint, the /portfolio/{accountId}/summary endpoint can be queried for account positions.

1import requests
2
3headers = {"Content-Type": "application/json"}
4
5url = f"https://localhost:5000/v1/api/portfolio/accounts"
6response = requests.get(url, headers=headers, verify=False)
7
8accountId = response.json()[0]["id"]
9
10url = f"https://localhost:5000/v1/api/portfolio/{accountId}/summary"
11response = requests.get(url, headers=headers)
12
13print("response: ", response.json())