Account Information

List account holdings

get
https://api.snaptrade.com/api/v1/accounts/{accountId}/holdings

Deprecated. Use the finer-grained account data endpoints instead: balances, positions, and orders. Returns a list of balances, positions, and recent orders for the specified account.

Check your API key on the Customer Dashboard billing page to see if you have real-time data access:

  • If you do, this endpoint returns real-time data.
  • If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the manual refresh endpoint.

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.getUserHoldings(
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

A wrapper object containing holdings information for a single account.

accountobject

A single account at a brokerage.

balancesarray of objects or null

List of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade allows holding multiple currencies in the same account.

positionsarray of objects or null

List of stock/ETF/crypto/mutual fund positions in the account.

option_positionsarray of objects or null

List of option positions in the account.

ordersarray of objects or null

List of recent orders in the account, including both pending and executed orders. Note that option orders are included in this list. Option orders will have a null universal_symbol field and a non-null option_symbol field.

This field is deprecated. To get the brokerage reported total market value of the account, please refer to account.balance.total.

The total market value of the account. Note that this field is calculated based on the sum of the values of account positions and cash balances known to SnapTrade. It may not be accurate if the brokerage account has holdings that SnapTrade is not aware of. For example, if the brokerage account holds assets that SnapTrade does not support, the total value may be underreported. In certain cases, this value may also be double-counting cash-equivalent assets if those assets are represented as both cash and positions in the account.

1
{
2
"account": {
3
"id": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
4
"brokerage_authorization": "87b24961-b51e-4db8-9226-f198f6518a89",
5
"name": "Robinhood Individual",
6
"number": "Q6542138443",
7
"institution_account_id": "54953432",
8
"institution_name": "Robinhood",
9
"created_date": "2024-07-23T22:50:22.761Z",
10
"funding_date": "2024-07-25T12:00:00.000Z",
11
"opening_date": "2024-07-20T09:30:00.000Z",
12
"sync_status": {
13
"transactions": {
14
"initial_sync_completed": true,
15
"last_successful_sync": "2022-01-24",
16
"first_transaction_date": "2022-01-24"
17
},
18
"holdings": {
19
"initial_sync_completed": true,
20
"last_successful_sync": "2024-06-28 18:42:46.561408+00:00"
21
}
22
},
23
"balance": {
24
"total": {
25
"amount": 15363.23,
26
"currency": "USD"
27
}
28
},
29
"status": "open",
30
"raw_type": "Margin",
31
"account_category": "INVESTMENT",
32
"meta": {
33
"type": "Margin",
34
"status": "ACTIVE",
35
"institution_name": "Robinhood"
36
},
37
"portfolio_group": "2bcd7cc3-e922-4976-bce1-9858296801c3",
38
"cash_restrictions": [],
39
"is_paper": false
40
},
41
"balances": [
42
{
43
"currency": {
44
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
45
"code": "USD",
46
"name": "US Dollar"
47
},
48
"cash": 300.71,
49
"buying_power": 410.71
50
}
51
],
52
"positions": [
53
{
54
"symbol": {
55
"symbol": {
56
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
57
"symbol": "VAB.TO",
58
"raw_symbol": "VAB",
59
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
60
"currency": {
61
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
62
"code": "USD",
63
"name": "US Dollar"
64
},
65
"exchange": {
66
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
67
"code": "TSX",
68
"mic_code": "XTSE",
69
"name": "Toronto Stock Exchange",
70
"timezone": "America/New_York",
71
"start_time": "09:30:00",
72
"close_time": "16:00:00",
73
"suffix": ".TO"
74
},
75
"type": {
76
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
77
"code": "cs",
78
"description": "Common Stock",
79
"is_supported": true
80
},
81
"figi_code": "BBG000B9XRY4",
82
"figi_instrument": {
83
"figi_code": "BBG000B9Y5X2",
84
"figi_share_class": "BBG001S5N8V8"
85
},
86
"currencies": [
87
{
88
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
89
"code": "USD",
90
"name": "US Dollar"
91
}
92
]
93
},
94
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
95
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
96
"local_id": "3291231",
97
"is_quotable": true,
98
"is_tradable": true
99
},
100
"units": 40,
101
"price": 113.15,
102
"open_pnl": 0.44,
103
"average_purchase_price": 108.3353,
104
"fractional_units": 1.44,
105
"currency": {
106
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
107
"code": "USD",
108
"name": "US Dollar"
109
},
110
"cash_equivalent": false,
111
"tax_lots": [
112
{
113
"original_purchase_date": "2022-01-15T10:30:00Z",
114
"quantity": "10",
115
"purchased_price": "100.50",
116
"cost_basis": "1005.00",
117
"current_value": "1200.00",
118
"position_type": "LONG",
119
"lot_id": "12345678"
120
}
121
]
122
}
123
],
124
"option_positions": [
125
{
126
"symbol": {
127
"option_symbol": {
128
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
129
"ticker": "AAPL 261218C00240000",
130
"option_type": "CALL",
131
"strike_price": 240,
132
"expiration_date": "2026-12-18",
133
"is_mini_option": false,
134
"underlying_symbol": {
135
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
136
"symbol": "SPY",
137
"raw_symbol": "VAB",
138
"description": "SPDR S&P 500 ETF Trust",
139
"currency": {
140
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
141
"code": "USD",
142
"name": "US Dollar"
143
},
144
"exchange": {
145
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
146
"code": "ARCX",
147
"mic_code": "ARCA",
148
"name": "NYSE ARCA",
149
"timezone": "America/New_York",
150
"start_time": "09:30:00",
151
"close_time": "16:00:00",
152
"suffix": "None",
153
"allows_cryptocurrency_symbols": false
154
},
155
"type": {
156
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
157
"code": "cs",
158
"description": "Common Stock",
159
"is_supported": true
160
},
161
"figi_code": "BBG000B9XRY4",
162
"figi_instrument": {
163
"figi_code": "BBG000B9Y5X2",
164
"figi_share_class": "BBG001S5N8V8"
165
},
166
"currencies": [
167
{
168
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
169
"code": "USD",
170
"name": "US Dollar"
171
}
172
]
173
}
174
},
175
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
176
"description": "SPY CALL 7/17 200"
177
},
178
"price": 38.4,
179
"units": -50,
180
"average_purchase_price": 4126,
181
"currency": {
182
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
183
"code": "USD",
184
"name": "US Dollar"
185
}
186
}
187
],
188
"orders": [
189
{
190
"brokerage_order_id": "66a033fa-da74-4fcf-b527-feefdec9257e",
191
"brokerage_group_order_id": "1234567890",
192
"order_role": "TRIGGER",
193
"status": "NONE",
194
"universal_symbol": {
195
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
196
"symbol": "VAB.TO",
197
"raw_symbol": "VAB",
198
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
199
"currency": {
200
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
201
"code": "USD",
202
"name": "US Dollar"
203
},
204
"exchange": {
205
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
206
"code": "TSX",
207
"mic_code": "XTSE",
208
"name": "Toronto Stock Exchange",
209
"timezone": "America/New_York",
210
"start_time": "09:30:00",
211
"close_time": "16:00:00",
212
"suffix": ".TO"
213
},
214
"type": {
215
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
216
"code": "cs",
217
"description": "Common Stock",
218
"is_supported": true
219
},
220
"figi_code": "BBG000B9XRY4",
221
"figi_instrument": {
222
"figi_code": "BBG000B9Y5X2",
223
"figi_share_class": "BBG001S5N8V8"
224
},
225
"currencies": [
226
{
227
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
228
"code": "USD",
229
"name": "US Dollar"
230
}
231
]
232
},
233
"option_symbol": {
234
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
235
"ticker": "AAPL 261218C00240000",
236
"option_type": "CALL",
237
"strike_price": 240,
238
"expiration_date": "2026-12-18",
239
"is_mini_option": false,
240
"underlying_symbol": {
241
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
242
"symbol": "SPY",
243
"raw_symbol": "VAB",
244
"description": "SPDR S&P 500 ETF Trust",
245
"currency": {
246
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
247
"code": "USD",
248
"name": "US Dollar"
249
},
250
"exchange": {
251
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
252
"code": "ARCX",
253
"mic_code": "ARCA",
254
"name": "NYSE ARCA",
255
"timezone": "America/New_York",
256
"start_time": "09:30:00",
257
"close_time": "16:00:00",
258
"suffix": "None",
259
"allows_cryptocurrency_symbols": false
260
},
261
"type": {
262
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
263
"code": "cs",
264
"description": "Common Stock",
265
"is_supported": true
266
},
267
"figi_code": "BBG000B9XRY4",
268
"figi_instrument": {
269
"figi_code": "BBG000B9Y5X2",
270
"figi_share_class": "BBG001S5N8V8"
271
},
272
"currencies": [
273
{
274
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
275
"code": "USD",
276
"name": "US Dollar"
277
}
278
]
279
}
280
},
281
"quote_universal_symbol": {
282
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
283
"symbol": "VAB.TO",
284
"raw_symbol": "VAB",
285
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
286
"currency": {
287
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
288
"code": "USD",
289
"name": "US Dollar"
290
},
291
"exchange": {
292
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
293
"code": "TSX",
294
"mic_code": "XTSE",
295
"name": "Toronto Stock Exchange",
296
"timezone": "America/New_York",
297
"start_time": "09:30:00",
298
"close_time": "16:00:00",
299
"suffix": ".TO"
300
},
301
"type": {
302
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
303
"code": "cs",
304
"description": "Common Stock",
305
"is_supported": true
306
},
307
"figi_code": "BBG000B9XRY4",
308
"figi_instrument": {
309
"figi_code": "BBG000B9Y5X2",
310
"figi_share_class": "BBG001S5N8V8"
311
},
312
"currencies": [
313
{
314
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
315
"code": "USD",
316
"name": "US Dollar"
317
}
318
]
319
},
320
"quote_currency": {
321
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
322
"code": "USD",
323
"name": "US Dollar"
324
},
325
"action": "string",
326
"total_quantity": "100",
327
"open_quantity": "10",
328
"canceled_quantity": "10",
329
"filled_quantity": "80",
330
"execution_price": 12.34,
331
"limit_price": 12.34,
332
"stop_price": 12.5,
333
"trailing_stop": {
334
"amount": "0.60",
335
"type": "DOLLAR"
336
},
337
"order_type": "Market",
338
"time_in_force": "string",
339
"time_placed": "2024-07-30T22:51:49.746Z",
340
"time_updated": "2024-08-05T00:05:57.409Z",
341
"time_executed": "2024-08-05T00:05:57.409Z",
342
"expiry_date": "2024-08-05T00:05:57.409Z",
343
"symbol": "2bcd7cc3-e922-4976-bce1-9858296801c3",
344
"child_brokerage_order_ids": {
345
"take_profit_order_id": "12345678",
346
"stop_loss_order_id": "12345678"
347
}
348
}
349
],
350
"total_value": {
351
"value": 32600.71,
352
"currency": "USD"
353
}
354
}