For AI agents: the complete documentation index is available at https://docs.snaptrade.com/llms.txt, and the full documentation text is available at https://docs.snaptrade.com/llms-full.txt. Markdown versions of documentation pages are available by appending .md to the URL path.
View as Markdown
Account Information

List account positions

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

Deprecated. Use the newer unified positions endpoint instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.

Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the options endpoint.

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

Authentication Method

Use commercial authentication when acting on behalf of your application and passing end-user credentials with requests that require them.

Credentials
Path
accountIdstring (format: uuid)required

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

Request
Installation
$
npm install snaptrade-typescript-sdk
1
import {
2
Snaptrade,
3
SnaptradeAuth,
4
} from "snaptrade-typescript-sdk";
5
6
const snaptrade = new Snaptrade({
7
auth: SnaptradeAuth.commercialApiKey({
8
consumerKey: "CONSUMER_KEY",
9
clientId: "CLIENT_ID",
10
}),
11
});
12
13
const response =
14
await snaptrade.accountInformation.getUserAccountPositions(
15
{
16
accountId:
17
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
18
userId: "USER_ID",
19
userSecret: "USER_SECRET",
20
},
21
);
22
console.log(response.data);

Response fields

array of objects
object

Describes a single stock/ETF/crypto/mutual fund position in an account.

1
[
2
{
3
"symbol": {
4
"symbol": {
5
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
6
"symbol": "VAB.TO",
7
"raw_symbol": "VAB",
8
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
9
"currency": {
10
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
11
"code": "USD",
12
"name": "US Dollar"
13
},
14
"exchange": {
15
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
16
"code": "TSX",
17
"mic_code": "XTSE",
18
"name": "Toronto Stock Exchange",
19
"timezone": "America/New_York",
20
"start_time": "09:30:00",
21
"close_time": "16:00:00",
22
"suffix": ".TO"
23
},
24
"type": {
25
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
26
"code": "cs",
27
"description": "Common Stock",
28
"is_supported": true
29
},
30
"figi_code": "BBG000B9XRY4",
31
"figi_instrument": {
32
"figi_code": "BBG000B9Y5X2",
33
"figi_share_class": "BBG001S5N8V8"
34
},
35
"currencies": [
36
{
37
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
38
"code": "USD",
39
"name": "US Dollar"
40
}
41
]
42
},
43
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
44
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
45
"local_id": "3291231",
46
"is_quotable": true,
47
"is_tradable": true
48
},
49
"units": 40,
50
"price": 113.15,
51
"open_pnl": 0.44,
52
"average_purchase_price": 108.3353,
53
"fractional_units": 1.44,
54
"currency": {
55
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
56
"code": "USD",
57
"name": "US Dollar"
58
},
59
"cash_equivalent": false,
60
"tax_lots": [
61
{
62
"original_purchase_date": "2022-01-15T10:30:00.000Z",
63
"quantity": "10",
64
"purchased_price": "100.50",
65
"cost_basis": "1005.00",
66
"current_value": "1200.00",
67
"position_type": "LONG",
68
"lot_id": "12345678"
69
}
70
]
71
}
72
]