Account Information

List all account positions

BETA
get
https://api.snaptrade.com/api/v1/accounts/{accountId}/positions/all

Returns a list of all positions in the specified account.

The results list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the instrument.kind discriminator to determine the schema for each position's instrument.

Stock positions may also include cash_equivalent, and may include tax_lots when tax lot data is enabled for the account.

If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see this guide on how to fix a disabled connection.

Execute an API Request

Path
accountIdstring (format: uuid)required

Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

Query
userIdstringrequired

SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.

userSecretstringrequired

SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the rotate user secret endpoint.

Authorization
Request
Installation
$
npm install snaptrade-typescript-sdk
1
import { Snaptrade } from "snaptrade-typescript-sdk";
2
3
const snaptrade = new Snaptrade({
4
clientId: "PARTNER_CLIENT_ID",
5
consumerKey: "CONSUMER_KEY",
6
});
7
8
const response =
9
await snaptrade.accountInformation.getAllAccountPositions(
10
{
11
accountId:
12
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
13
userId: "snaptrade-user-123",
14
userSecret:
15
"adf2aa34-8219-40f7-a6b3-60156985cc61",
16
},
17
);
18
console.log(response.data);

Response fields

object

Information about all account positions.

resultsarray of objects

Positions returned for the request.

1
{
2
"results": [
3
{
4
"instrument": {
5
"kind": "stock",
6
"id": "1ef3a5d3-4a9b-40b2-b8d1-cc35f74d6324",
7
"symbol": "AAPL",
8
"raw_symbol": "AAPL",
9
"description": "Apple Inc.",
10
"currency": "USD",
11
"exchange": "XNAS",
12
"figi_instrument": {
13
"figi_code": "BBG000B9Y5X2",
14
"figi_share_class": "BBG001S5N8V8"
15
}
16
},
17
"units": "10.5",
18
"price": "123.45",
19
"cost_basis": "118.2",
20
"currency": "USD",
21
"cash_equivalent": false,
22
"tax_lots": [
23
{
24
"original_purchase_date": "2022-01-15T10:30:00Z",
25
"quantity": "10",
26
"purchased_price": "100.50",
27
"cost_basis": "1005.00",
28
"current_value": "1200.00",
29
"position_type": "LONG",
30
"lot_id": "12345678"
31
}
32
]
33
}
34
]
35
}